42 super.OnClick(w,
x,
y, button);
44 switch (w.GetUserID())
63 Widget preview_frame = layoutRoot.FindAnyWidget(
"ItemFrameWidget");
73 PPERequesterBank.GetRequester(PPERequester_InventoryBlur).Start();
80 super.OnMouseButtonDown(w,
x,
y, button);
109 super.OnMouseWheel(w,
x,
y, wheel);
127 if ( w > 0.5 && w < 3 )
132 int screen_w, screen_h;
142 if (!root_widget || !item)
return;
144 Widget panelInfo = root_widget.FindAnyWidget(
"InventoryInfoPanelWidget");
147 if ( item.IsInherited(
ZombieBase ) || item.IsInherited( Car ) )
149 panelInfo.Show(
false );
153 panelInfo.Show(
true );
157 if ( !item.IsInherited(
ZombieBase ) && !item.IsInherited( Car ) )
160 string tooltip = iItem.GetTooltip();
161 if (iItem.IsMeleeFinisher())
162 tooltip = tooltip +
"\n" +
"#inv_inspect_stealth_tooltip";
178 Widget content = root_widget.FindAnyWidget(
"InventoryInfoPanelWidget");
184 if (!root_widget )
return;
192 if ( item.IsInherited(
ZombieBase ) || item.IsInherited( Car ) )
return;
194 int damageLevel = item.GetHealthLevel();
239 if ( item.IsInherited(
ZombieBase ) || item.IsInherited( Car ) )
return;
243 if( item_base && item_base.GetQuantity() > 0 && item_base.
IsBloodContainer() )
247 if( blood_container.GetBloodTypeVisible() )
259 else if( item_base && item_base.GetQuantity() > 0 && item_base.IsLiquidContainer() )
261 int liquid_type = item_base.GetLiquidType();
329 if ( item.IsInherited(
ZombieBase ) || item.IsInherited( Car ) )
return;
332 ObjectTemperatureState temperatureState;
335 if (item_base && item.CanHaveTemperature())
337 temperature = item_base.GetTemperature();
338 temperatureState = ObjectTemperatureState.GetStateData(temperature);
344 WidgetTrySetText(root_widget,
"ItemTemperatureWidget", temperatureState.m_LocalizedName, temperatureState.m_Color);
350 if ( item.IsInherited(
ZombieBase ) || item.IsInherited( Car ) )
return;
356 wetness = item_IB.GetWet();
359 if (item.GetIsFrozen())
388 if ( item.IsInherited(
ZombieBase ) || item.IsInherited( Car ) )
return;
393 float item_quantity = item_base.GetQuantity();
394 int max_quantity = item.GetQuantityMax();
396 float quantity_ratio;
398 if( max_quantity > 0 && !item.IsInherited(
ClothingBase ))
401 if( item.ConfigGetString(
"stackedUnit") ==
"pc." )
403 if( item_quantity == 1 )
412 else if( item.ConfigGetString(
"stackedUnit") ==
"percentage" )
414 quantity_ratio =
Math.
Round( ( item_quantity / max_quantity ) * 100 );
416 quantity_str =
"#inv_inspect_remaining " + quantity_ratio.
ToString() +
"#inv_inspect_percent";
419 else if( item.ConfigGetString(
"stackedUnit") ==
"g" )
421 quantity_ratio =
Math.
Round( ( item_quantity / max_quantity ) * 100 );
423 quantity_str =
"#inv_inspect_remaining " + quantity_ratio.
ToString() +
"#inv_inspect_percent";
426 else if( item.ConfigGetString(
"stackedUnit") ==
"ml" )
428 quantity_ratio =
Math.
Round( ( item_quantity / max_quantity ) * 100 );
430 quantity_str =
"#inv_inspect_remaining " + quantity_ratio.
ToString() +
"#inv_inspect_percent";
433 else if( item.IsInherited( Magazine ) )
435 Magazine magazine_item;
438 if( magazine_item.GetAmmoCount() == 1 )
456 float heatIsolation = MiscGameplayFunctions.GetCurrentItemHeatIsolation( item_base );
489 if (!item.CanDisplayWeight())
498 int weight = item_IB.GetWeightEx();
500 if (root_widget.GetName() !=
"BackPanelWidget")
502 weight = item_IB.GetSingleInventoryItemWeightEx();
510 else if (weight >= 500)
514 else if (weight >= 250)
532 FoodStageType food_stage_type = food_stage.GetFoodStageType();
534 switch( food_stage_type )
579 if(ib && ib.m_Cleanness==1)
598 widget.SetText(text);
599 Widget widget_background = root_widget.FindAnyWidget(widget_name+
"Background");
600 if (widget_background)
604 widget_background.Show(
true );
605 widget_background.SetColor(color | 0x7F000000);
609 widget_background.Show(
false );
621 super.OnPlayerDeath();
625 MissionGameplay missionGameplay = MissionGameplay.Cast(
g_Game.GetMission());
626 if (missionGameplay && missionGameplay.GetInventory())
628 missionGameplay.HideInventory();
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
static string GetBloodTypeName(int bloodtype, out string type, out bool positive)
override DragQueue GetDragQueue()
proto native WorkspaceWidget GetWorkspace()
proto native Mission GetMission()
Super root of all classes in Enforce script.
const int COLOR_BADLY_DAMAGED
const int COLOR_SOAKING_WET
override FoodStage GetFoodStage()
void ShowHudUI(bool show)
void ShowQuickbarUI(bool show)
override bool IsBloodContainer()
void AddActiveInputExcludes(array< string > excludes)
void RemoveActiveInputExcludes(array< string > excludes, bool bForceSupress=false)
deprecated
proto string ToString(bool simple=true)
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const float HEATISO_THRESHOLD_HIGH
const float HEATISO_THRESHOLD_MEDIUM
const float HEATISO_THRESHOLD_BAD
const float HEATISO_THRESHOLD_LOW
const int STATE_BADLY_DAMAGED
const float STATE_SOAKING_WET
const float STATE_DRENCHED
const int LIQUID_FRESHWATER
const int LIQUID_DISINFECTANT
const int LIQUID_GASOLINE
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Round(float f)
Returns mathematical round of value.
proto void GetScreenSize(out int x, out int y)
proto void GetMousePos(out int x, out int y)