DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ScriptConsoleItemsTab
+ Граф наследования:ScriptConsoleItemsTab:

Защищенные члены

void ScriptConsoleItemsTab (Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
 
void ~ScriptConsoleItemsTab ()
 
void Init ()
 
override bool OnKeyDown (Widget w, int x, int y, int key)
 
void SelectObject (bool hide_presets=true)
 
void SelectPreset ()
 
int GetCurrentPresetIndex ()
 
int GetCurrentItemIndex ()
 
bool IsCurrentPresetFixed ()
 
bool IsPresetFixed (string preset_name)
 
int GetPresetIndexByName (string preset_name)
 
void ShowItemButtons ()
 
void HideItemButtons ()
 
void ShowItemTransferButtons ()
 
void ItemMoveUp ()
 
void ItemMoveDown ()
 
void SaveProfileSpawnDistance ()
 
void RenamePreset (string new_preset_name)
 
void SpawnPreset (EntityAI target, bool clear_inventory, string preset_name, InventoryLocationType location=InventoryLocationType.ATTACHMENT, float distance=0)
 
void SetDefaultPreset (int preset_index)
 
void SetObject (string object)
 
void SetPreviewObject (string object)
 
void AddItemToPreset ()
 
void ShowPresetButtons ()
 
void RemoveItemFromPreset ()
 
string GetCurrentPresetName ()
 
string GetCurrentItemName ()
 
string GetCurrentObjectName ()
 
void RefreshLists ()
 
void RenderPresets ()
 
void RenderPresetItems ()
 
void NewPreset (string preset_name)
 
void DeletePreset ()
 
int GetFilterColor (string color)
 
void PrepareFilters (string filter, out TStringArray filters, out TIntArray colors)
 
void ChangeFilter (TStringArray classes, TextListboxWidget widget, MultilineEditBoxWidget filterWidget, int categoryMask=-1, bool ignoreScope=false)
 
void SetFilterOrder (bool reversed)
 
override bool OnChange (Widget w, int x, int y, bool finished)
 
override bool OnItemSelected (Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
 
override bool OnClick (Widget w, int x, int y, int button)
 
override bool OnDoubleClick (Widget w, int x, int y, int button)
 
override void Update (float timeslice)
 
void SetTextSpawnButton (ButtonWidget w, bool special, string suffix=" Special")
 
void UpdateButtonNames ()
 
TStringArray GetItemsClasses ()
 
string PreprocessFilterText (MultilineEditBoxWidget w)
 
void ChangeFilterItems (bool forced=false)
 

Защищенные статические члены

static void DrawItems (string type, float distance=0)
 
static void DrawItemsClear ()
 
static string GetLastSelectedObject ()
 

Защищенные данные

const string CONST_DEFAULT_PRESET_PREFIX = "[Default]"
 
ref array< Widgetm_CategoryButtonsWidgets = new array<Widget>
 
ref array< stringm_CategoryButtonsNames = {"FIREARMS","MELEE","ATTACHMENTS","MAGAZINES","AMMO","FOOD","MEDICAL","CARS","BACKPACKS","B-BUILDING"}
 
ref map< Widget, stringm_SpawnButtonsOriginalText = new map<Widget, string>()
 
int m_CategoryMask
 
MissionGameplay m_MissionGameplay
 
ref Timer m_RefreshFilterTimer = new Timer()
 
PluginDeveloper m_Developer
 
bool m_FilterOrderReversed
 
string m_SelectedObject
 
string m_FilterTextPrev
 
CheckBoxWidget m_CategoryMergeType
 
CheckBoxWidget m_ItemPreviewCheckbox
 
CheckBoxWidget m_ShowProtected
 
CheckBoxWidget m_ClearInventory
 
TextListboxWidget m_ObjectsTextListbox
 
TextListboxWidget m_PresetsTextListbox
 
TextListboxWidget m_PresetItemsTextListbox
 
ButtonWidget m_DrawInWorld
 
ButtonWidget m_DrawInWorldClear
 
ButtonWidget m_PresetNewButton
 
ButtonWidget m_PresetDeleteButton
 
ButtonWidget m_PresetRenameButton
 
ButtonWidget m_PresetSetDefaultButton
 
ButtonWidget m_PresetAddItemtButton
 
ButtonWidget m_ItemNameCopy
 
ButtonWidget m_PresetRemoveItemButton
 
ButtonWidget m_ItemMoveUpButton
 
ButtonWidget m_ItemMoveDownButton
 
ButtonWidget m_FilterOrderButton
 
ButtonWidget m_SpawnInInvButton
 
ButtonWidget m_SpawnGroundButton
 
ButtonWidget m_SpawnGroundPatternGrid
 
ButtonWidget m_SpawnOnTarget
 
ButtonWidget m_SpawnOnCursor
 
ButtonWidget m_SpawnInHands
 
ButtonWidget m_SpawnBatchButton
 
ButtonWidget m_ListActions
 
MultilineEditBoxWidget m_ObjectFilter
 
EditBoxWidget m_SpawnDistanceEditBox
 
EditBoxWidget m_RectSpawnRow
 
EditBoxWidget m_RectSpawnColumn
 
EditBoxWidget m_RectSpawnRowStep
 
EditBoxWidget m_RectSpawnColumnStep
 
EditBoxWidget m_DrawDistanceWidget
 
EditBoxWidget m_QuantityEditBox
 
EditBoxWidget m_DamageEditBox
 
EditBoxWidget m_BatchSpawnQuantity
 
CheckBoxWidget m_WithPhysicsCheckbox
 
ButtonWidget m_ReloadShapeButton
 
TextWidget m_ItemDamageLabel
 
TextWidget m_ItemQuantityLabel
 
TextWidget m_SelectedObjectText
 
TextWidget m_SelectedObjectLocalized
 
ItemPreviewWidget m_ItemPreviewWidget
 
ImageWidget m_FilterOrderImage
 

Статические защищенные данные

static int ITEMS_SELECTED_ROW = -1
 
static int PRESETS_SELECTED_ROW = 0
 
static int ITEMS_IN_PRESET_SELECTED_ROW
 
static float DRAW_DISTANCE = 1000
 
static bool CLEAR_IVN
 
static int m_ObjectsScope = 2
 
static string m_LastSelectedObject
 
static int m_SelectedObjectIsPreset = -1
 
static ref array< Shapem_DebugShapes = new array<Shape>
 
static EntityAI m_PreviewEntity
 
static float m_ItemQuantity = 1
 
static bool m_WithPhysics = false
 

Закрытые члены

bool ListItemRelatedActions ()
 
- Закрытые члены унаследованные от ScriptConsoleTabBase
void ScriptConsoleTabBase (Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
 
void Init (int id)
 
int GetID ()
 
Widget GetRoot ()
 
bool IsSelected ()
 
void Select (bool select, ScriptConsoleTabBase selectedHandler)
 
void OnSelected ()
 
void Show (bool show, ScriptConsoleTabBase selectedHandler)
 
Widget GetButton ()
 
void Update (float timeslice)
 
bool OnChange (Widget w, int x, int y, bool finished)
 
bool OnClick (Widget w, int x, int y, int button)
 
bool OnItemSelected (Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
 
bool OnKeyDown (Widget w, int x, int y, int key)
 
bool OnDoubleClick (Widget w, int x, int y, int button)
 
void OnRPCEx (int rpc_type, ParamsReadContext ctx)
 
bool OnMouseButtonDown (Widget w, int x, int y, int button)
 
bool OnKeyPress (Widget w, int x, int y, int key)
 
void AddItemToClipboard (TextListboxWidget text_listbox_widget)
 

Дополнительные унаследованные члены

- Закрытые данные унаследованные от ScriptConsoleTabBase
int m_Id
 
bool m_IsSelected
 
bool m_IsShiftDown
 
Widget m_ParentRoot
 
Widget m_Root
 
Widget m_Button
 
ScriptConsole m_ScriptConsole
 
ScriptConsoleTabBase m_Parent
 
PluginConfigDebugProfile m_ConfigDebugProfile
 
PluginConfigDebugProfileFixed m_ConfigDebugProfileFixed
 

Подробное описание

Конструктор(ы)

◆ ScriptConsoleItemsTab()

void ScriptConsoleItemsTab ( Widget root,
ScriptConsole console,
Widget button,
ScriptConsoleTabBase parent = null )
inlineprotected
79 {
80 m_Developer = PluginDeveloper.Cast(GetPlugin(PluginDeveloper));
81
82 m_DrawInWorld = ButtonWidget.Cast(root.FindAnyWidget("ButtonDrawItem"));
83 m_DrawInWorldClear = ButtonWidget.Cast(root.FindAnyWidget("ButtonDrawItemClear"));
84
85 m_CategoryMergeType = CheckBoxWidget.Cast(root.FindAnyWidget("CategoryMergeType"));
86 m_ItemPreviewCheckbox = CheckBoxWidget.Cast(root.FindAnyWidget("ItemPreviewCheckbox"));
87 m_ReloadShapeButton = ButtonWidget.Cast(root.FindAnyWidget("ReloadShapeButton"));
88 m_ShowProtected = CheckBoxWidget.Cast(root.FindAnyWidget("ShowProtectedCheckbox"));
89 m_FilterOrderImage = ImageWidget.Cast(root.FindAnyWidget("ObjectFilterSortPic"));
90 m_ClearInventory = CheckBoxWidget.Cast(root.FindAnyWidget("ForceClearCheckbox"));
91 m_DrawDistanceWidget = EditBoxWidget.Cast(root.FindAnyWidget("DrawItemDistance"));
92 m_ObjectFilter = MultilineEditBoxWidget.Cast(root.FindAnyWidget("ObjectFilter"));
93 m_SpawnDistanceEditBox = EditBoxWidget.Cast(root.FindAnyWidget("SpawnDistance"));
94 m_SelectedObjectText = TextWidget.Cast(root.FindAnyWidget("SelectedObject"));
95 m_SelectedObjectLocalized = TextWidget.Cast(root.FindAnyWidget("SelectedObjectLocalized"));
96 m_ObjectsTextListbox = TextListboxWidget.Cast(root.FindAnyWidget("ObjectsList"));
97 m_PresetsTextListbox = TextListboxWidget.Cast(root.FindAnyWidget("PresetList"));
98 m_PresetItemsTextListbox = TextListboxWidget.Cast(root.FindAnyWidget("PresetItemsList"));
99 m_PresetNewButton = ButtonWidget.Cast(root.FindAnyWidget("NewPresetButton"));
100 m_PresetDeleteButton = ButtonWidget.Cast(root.FindAnyWidget("DeletePresetButton"));
101 m_PresetRenameButton = ButtonWidget.Cast(root.FindAnyWidget("RenamePresetButton"));
102 m_PresetSetDefaultButton = ButtonWidget.Cast(root.FindAnyWidget("SetDefaultPresetButton"));
103 m_PresetAddItemtButton = ButtonWidget.Cast(root.FindAnyWidget("AddToPresetButton"));
104 m_ItemNameCopy = ButtonWidget.Cast(root.FindAnyWidget("ItemNameCopy"));
105 m_PresetRemoveItemButton = ButtonWidget.Cast(root.FindAnyWidget("RemoveFromPresetButton"));
106 m_ItemMoveUpButton = ButtonWidget.Cast(root.FindAnyWidget("ItemMoveUpButton"));
107 m_ItemMoveDownButton = ButtonWidget.Cast(root.FindAnyWidget("ItemMoveDownButton"));
108 m_ItemPreviewWidget = ItemPreviewWidget.Cast(root.FindAnyWidget("ItemPreviewWidget"));
109
110 m_QuantityEditBox = EditBoxWidget.Cast(root.FindAnyWidget("QuantityValue"));
111 m_DamageEditBox = EditBoxWidget.Cast(root.FindAnyWidget("DamageValue"));
112 m_ItemDamageLabel = TextWidget.Cast(root.FindAnyWidget("DamageLabel"));
113 m_ItemQuantityLabel = TextWidget.Cast(root.FindAnyWidget("QuantityLabel"));
114 m_WithPhysicsCheckbox = CheckBoxWidget.Cast(root.FindAnyWidget("WithPhysicsCheckbox"));
115
116 m_SpawnInInvButton = ButtonWidget.Cast(root.FindAnyWidget("ButtonSpawnInInv"));
117 m_SpawnGroundButton = ButtonWidget.Cast(root.FindAnyWidget("ButtonSpawnInGround"));
118 m_SpawnOnTarget = ButtonWidget.Cast(root.FindAnyWidget("ButtonSpawnInTarget"));
119 m_SpawnOnCursor = ButtonWidget.Cast(root.FindAnyWidget("ButtonSpawnCursor"));
120 m_SpawnInHands = ButtonWidget.Cast(root.FindAnyWidget("ButtonSpawnHands"));
121 m_SpawnBatchButton = ButtonWidget.Cast(root.FindAnyWidget("ButtonSpawnBatch"));
122
123 string text;
124 m_SpawnInInvButton.GetText(text);
126 m_SpawnGroundButton.GetText(text);
128 m_SpawnOnTarget.GetText(text);
130 m_SpawnOnCursor.GetText(text);
132 m_SpawnInHands.GetText(text);
134 m_SpawnBatchButton.GetText(text);
136
137 m_ListActions = ButtonWidget.Cast(root.FindAnyWidget("ListActions"));
138
139
140 m_RectSpawnColumn = EditBoxWidget.Cast(root.FindAnyWidget("RectangleColumnValue"));
141 m_RectSpawnRow = EditBoxWidget.Cast(root.FindAnyWidget("RectangleRowValue"));
142 m_BatchSpawnQuantity = EditBoxWidget.Cast(root.FindAnyWidget("BatchCount"));
143
144 m_RectSpawnColumnStep = EditBoxWidget.Cast(root.FindAnyWidget("RectangleStepXValue"));
145 m_RectSpawnRowStep = EditBoxWidget.Cast(root.FindAnyWidget("RectangleStepYValue"));
146
147 m_FilterOrderButton = ButtonWidget.Cast(root.FindAnyWidget("ObjectFilterSortButton"));
148 Init();
149 }
PluginBase GetPlugin(typename plugin_type)
Definition PluginManager.c:316
Definition EnWidgets.c:354
Definition gameplay.c:276
Definition EntityAI.c:95
CheckBoxWidget m_ItemPreviewCheckbox
Definition ScriptConsoleItemsTab.c:32
CheckBoxWidget m_ShowProtected
Definition ScriptConsoleItemsTab.c:33
ButtonWidget m_ItemMoveDownButton
Definition ScriptConsoleItemsTab.c:48
CheckBoxWidget m_WithPhysicsCheckbox
Definition ScriptConsoleItemsTab.c:68
ButtonWidget m_ItemMoveUpButton
Definition ScriptConsoleItemsTab.c:47
PluginDeveloper m_Developer
Definition ScriptConsoleItemsTab.c:26
void Init()
Definition ScriptConsoleItemsTab.c:177
ButtonWidget m_PresetAddItemtButton
Definition ScriptConsoleItemsTab.c:44
CheckBoxWidget m_ClearInventory
Definition ScriptConsoleItemsTab.c:34
TextWidget m_SelectedObjectLocalized
Definition ScriptConsoleItemsTab.c:73
ref map< Widget, string > m_SpawnButtonsOriginalText
Definition ScriptConsoleItemsTab.c:22
EditBoxWidget m_RectSpawnColumnStep
Definition ScriptConsoleItemsTab.c:63
ImageWidget m_FilterOrderImage
Definition ScriptConsoleItemsTab.c:75
ButtonWidget m_FilterOrderButton
Definition ScriptConsoleItemsTab.c:49
TextWidget m_ItemDamageLabel
Definition ScriptConsoleItemsTab.c:70
EditBoxWidget m_BatchSpawnQuantity
Definition ScriptConsoleItemsTab.c:67
ButtonWidget m_SpawnOnTarget
Definition ScriptConsoleItemsTab.c:53
CheckBoxWidget m_CategoryMergeType
Definition ScriptConsoleItemsTab.c:31
ItemPreviewWidget m_ItemPreviewWidget
Definition ScriptConsoleItemsTab.c:74
EditBoxWidget m_RectSpawnRowStep
Definition ScriptConsoleItemsTab.c:62
EditBoxWidget m_RectSpawnColumn
Definition ScriptConsoleItemsTab.c:61
EditBoxWidget m_QuantityEditBox
Definition ScriptConsoleItemsTab.c:65
ButtonWidget m_DrawInWorld
Definition ScriptConsoleItemsTab.c:38
ButtonWidget m_SpawnInHands
Definition ScriptConsoleItemsTab.c:55
EditBoxWidget m_DamageEditBox
Definition ScriptConsoleItemsTab.c:66
TextWidget m_ItemQuantityLabel
Definition ScriptConsoleItemsTab.c:71
ButtonWidget m_ItemNameCopy
Definition ScriptConsoleItemsTab.c:45
TextListboxWidget m_PresetsTextListbox
Definition ScriptConsoleItemsTab.c:36
ButtonWidget m_ListActions
Definition ScriptConsoleItemsTab.c:57
TextListboxWidget m_ObjectsTextListbox
Definition ScriptConsoleItemsTab.c:35
ButtonWidget m_ReloadShapeButton
Definition ScriptConsoleItemsTab.c:69
ButtonWidget m_SpawnInInvButton
Definition ScriptConsoleItemsTab.c:50
TextListboxWidget m_PresetItemsTextListbox
Definition ScriptConsoleItemsTab.c:37
ButtonWidget m_PresetRemoveItemButton
Definition ScriptConsoleItemsTab.c:46
ButtonWidget m_PresetDeleteButton
Definition ScriptConsoleItemsTab.c:41
ButtonWidget m_SpawnOnCursor
Definition ScriptConsoleItemsTab.c:54
ButtonWidget m_PresetNewButton
Definition ScriptConsoleItemsTab.c:40
ButtonWidget m_PresetSetDefaultButton
Definition ScriptConsoleItemsTab.c:43
ButtonWidget m_DrawInWorldClear
Definition ScriptConsoleItemsTab.c:39
EditBoxWidget m_DrawDistanceWidget
Definition ScriptConsoleItemsTab.c:64
ButtonWidget m_PresetRenameButton
Definition ScriptConsoleItemsTab.c:42
EditBoxWidget m_SpawnDistanceEditBox
Definition ScriptConsoleItemsTab.c:59
EditBoxWidget m_RectSpawnRow
Definition ScriptConsoleItemsTab.c:60
MultilineEditBoxWidget m_ObjectFilter
Definition ScriptConsoleItemsTab.c:58
ButtonWidget m_SpawnBatchButton
Definition ScriptConsoleItemsTab.c:56
ButtonWidget m_SpawnGroundButton
Definition ScriptConsoleItemsTab.c:51
TextWidget m_SelectedObjectText
Definition ScriptConsoleItemsTab.c:72
Definition EnWidgets.c:220

Перекрестные ссылки GetPlugin(), Init(), m_BatchSpawnQuantity, m_CategoryMergeType, m_ClearInventory, m_DamageEditBox, m_Developer, m_DrawDistanceWidget, m_DrawInWorld, m_DrawInWorldClear, m_FilterOrderButton, m_FilterOrderImage, m_ItemDamageLabel, m_ItemMoveDownButton, m_ItemMoveUpButton, m_ItemNameCopy, m_ItemPreviewCheckbox, m_ItemPreviewWidget, m_ItemQuantityLabel, m_ListActions, m_ObjectFilter, m_ObjectsTextListbox, m_PresetAddItemtButton, m_PresetDeleteButton, m_PresetItemsTextListbox, m_PresetNewButton, m_PresetRemoveItemButton, m_PresetRenameButton, m_PresetSetDefaultButton, m_PresetsTextListbox, m_QuantityEditBox, m_RectSpawnColumn, m_RectSpawnColumnStep, m_RectSpawnRow, m_RectSpawnRowStep, m_ReloadShapeButton, m_SelectedObjectLocalized, m_SelectedObjectText, m_ShowProtected, m_SpawnBatchButton, m_SpawnButtonsOriginalText, m_SpawnDistanceEditBox, m_SpawnGroundButton, m_SpawnInHands, m_SpawnInInvButton, m_SpawnOnCursor, m_SpawnOnTarget и m_WithPhysicsCheckbox.

◆ ~ScriptConsoleItemsTab()

void ~ScriptConsoleItemsTab ( )
inlineprotected
152 {
153 ITEMS_SELECTED_ROW = m_ObjectsTextListbox.GetSelectedRow();
156
157 m_PresetsTextListbox.ClearItems();
158
159 if (m_PreviewEntity)
160 {
161 m_PreviewEntity.Delete();
162 }
163
165
167 {
168 m_ConfigDebugProfile.SetItemCategoryFlag(m_CategoryMask);
169 }
170
171 m_ItemQuantity = m_QuantityEditBox.GetText().ToFloat();
173 }
static int ITEMS_SELECTED_ROW
Definition ScriptConsoleItemsTab.c:6
static EntityAI m_PreviewEntity
Definition ScriptConsoleItemsTab.c:15
static int ITEMS_IN_PRESET_SELECTED_ROW
Definition ScriptConsoleItemsTab.c:8
static bool m_WithPhysics
Definition ScriptConsoleItemsTab.c:17
ref Timer m_RefreshFilterTimer
Definition ScriptConsoleItemsTab.c:25
static float m_ItemQuantity
Definition ScriptConsoleItemsTab.c:16
int m_CategoryMask
Definition ScriptConsoleItemsTab.c:23
static int PRESETS_SELECTED_ROW
Definition ScriptConsoleItemsTab.c:7
PluginConfigDebugProfile m_ConfigDebugProfile
Definition ScriptConsoleTabBase.c:11

Перекрестные ссылки ITEMS_IN_PRESET_SELECTED_ROW, ITEMS_SELECTED_ROW, m_CategoryMask, ScriptConsoleTabBase::m_ConfigDebugProfile, m_ItemQuantity, m_ObjectsTextListbox, m_PresetItemsTextListbox, m_PresetsTextListbox, m_PreviewEntity, m_QuantityEditBox, m_RefreshFilterTimer, m_WithPhysics, m_WithPhysicsCheckbox и PRESETS_SELECTED_ROW.

Методы

◆ AddItemToPreset()

void AddItemToPreset ( )
inlineprotected
711 {
712 int selected_row_index = m_ObjectsTextListbox.GetSelectedRow();
713 if (selected_row_index != -1 && GetCurrentPresetIndex() != -1)
714 {
715 string item_name;
719 }
720 }
string GetCurrentPresetName()
Definition ScriptConsoleItemsTab.c:756
void RenderPresetItems()
Definition ScriptConsoleItemsTab.c:838
int GetCurrentPresetIndex()
Definition ScriptConsoleItemsTab.c:392

Перекрестные ссылки GetCurrentPresetIndex(), GetCurrentPresetName(), ScriptConsoleTabBase::m_ConfigDebugProfile, m_ObjectsTextListbox и RenderPresetItems().

Используется в OnClick().

◆ ChangeFilter()

void ChangeFilter ( TStringArray classes,
TextListboxWidget widget,
MultilineEditBoxWidget filterWidget,
int categoryMask = -1,
bool ignoreScope = false )
inlineprotected
935 {
936 widget.ClearItems();
937
940
941 string widgetText;
942 filterWidget.GetText(widgetText);
944
947
949
950 for (int i = 0; i < classes.Count(); i++)
951 {
952 string config_path = classes.Get(i);
953
954 int objects_count = GetGame().ConfigGetChildrenCount(config_path);
955 for (int j = 0; j < objects_count; j++)
956 {
957 string child_name;
958
959 GetGame().ConfigGetChildName(config_path, j, child_name);
960
961 int scope = GetGame().ConfigGetInt(config_path + " " + child_name + " scope");
962
964 {
965 int category_bit = GetGame().ConfigGetInt(config_path + " " + child_name + " debug_ItemCategory") - 1;
966 category_bit = (1 << category_bit);
967
968 bool display = false;
969 int color = 0;
971 {
972 display = true;
973 }
974 else if ((!m_ConfigDebugProfile.GetMergeType() || categoryMask == 0) && filters.Count() > 0)
975 {
977 child_name_lower.ToLower();
978
979 foreach (int indx, string filter:filters)
980 {
981 if (child_name_lower.Contains(filter))
982 {
983 display = false;
984 color = filterColors.Get(indx);
986 if (!arr)
987 {
988 arr = new TStringArray();
990 }
991 arr.Insert(child_name);
993 break;
994 }
995 }
996 }
997 else if (categoryMask == 0)
998 {
999 display = true;
1000 }
1001
1002 if (display)
1003 {
1004 itemsArray.Insert(child_name);
1005
1006 }
1007 }
1008 }
1009 }
1010
1011 if (itemsArray)
1012 {
1013 itemsArray.Sort();
1014 foreach (string it:itemsArray)
1015 {
1016 widget.AddItem(it, NULL, 0);
1017 }
1018 }
1019
1020 if (filters)
1021 {
1023 filters.Invert();
1024
1025 foreach (string f:filters)
1026 {
1028 if (arr2)
1029 {
1030 arr2.Sort();
1031 foreach (string itm: arr2)
1032 {
1033 int row = widget.AddItem(itm, NULL, 0);
1034 int clr = itemsAndColors.Get(itm);
1035 if (clr)
1036 {
1037 widget.SetItemColor(row, 0, clr);
1038 }
1039 }
1040 }
1041 }
1042 }
1043
1044
1045 }
void PrepareFilters(string filter, out TStringArray filters, out TIntArray colors)
Definition ScriptConsoleItemsTab.c:900
bool m_FilterOrderReversed
Definition ScriptConsoleItemsTab.c:27
static int m_ObjectsScope
Definition ScriptConsoleItemsTab.c:11
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition IsBoxCollidingGeometryProxyClasses.c:28
proto native CGame GetGame()
array< string > TStringArray
Definition EnScript.c:685

Перекрестные ссылки GetGame(), ScriptConsoleTabBase::m_ConfigDebugProfile, m_FilterOrderReversed, m_ObjectsScope и PrepareFilters().

Используется в ChangeFilterItems().

◆ ChangeFilterItems()

void ChangeFilterItems ( bool forced = false)
inlineprotected
1566 {
1569 return;
1570
1572 string txt = m_ConfigDebugProfile.GetItemSearch();
1573
1574 m_ConfigDebugProfile.SetItemSearch(widgetText);
1576 }
string PreprocessFilterText(MultilineEditBoxWidget w)
Definition ScriptConsoleItemsTab.c:1552
void ChangeFilter(TStringArray classes, TextListboxWidget widget, MultilineEditBoxWidget filterWidget, int categoryMask=-1, bool ignoreScope=false)
Definition ScriptConsoleItemsTab.c:934
TStringArray GetItemsClasses()
Definition ScriptConsoleItemsTab.c:1547
string m_FilterTextPrev
Definition ScriptConsoleItemsTab.c:29

Перекрестные ссылки ChangeFilter(), GetItemsClasses(), m_CategoryMask, ScriptConsoleTabBase::m_ConfigDebugProfile, m_FilterTextPrev, m_ObjectFilter, m_ObjectsTextListbox и PreprocessFilterText().

Используется в Init(), OnChange(), OnClick() и SetFilterOrder().

◆ DeletePreset()

void DeletePreset ( )
inlineprotected
874 {
875 if (GetCurrentPresetIndex() != -1)
876 {
877 bool result = m_ConfigDebugProfile.PresetRemove(GetCurrentPresetName());
878 RefreshLists();
879 }
880 }
void RefreshLists()
Definition ScriptConsoleItemsTab.c:792

Перекрестные ссылки GetCurrentPresetIndex(), GetCurrentPresetName(), ScriptConsoleTabBase::m_ConfigDebugProfile и RefreshLists().

Используется в OnClick().

◆ DrawItems()

static void DrawItems ( string type,
float distance = 0 )
inlinestaticprotected

need better logic for cleaning

294 {
295 if (!distance)
296 {
298 }
301
302 GetGame().GetObjectsAtPosition(GetGame().GetPlayer().GetPosition(), distance, objects, proxies);
303 int i = 0;
304 foreach (Object o: objects)
305 {
306 if (o.IsKindOf(type))
307 {
308 i++;
309 ScriptConsole.m_MarkedEntities.Insert(new MapMarker(o.GetPosition(),"",COLOR_RED,eMapMarkerTypes.MARKERTYPE_MAP_BORDER_CROSS));
310 Shape shape = Shape.CreateSphere(COLOR_RED, ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE|ShapeFlags.NOZBUFFER, o.GetPosition() + "0 30 0", 1);
311 vector lines[2];
312 lines[0] = o.GetPosition();
313 lines[1] = o.GetPosition() + "0 30 0";
314 Shape line = Shape.CreateLines(COLOR_RED, ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE|ShapeFlags.NOZBUFFER, lines, 2);
315 m_DebugShapes.Insert(shape);
316 m_DebugShapes.Insert(line);
317 }
318 }
319
321 //GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLaterByName(this, "DrawItemsClear", 5000);
322 Debug.Log(string.Format("found %1 instances of type %1", i, type));
323 }
PlayerBase GetPlayer()
Definition ModifierBase.c:51
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:136
Definition InventoryItem.c:1163
Definition ObjectTyped.c:2
static float DRAW_DISTANCE
Definition ScriptConsoleItemsTab.c:9
static ref array< Shape > m_DebugShapes
Definition ScriptConsoleItemsTab.c:14
Definition EnConvert.c:106
const int COLOR_RED
Definition constants.c:64
ShapeFlags
Definition EnDebug.c:126
class DiagMenu Shape
don't call destructor directly. Use Destroy() instead

Перекрестные ссылки COLOR_RED, DRAW_DISTANCE, GetGame(), GetPlayer(), GetPosition, Debug::Log(), m_DebugShapes и Shape.

Используется в OnClick() и OnKeyDown().

◆ DrawItemsClear()

static void DrawItemsClear ( )
inlinestaticprotected
327 {
328 ScriptConsole.m_MarkedEntities.Clear();
329 foreach (Shape s: m_DebugShapes)
330 {
331 s.Destroy();
332 }
333 m_DebugShapes.Clear();
334 }

Перекрестные ссылки m_DebugShapes и Shape.

Используется в OnClick().

◆ GetCurrentItemIndex()

int GetCurrentItemIndex ( )
inlineprotected
398 {
399 return m_PresetItemsTextListbox.GetSelectedRow();
400 }

Перекрестные ссылки m_PresetItemsTextListbox.

Используется в GetCurrentItemName(), ItemMoveDown(), ItemMoveUp(), OnChange(), RemoveItemFromPreset(), ShowItemButtons() и ShowItemTransferButtons().

◆ GetCurrentItemName()

string GetCurrentItemName ( )
inlineprotected
770 {
771 if (GetCurrentItemIndex() != -1)
772 {
773 string item_name;
775 return item_name;
776 }
777 return "";
778 }
int GetCurrentItemIndex()
Definition ScriptConsoleItemsTab.c:397

Перекрестные ссылки GetCurrentItemIndex() и m_PresetItemsTextListbox.

Используется в Init(), OnClick() и OnItemSelected().

◆ GetCurrentObjectName()

string GetCurrentObjectName ( )
inlineprotected
781 {
782 int selected_row_index = m_ObjectsTextListbox.GetSelectedRow();
783 if (selected_row_index != -1)
784 {
785 string item_name;
787 return item_name;
788 }
789 return "";
790 }

Перекрестные ссылки m_ObjectsTextListbox.

Используется в Init(), OnDoubleClick() и SelectObject().

◆ GetCurrentPresetIndex()

int GetCurrentPresetIndex ( )
inlineprotected

◆ GetCurrentPresetName()

string GetCurrentPresetName ( )
inlineprotected
757 {
759 // load preset items list
760 if (index > -1 && index < m_PresetsTextListbox.GetNumItems())
761 {
764 return item_params_array.param1;
765 }
766 return "";
767 }

Перекрестные ссылки GetCurrentPresetIndex() и m_PresetsTextListbox.

Используется в AddItemToPreset(), DeletePreset(), ItemMoveDown(), ItemMoveUp(), OnChange(), OnClick(), RemoveItemFromPreset(), RenamePreset(), RenderPresetItems(), SelectPreset(), SetDefaultPreset() и ShowItemButtons().

◆ GetFilterColor()

int GetFilterColor ( string color)
inlineprotected
883 {
884 switch (color)
885 {
886 case "r":
887 return ARGB(255,255,0,0);
888 case "g":
889 return ARGB(255,0,255,0);
890 case "b":
891 return ARGB(255,130,130,255);
892 case "y":
893 return ARGB(255,255,255,0);
894 case "o":
895 return ARGB(255,255,169,0);
896 }
897 return -1;//white
898 }
int ARGB(int a, int r, int g, int b)
Definition proto.c:322

Перекрестные ссылки ARGB().

Используется в PrepareFilters().

◆ GetItemsClasses()

TStringArray GetItemsClasses ( )
inlineprotected
1548 {
1550 }
const string CFG_AMMO
Definition constants.c:220
const string CFG_VEHICLESPATH
Definition constants.c:217
const string CFG_WEAPONSPATH
Definition constants.c:218
const string CFG_MAGAZINESPATH
Definition constants.c:219

Перекрестные ссылки CFG_AMMO, CFG_MAGAZINESPATH, CFG_VEHICLESPATH и CFG_WEAPONSPATH.

Используется в ChangeFilterItems().

◆ GetLastSelectedObject()

static string GetLastSelectedObject ( )
inlinestaticprotected
338 {
340 }
static string m_LastSelectedObject
Definition ScriptConsoleItemsTab.c:12

Перекрестные ссылки m_LastSelectedObject.

Используется в Dispatcher::CallMethod().

◆ GetPresetIndexByName()

int GetPresetIndexByName ( string preset_name)
inlineprotected
427 {
428 int i;
429 for (i = 0; i < m_PresetsTextListbox.GetNumItems(); i++)
430 {
433
434 if (item_params_array.param1 == preset_name)
435 {
436 return i;
437 }
438 }
439 return -1;
440 }

Перекрестные ссылки m_PresetsTextListbox.

Используется в IsPresetFixed(), RenderPresets() и SetDefaultPreset().

◆ HideItemButtons()

void HideItemButtons ( )
inlineprotected
487 {
488 m_ItemMoveUpButton.Show(false);
489 m_ItemMoveDownButton.Show(false);
490 }

Перекрестные ссылки m_ItemMoveDownButton и m_ItemMoveUpButton.

Используется в Init(), OnDoubleClick(), SelectObject() и ShowPresetButtons().

◆ Init()

void Init ( )
inlineprotected
178 {
179 m_RefreshFilterTimer.Run(0.85, this, "ChangeFilterItems", null, true);
180 m_PresetDeleteButton.Show(false);
181 m_PresetRenameButton.Show(false);
182 m_DrawDistanceWidget.SetText(DRAW_DISTANCE.ToString());
183
184 m_QuantityEditBox.SetText(m_ItemQuantity.ToString());
186
188 {
189 string txt = (m_ConfigDebugProfile.GetItemSearch());
190 m_ObjectFilter.SetText(m_ConfigDebugProfile.GetItemSearch());
191 m_SpawnDistanceEditBox.SetText(m_ConfigDebugProfile.GetSpawnDistance().ToString());
192
193
194 SetFilterOrder(m_ConfigDebugProfile.GetFilterOrderReversed());
195 //m_ConfigDebugProfile.SetItemCategoryFlag(m_CategoryMask);
196
197 m_BatchSpawnQuantity.SetText(m_ConfigDebugProfile.GetBatchSpawnQuantity().ToString());
198
199 m_CategoryMask = m_ConfigDebugProfile.GetItemCategoryFlag();
201 {
202 m_ItemPreviewCheckbox.SetChecked(m_ConfigDebugProfile.GetShowItemPreview());
203 }
204
205 array<ref CfgParam> params = m_ConfigDebugProfile.GetBatchSpawnRectangle();
206
207 m_RectSpawnRow.SetText(CfgParamInt.Cast(params.Get(0)).GetValue().ToString());
208 m_RectSpawnColumn.SetText(CfgParamInt.Cast(params.Get(1)).GetValue().ToString());
209 m_RectSpawnRowStep.SetText(CfgParamFloat.Cast(params.Get(2)).GetValue().ToString());
210 m_RectSpawnColumnStep.SetText(CfgParamFloat.Cast(params.Get(3)).GetValue().ToString());
211 }
212
213
214 if (m_ObjectsScope == 1)
215 m_ShowProtected.SetChecked(true);
216 else
217 m_ShowProtected.SetChecked(false);
218
219 int counter = 0;
220 foreach (string name: m_CategoryButtonsNames)
221 {
222 string widget_name = "ItemCategory" + counter;
223
225 if (btw)
226 {
227 btw.SetText(name);
229 int bit = 1 << counter;
230 if (bit & m_CategoryMask)
231 {
232 btw.SetChecked(true);
233 btw.SetTextColor(ARGB(255, 255, 0, 0));
234 }
235 }
236 counter++;
237 }
238
240 {
243
244 m_SelectedObjectText.SetText("Object : " + GetCurrentItemName());
247 }
248
249 ChangeFilterItems(true);
250
252 //RenderPresetItems();
253
254 m_MissionGameplay = MissionGameplay.Cast(GetGame().GetMission());
255
256 if (!m_SelectedObjectIsPreset == 1 && ITEMS_SELECTED_ROW < m_ObjectsTextListbox.GetNumItems() && m_ObjectsTextListbox.GetNumItems() > 0 && ITEMS_SELECTED_ROW > -1)
257 {
260
261
263
264
267 m_PresetItemsTextListbox.SelectRow(-1);
269 }
270
271 if (m_PresetsTextListbox.GetNumItems() >= 0)
272 {
276 SelectPreset();
277 else
279 }
280
281 if (m_ObjectsScope == 1)
282 m_ShowProtected.SetChecked(true);
283 else
284 m_ShowProtected.SetChecked(false);
285
286
287 m_CategoryMergeType.SetChecked(m_ConfigDebugProfile.GetMergeType());
288
291 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
MissionGameplay m_MissionGameplay
Definition ScriptConsoleItemsTab.c:24
ref array< string > m_CategoryButtonsNames
Definition ScriptConsoleItemsTab.c:21
void ChangeFilterItems(bool forced=false)
Definition ScriptConsoleItemsTab.c:1565
string GetCurrentItemName()
Definition ScriptConsoleItemsTab.c:769
ref array< Widget > m_CategoryButtonsWidgets
Definition ScriptConsoleItemsTab.c:20
string GetCurrentObjectName()
Definition ScriptConsoleItemsTab.c:780
void SetObject(string object)
Definition ScriptConsoleItemsTab.c:670
static int m_SelectedObjectIsPreset
Definition ScriptConsoleItemsTab.c:13
void SelectPreset()
Definition ScriptConsoleItemsTab.c:367
void HideItemButtons()
Definition ScriptConsoleItemsTab.c:486
void RenderPresets()
Definition ScriptConsoleItemsTab.c:799
void ShowItemTransferButtons()
Definition ScriptConsoleItemsTab.c:492
string m_SelectedObject
Definition ScriptConsoleItemsTab.c:28
void SetFilterOrder(bool reversed)
Definition ScriptConsoleItemsTab.c:1048
Widget m_ParentRoot
Definition ScriptConsoleTabBase.c:6

Перекрестные ссылки ARGB(), ChangeFilterItems(), DRAW_DISTANCE, GetCurrentItemName(), GetCurrentObjectName(), GetGame(), HideItemButtons(), ITEMS_IN_PRESET_SELECTED_ROW, ITEMS_SELECTED_ROW, m_BatchSpawnQuantity, m_CategoryButtonsNames, m_CategoryButtonsWidgets, m_CategoryMask, m_CategoryMergeType, ScriptConsoleTabBase::m_ConfigDebugProfile, m_DrawDistanceWidget, m_ItemPreviewCheckbox, m_ItemQuantity, m_LastSelectedObject, m_MissionGameplay, m_ObjectFilter, m_ObjectsScope, m_ObjectsTextListbox, ScriptConsoleTabBase::m_ParentRoot, m_PresetDeleteButton, m_PresetItemsTextListbox, m_PresetRenameButton, m_PresetsTextListbox, m_QuantityEditBox, m_RectSpawnColumn, m_RectSpawnColumnStep, m_RectSpawnRow, m_RectSpawnRowStep, m_RefreshFilterTimer, m_SelectedObject, m_SelectedObjectIsPreset, m_SelectedObjectText, m_ShowProtected, m_SpawnDistanceEditBox, m_WithPhysics, m_WithPhysicsCheckbox, name, PRESETS_SELECTED_ROW, RenderPresetItems(), RenderPresets(), SelectPreset(), SetFilterOrder(), SetObject() и ShowItemTransferButtons().

Используется в ScriptConsoleItemsTab().

◆ IsCurrentPresetFixed()

bool IsCurrentPresetFixed ( )
inlineprotected
403 {
405 if (index > -1 && index < m_PresetsTextListbox.GetNumItems())
406 {
409 return item_params_array.param2;
410 }
411 return false;
412 }

Перекрестные ссылки GetCurrentPresetIndex() и m_PresetsTextListbox.

Используется в RenderPresetItems(), ShowItemButtons(), ShowItemTransferButtons(), ShowPresetButtons() и SpawnPreset().

◆ IsPresetFixed()

bool IsPresetFixed ( string preset_name)
inlineprotected
415 {
418 if (preset_index > -1 && preset_index < m_PresetsTextListbox.GetNumItems())
419 {
421 return item_params_array.param2;
422 }
423 return false;
424 }
int GetPresetIndexByName(string preset_name)
Definition ScriptConsoleItemsTab.c:426

Перекрестные ссылки GetPresetIndexByName() и m_PresetsTextListbox.

Используется в RenderPresets(), SelectPreset() и SetDefaultPreset().

◆ ItemMoveDown()

void ItemMoveDown ( )
inlineprotected

◆ ItemMoveUp()

void ItemMoveUp ( )
inlineprotected

◆ ListItemRelatedActions()

bool ListItemRelatedActions ( )
inlineprivate
1579 {
1580 string message = "";
1581
1584 if (interactActions)
1585 {
1586 message += "\n== Interact (F)\n\n";
1588 {
1589 if (iaction.Type() == ActionWorldCraft)
1590 continue;
1591
1593 message += string.Format("%1 <%2>\n", Widget.TranslateString(ia.GetText()), ia.ClassName());
1594 }
1595 }
1596
1600 {
1601 message += "\n== Continuous Interact (F hold)\n\n";
1603 {
1604 if (ciaction.Type() == ActionWorldCraft)
1605 continue;
1606
1608 message += string.Format("%1 <%2>\n", Widget.TranslateString(cia.GetText()), cia.ClassName());
1609 }
1610 }
1611
1614 if (singleActions)
1615 {
1616 message += "\n== Single (LMB)\n\n";
1618 {
1619 if (saction.Type() == ActionWorldCraft)
1620 continue;
1621
1623 message += string.Format("%1 <%2>\n", Widget.TranslateString(sa.GetText()), sa.ClassName());
1624 }
1625 }
1626
1628 m_PreviewEntity.GetActions(ContinuousDefaultActionInput, continuousActions);
1630 {
1632 message += "\n== Continuous (LMB hold)\n\n";
1634 {
1635 if (caction.Type() != ActionWorldCraft)
1636 {
1638 message += string.Format("%1 <%2>\n", Widget.TranslateString(ca.GetText()), ca.ClassName());
1639 }
1640 else
1641 {
1643 }
1644 }
1645 message += "\n== Crafting recipes \n\n";
1646 if (craftingAction)
1647 {
1648 PluginRecipesManager pluginRecipesManager = PluginRecipesManager.Cast(GetPlugin(PluginRecipesManager));
1649 array<RecipeBase> recipes = pluginRecipesManager.GetRecipesForItem(m_PreviewEntity.GetType());
1650 foreach (RecipeBase recipe : recipes)
1651 {
1652 if (recipe.IsItemInRecipe("Inventory_Base"))
1653 continue;
1654
1655 message += string.Format("%1 <%2>\n", Widget.TranslateString(recipe.GetName()), recipe.Type());
1656 }
1657 }
1658 }
1659
1660 ScriptConsoleUniversalInfoDialog infoDialog = ScriptConsoleUniversalInfoDialog.Cast(g_Game.GetUIManager().EnterScriptedMenu(MENU_SCRIPTCONSOLE_UNIVERSAL_INFO_DIALOG, m_ScriptConsole));
1661 infoDialog.SetLabel(string.Format("%1 related actions", m_PreviewEntity.GetType()));
1662 infoDialog.SetContent(message);
1663
1664 return true;
1665 }
DayZGame g_Game
Definition DayZGame.c:3815
Definition ActionBase_Basic.c:2
Definition ActionBase.c:53
Definition ActionWorldCraft.c:33
Definition ActionInput.c:522
Definition ActionInput.c:631
Definition ActionInput.c:535
Definition RecipeBase.c:5
ScriptConsole m_ScriptConsole
Definition ScriptConsoleTabBase.c:9
Definition EnWidgets.c:190
const int MENU_SCRIPTCONSOLE_UNIVERSAL_INFO_DIALOG
Definition constants.c:211

Перекрестные ссылки g_Game, GetPlugin(), m_PreviewEntity, ScriptConsoleTabBase::m_ScriptConsole и MENU_SCRIPTCONSOLE_UNIVERSAL_INFO_DIALOG.

Используется в OnClick().

◆ NewPreset()

void NewPreset ( string preset_name)
inlineprotected
868 {
870 RefreshLists();
871 }

Перекрестные ссылки ScriptConsoleTabBase::m_ConfigDebugProfile и RefreshLists().

◆ OnChange()

override bool OnChange ( Widget w,
int x,
int y,
bool finished )
inlineprotected
1063 {
1064 super.OnChange(w, x, y, finished);
1065 if (w == m_ShowProtected)
1066 {
1067 if (m_ShowProtected.IsChecked())
1068 {
1069 m_ObjectsScope = 1;
1070 }
1071 else
1072 {
1073 m_ObjectsScope = 2;
1074 }
1075 ChangeFilterItems(true);
1076 return true;
1077 }
1078 else if (w == m_ClearInventory)
1079 {
1080 CLEAR_IVN = m_ClearInventory.IsChecked();
1081 return true;
1082 }
1083 else if (m_CategoryButtonsWidgets.Find(w) >= 0)
1084 {
1085
1086 int pos = m_CategoryButtonsWidgets.Find(w);
1087 int bit = Math.Pow(2,pos);
1089 if (cbw.IsChecked())
1090 {
1092 cbw.SetTextColor(ARGB(255, 255, 0, 0));
1093 }
1094 else
1095 {
1097 cbw.SetTextColor(ARGB(255, 255, 255,255));
1098 }
1099
1100 ChangeFilterItems(true);
1101 return true;
1102 }
1103
1104 /*
1105 if (w == m_ObjectFilter)
1106 {
1107 m_RefreshFilterTimer.Run(0.85, this, "ChangeFilterItems", null, false);
1108 return true;
1109 }*/
1110 if (w == m_QuantityEditBox && (GetCurrentItemIndex() >= 0 || GetCurrentPresetName() != ""))
1111 {
1112 m_ConfigDebugProfile.SetItemQuantity(GetCurrentPresetName(), GetCurrentItemIndex(), m_QuantityEditBox.GetText().ToFloat());
1113 return true;
1114 }
1115 else if (w == m_DrawDistanceWidget)
1116 {
1117 DRAW_DISTANCE = m_DrawDistanceWidget.GetText().ToFloat();
1118 return true;
1119 }
1120 else if (w == m_DamageEditBox && (GetCurrentItemIndex() >= 0 || GetCurrentPresetName() != ""))
1121 {
1122 m_ConfigDebugProfile.SetItemHealth(GetCurrentPresetName(), GetCurrentItemIndex(), m_DamageEditBox.GetText().ToFloat());
1123 return true;
1124 }
1125 else if (w == m_WithPhysicsCheckbox && (GetCurrentItemIndex() >= 0 || GetCurrentPresetName() != ""))
1126 {
1128 return true;
1129 }
1130 else if (w == m_BatchSpawnQuantity)
1131 {
1132 m_ConfigDebugProfile.SetBatchSpawnQuantity(m_BatchSpawnQuantity.GetText().ToInt());
1133 return true;
1134 }
1136 {
1137 if (w == m_RectSpawnRow || w == m_RectSpawnColumn)
1138 {
1139 int rowQ = m_RectSpawnRow.GetText().ToInt();
1140 int columnQ = m_RectSpawnColumn.GetText().ToInt();
1141 int result = columnQ * rowQ;
1142 m_BatchSpawnQuantity.SetText(result.ToString());
1143 m_ConfigDebugProfile.SetBatchSpawnQuantity(m_BatchSpawnQuantity.GetText().ToInt());
1144 }
1145
1147 {
1148 m_ConfigDebugProfile.SetBatchSpawnRectangle(m_RectSpawnRow.GetText().ToInt(),m_RectSpawnColumn.GetText().ToInt(), m_RectSpawnRowStep.GetText().ToFloat(),m_RectSpawnColumnStep.GetText().ToFloat());
1149 }
1150 return true;
1151 }
1152 return false;
1153 }
Icon x
Icon y
Definition EnMath.c:7
static bool CLEAR_IVN
Definition ScriptConsoleItemsTab.c:10
static proto float Pow(float v, float power)
Return power of v ^ power.

Перекрестные ссылки ARGB(), ChangeFilterItems(), CLEAR_IVN, DRAW_DISTANCE, GetCurrentItemIndex(), GetCurrentPresetName(), m_BatchSpawnQuantity, m_CategoryButtonsWidgets, m_CategoryMask, m_ClearInventory, ScriptConsoleTabBase::m_ConfigDebugProfile, m_DamageEditBox, m_DrawDistanceWidget, m_ObjectsScope, m_QuantityEditBox, m_RectSpawnColumn, m_RectSpawnColumnStep, m_RectSpawnRow, m_RectSpawnRowStep, m_ShowProtected, m_WithPhysicsCheckbox, Math::Pow(), x и y.

◆ OnClick()

override bool OnClick ( Widget w,
int x,
int y,
int button )
inlineprotected
1188 {
1189 super.OnClick(w,x,y,button);
1192 if (w == m_CategoryMergeType)
1193 {
1195 {
1196 m_ConfigDebugProfile.SetMergeType(m_CategoryMergeType.IsChecked());
1197 }
1198 ChangeFilterItems(true);
1199 // Refresh UI by new settings
1200 m_MissionGameplay.GetHudDebug().RefreshByLocalProfile();
1201 return true;
1202 }
1203 else if (w == m_ObjectFilter)
1204 {
1205 ChangeFilterItems(true);
1206 return true;
1207 }
1208 else if (w == m_ItemPreviewCheckbox)
1209 {
1211 {
1212 m_ConfigDebugProfile.SetShowItemPreview(m_ItemPreviewCheckbox.IsChecked());
1213 if (!m_ItemPreviewCheckbox.IsChecked())
1214 {
1216 }
1217 }
1218 }
1220 {
1222
1223 objects_row_index = m_ObjectsTextListbox.GetSelectedRow();
1224
1225 vector rayStart = GetGame().GetCurrentCameraPosition();
1226 vector rayEnd = rayStart + GetGame().GetCurrentCameraDirection() * 50;
1227 vector hitPos;
1229 int hitComponentIndex;
1231 //DayZPhysics.RaycastRV(rayStart, rayEnd, hitPos, hitNormal, hitComponentIndex, hitObjects, NULL, player,);
1233
1235 if (hitObjects.Count())
1236 target = EntityAI.Cast(hitObjects.Get(0));
1237
1238 if (m_SelectedObject != "")
1239 {
1240 // @NOTE: duplicate code in PluginDeveloper.c
1241 float distance = m_SpawnDistanceEditBox.GetText().ToFloat();
1242
1243
1244 if (m_SelectedObjectIsPreset == 1)
1245 {
1246 //------------ PRESETS -------------
1247 switch (w)
1248 {
1249 case m_SpawnOnTarget:
1250 {
1251 if (target && target.IsInherited(EntityAI))
1252 {
1255 }
1256 break;
1257 }
1259 {
1261 break;
1262 }
1263 default:
1264 {
1266 break;
1267 }
1268 }
1269 }
1270 else
1271 {
1272 //------------SINGLE ITEMS ------------
1273
1274
1275 float health = m_DamageEditBox.GetText().ToFloat() * MiscGameplayFunctions.GetTypeMaxGlobalHealth(m_SelectedObject);
1276 float quantity = m_QuantityEditBox.GetText().ToFloat();
1277 bool withPhysics = m_WithPhysicsCheckbox.IsChecked();
1278
1280
1281
1282 switch (w)
1283 {
1285 {
1287 break;
1288 }
1289
1290 case m_SpawnOnTarget:
1291 {
1292 if (target && target.IsInherited(EntityAI))
1293 m_Developer.SpawnEntityInInventory(target, m_SelectedObject, health, quantity, m_IsShiftDown);
1294 break;
1295 }
1296
1297 case m_SpawnInInvButton:
1298 {
1299 m_Developer.SpawnEntityInPlayerInventory(player, m_SelectedObject, -1, quantity, m_IsShiftDown);
1300 break;
1301 }
1302 case m_SpawnInHands:
1303 {
1304 m_Developer.SpawnEntityInPlayerInventory(player, m_SelectedObject, -1, quantity, m_IsShiftDown,"", FindInventoryLocationType.HANDS);
1305 break;
1306 }
1307 case m_SpawnOnCursor:
1309 {
1310 if (spawnOnCrossHair)
1311 {
1312 m_Developer.SpawnItemOnCrosshair(player, m_SelectedObject, health, quantity, 40, true, m_IsShiftDown, withPhysics );
1313 }
1314 else
1315 {
1317 }
1318 break;
1319 }
1320 }
1321 }
1322 }
1323 return true;
1324 }
1325 else if (w == m_FilterOrderButton)
1326 {
1328 return true;
1329 }
1330 else if (w == m_PresetsTextListbox)
1331 {
1332 SelectPreset();
1333 return true;
1334 }
1335 else if (w == m_PresetItemsTextListbox)
1336 {
1337 m_ObjectsTextListbox.SelectRow(-1);
1340 m_SelectedObjectText.SetText("Object : " + GetCurrentItemName());
1343
1344 return true;
1345 }
1346 else if (w == m_PresetSetDefaultButton)
1347 {
1348 if (GetCurrentPresetName()!= "")
1349 {
1351 }
1352 return true;
1353 }
1354 else if (w == m_PresetNewButton)
1355 {
1356 g_Game.GetUIManager().EnterScriptedMenu(MENU_SCRIPTCONSOLE_DIALOG_PRESET_NAME, m_ScriptConsole);
1357 return true;
1358 }
1359 else if (w == m_PresetDeleteButton)
1360 {
1361 if (GetCurrentPresetName()!= "")
1362 {
1363 DeletePreset();
1364 }
1365 return true;
1366 }
1367 else if (w == m_PresetRenameButton)
1368 {
1369 if (GetCurrentPresetName()!= "")
1370 {
1371 g_Game.GetUIManager().EnterScriptedMenu(MENU_SCRIPTCONSOLE_DIALOG_PRESET_RENAME, m_ScriptConsole);
1372 }
1373 return true;
1374 }
1375 else if (w == m_PresetAddItemtButton)
1376 {
1378 return true;
1379 }
1380 else if (w == m_ItemNameCopy)
1381 {
1383 return true;
1384 }
1385 else if (w == m_PresetRemoveItemButton)
1386 {
1388 return true;
1389 }
1390 else if (w == m_ItemMoveUpButton)
1391 {
1392 ItemMoveUp();
1393 return true;
1394 }
1395 else if (w == m_ItemMoveDownButton)
1396 {
1397 ItemMoveDown();
1398 return true;
1399 }
1400 else if (w == m_SpawnBatchButton)
1401 {
1402 int count = m_BatchSpawnQuantity.GetText().ToInt();
1403 int rows = m_RectSpawnRow.GetText().ToInt();
1404 int columns = m_RectSpawnColumn.GetText().ToInt();
1405 float rowStep = m_RectSpawnRowStep.GetText().ToFloat();
1406 float columnStep = m_RectSpawnColumnStep.GetText().ToFloat();
1407 m_Developer.SpawnEntityOnGroundPatternGrid(player, m_SelectedObject,count, m_DamageEditBox.GetText().ToFloat(), 1, rows, columns, rowStep, columnStep, m_IsShiftDown, m_WithPhysicsCheckbox.IsChecked());
1408 return true;
1409 }
1410 else if (w == m_ReloadShapeButton)
1411 {
1412#ifdef DEVELOPER
1414 if (obj)
1415 {
1416 GetGame().ReloadShape(obj);
1417 }
1418#endif
1419 }
1420 else if (w == m_ListActions)
1421 {
1422 if (!m_PreviewEntity)
1423 return false;
1424
1425 return ListItemRelatedActions();
1426 }
1427 else if (w == m_ObjectsTextListbox)
1428 {
1429 SelectObject();
1430 return true;
1431 }
1432 else if (w == m_DrawInWorld)
1433 {
1435 return true;
1436
1437 }
1438 else if (w == m_DrawInWorldClear)
1439 {
1441 return true;
1442 }
1443
1444 return false;
1445 }
FindInventoryLocationType
flags for searching locations in inventory
Definition InventoryLocation.c:17
InventoryLocationType
types of Inventory Location
Definition InventoryLocation.c:4
Definition DayZPhysics.c:124
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
Definition DeveloperFreeCamera.c:2
static bool IsFreeCameraEnabled()
Definition DeveloperFreeCamera.c:23
Definition Building.c:6
proto native void SetItem(EntityAI object)
proto native EntityAI GetItem()
Definition PlayerBaseClient.c:2
void RemoveItemFromPreset()
Definition ScriptConsoleItemsTab.c:747
void SpawnPreset(EntityAI target, bool clear_inventory, string preset_name, InventoryLocationType location=InventoryLocationType.ATTACHMENT, float distance=0)
Definition ScriptConsoleItemsTab.c:565
static void DrawItems(string type, float distance=0)
Definition ScriptConsoleItemsTab.c:293
void ItemMoveDown()
Definition ScriptConsoleItemsTab.c:535
void SelectObject(bool hide_presets=true)
Definition ScriptConsoleItemsTab.c:353
ButtonWidget m_SpawnGroundPatternGrid
Definition ScriptConsoleItemsTab.c:52
void ItemMoveUp()
Definition ScriptConsoleItemsTab.c:524
void AddItemToPreset()
Definition ScriptConsoleItemsTab.c:710
static void DrawItemsClear()
Definition ScriptConsoleItemsTab.c:326
void ShowItemButtons()
Definition ScriptConsoleItemsTab.c:442
bool ListItemRelatedActions()
Definition ScriptConsoleItemsTab.c:1578
void SetDefaultPreset(int preset_index)
Definition ScriptConsoleItemsTab.c:629
void SaveProfileSpawnDistance()
Definition ScriptConsoleItemsTab.c:547
void DeletePreset()
Definition ScriptConsoleItemsTab.c:873
void AddItemToClipboard(TextListboxWidget text_listbox_widget)
Definition ScriptConsoleTabBase.c:88
bool m_IsShiftDown
Definition ScriptConsoleTabBase.c:5
const int MENU_SCRIPTCONSOLE_DIALOG_PRESET_NAME
Definition constants.c:185
const int MENU_SCRIPTCONSOLE_DIALOG_PRESET_RENAME
Definition constants.c:186

Перекрестные ссылки ScriptConsoleTabBase::AddItemToClipboard(), AddItemToPreset(), ChangeFilterItems(), CLEAR_IVN, DeletePreset(), DrawItems(), DrawItemsClear(), g_Game, GetCurrentItemName(), GetCurrentPresetIndex(), GetCurrentPresetName(), GetGame(), ItemPreviewWidget::GetItem(), GetPlayer(), DeveloperFreeCamera::IsFreeCameraEnabled(), ItemMoveDown(), ItemMoveUp(), ListItemRelatedActions(), m_BatchSpawnQuantity, m_CategoryMergeType, ScriptConsoleTabBase::m_ConfigDebugProfile, m_DamageEditBox, m_Developer, m_DrawInWorld, m_DrawInWorldClear, m_FilterOrderButton, m_FilterOrderReversed, ScriptConsoleTabBase::m_IsShiftDown, m_ItemMoveDownButton, m_ItemMoveUpButton, m_ItemNameCopy, m_ItemPreviewCheckbox, m_ItemPreviewWidget, m_ListActions, m_MissionGameplay, m_ObjectFilter, m_ObjectsTextListbox, m_PresetAddItemtButton, m_PresetDeleteButton, m_PresetItemsTextListbox, m_PresetNewButton, m_PresetRemoveItemButton, m_PresetRenameButton, m_PresetSetDefaultButton, m_PresetsTextListbox, m_PreviewEntity, m_QuantityEditBox, m_RectSpawnColumn, m_RectSpawnColumnStep, m_RectSpawnRow, m_RectSpawnRowStep, m_ReloadShapeButton, ScriptConsoleTabBase::m_ScriptConsole, m_SelectedObject, m_SelectedObjectIsPreset, m_SelectedObjectText, m_SpawnBatchButton, m_SpawnDistanceEditBox, m_SpawnGroundButton, m_SpawnGroundPatternGrid, m_SpawnInHands, m_SpawnInInvButton, m_SpawnOnCursor, m_SpawnOnTarget, m_WithPhysicsCheckbox, MENU_SCRIPTCONSOLE_DIALOG_PRESET_NAME, MENU_SCRIPTCONSOLE_DIALOG_PRESET_RENAME, DayZPhysics::RaycastRV(), RemoveItemFromPreset(), SaveProfileSpawnDistance(), SelectObject(), SelectPreset(), SetDefaultPreset(), SetFilterOrder(), ItemPreviewWidget::SetItem(), SetObject(), ShowItemButtons(), ShowItemTransferButtons(), SpawnPreset(), x и y.

◆ OnDoubleClick()

override bool OnDoubleClick ( Widget w,
int x,
int y,
int button )
inlineprotected
1448 {
1449 super.OnDoubleClick(w, x, y, button);
1450
1451 int i;
1454
1455 if (w == m_ObjectsTextListbox)
1456 {
1457 //select item
1458 m_PresetItemsTextListbox.SelectRow(-1);
1461 m_SelectedObjectText.SetText("Object : " + GetCurrentObjectName());
1462
1466
1467 //spawn item
1469
1470 objects_row_index = m_ObjectsTextListbox.GetSelectedRow();
1471
1472 vector rayStart = GetGame().GetCurrentCameraPosition();
1473 vector rayEnd = rayStart + GetGame().GetCurrentCameraDirection() * 1.5;
1474 vector hitPos;
1476 int hitComponentIndex;
1479
1480 Object target = NULL;
1481 if (hitObjects.Count())
1482 target = hitObjects.Get(0);
1483
1484 if (m_SelectedObject != "")
1485 {
1486 float distance = m_SpawnDistanceEditBox.GetText().ToFloat();
1487
1488 if (button == 0) //LMB
1489 {
1490 m_Developer.SpawnEntityOnCursorDir(player, m_SelectedObject, 1, distance);
1491 return true;
1492 }
1493 else if (button == 1) //RMB
1494 {
1495 if (GetGame().IsMultiplayer())
1496 {
1497 m_Developer.SpawnEntityInPlayerInventory(player, m_SelectedObject, -1, -1);
1498 }
1499 else
1500 {
1501 EntityAI spawned_entity = m_Developer.SpawnEntityOnCursorDir(player, m_SelectedObject, -1, distance);
1502 player.LocalTakeEntityToHands(spawned_entity);
1503 }
1504 return true;
1505 }
1506 else if (button == 2) //MMB
1507 {
1508 m_Developer.SpawnEntityOnCursorDir(player, m_SelectedObject, 1, distance,-1, true);
1509 return true;
1510 }
1511 }
1512
1513 }
1514 else if (w == m_QuantityEditBox)
1515 {
1516 m_QuantityEditBox.SetText("1.0");
1517 return true;
1518 }
1519 return false;
1520 }

Перекрестные ссылки GetCurrentObjectName(), GetGame(), GetPlayer(), HideItemButtons(), m_Developer, m_LastSelectedObject, m_ObjectsTextListbox, m_PresetItemsTextListbox, m_QuantityEditBox, m_SelectedObject, m_SelectedObjectIsPreset, m_SelectedObjectText, m_SpawnDistanceEditBox, DayZPhysics::RaycastRV(), SaveProfileSpawnDistance(), ShowItemTransferButtons(), x и y.

◆ OnItemSelected()

override bool OnItemSelected ( Widget w,
int x,
int y,
int row,
int column,
int oldRow,
int oldColumn )
inlineprotected
1156 {
1157 super.OnItemSelected(w, x, y, row, column, oldRow, oldColumn);
1159 {
1160 if (m_PresetsTextListbox.GetSelectedRow() != -1)
1161 {
1162 SelectPreset();
1163 return true;
1164 }
1165 }
1166 else if (w == m_PresetItemsTextListbox)
1167 {
1168 if (m_PresetItemsTextListbox.GetSelectedRow() != -1)
1169 {
1175 }
1176 return true;
1177 }
1178 else if (w == m_ObjectsTextListbox)
1179 {
1180 SelectObject(false);
1181 return true;
1182 }
1183 return false;
1184 }

Перекрестные ссылки GetCurrentItemName(), m_ObjectsTextListbox, m_PresetItemsTextListbox, m_PresetsTextListbox, m_SelectedObjectIsPreset, m_SelectedObjectText, SelectObject(), SelectPreset(), SetObject(), ShowItemButtons(), ShowItemTransferButtons(), x и y.

◆ OnKeyDown()

override bool OnKeyDown ( Widget w,
int x,
int y,
int key )
inlineprotected
343 {
344 if (key == KeyCode.KC_D && m_SelectedObject != "")
345 {
347 return true;
348 }
349 else
350 return super.OnKeyDown(w, x, y, key);
351 }
KeyCode
Definition EnSystem.c:157

Перекрестные ссылки DrawItems(), m_SelectedObject, x и y.

◆ PrepareFilters()

void PrepareFilters ( string filter,
out TStringArray filters,
out TIntArray colors )
inlineprotected
901 {
902 filter.Trim();
903 filter.ToLower();
904
905 filters = new TStringArray;
907 filter.Split(" ", rawFilters);
908
909 colors = new TIntArray;
910
911
912 foreach (int i, string f:rawFilters)
913 {
914 int color = -1;
915 if (f.IndexOf(":") == 1)//detect color prefix
916 {
917 string clr = f.Substring(0, 1);
918 f = f.Substring(2, f.Length() - 2);//crop off color prefix
920 }
921 else//autocolor
922 {
923 if (i%2 == 1)
924 {
925 color = ARGB(200,255,255,255);
926 }
927 }
928 filters.Insert(f);
929 colors.Insert(color);
930 }
931 }
int GetFilterColor(string color)
Definition ScriptConsoleItemsTab.c:882
array< int > TIntArray
Definition EnScript.c:687

Перекрестные ссылки ARGB() и GetFilterColor().

Используется в ChangeFilter().

◆ PreprocessFilterText()

string PreprocessFilterText ( MultilineEditBoxWidget w)
inlineprotected
1553 {
1554 string widgetText;
1555 w.GetText(widgetText);
1556
1557 if (widgetText.Contains(","))
1558 {
1559 widgetText.Replace(","," ");
1560 w.SetLine(0,widgetText);
1561 }
1562 return widgetText;
1563 }

Используется в ChangeFilterItems().

◆ RefreshLists()

void RefreshLists ( )
inlineprotected
793 {
796 }

Перекрестные ссылки RenderPresetItems() и RenderPresets().

Используется в DeletePreset(), NewPreset() и RenamePreset().

◆ RemoveItemFromPreset()

void RemoveItemFromPreset ( )
inlineprotected
748 {
749 if (GetCurrentItemIndex() != -1 && GetCurrentPresetIndex() != -1)
750 {
753 }
754 }

Перекрестные ссылки GetCurrentItemIndex(), GetCurrentPresetIndex(), GetCurrentPresetName(), ScriptConsoleTabBase::m_ConfigDebugProfile и RenderPresetItems().

Используется в OnClick().

◆ RenamePreset()

void RenamePreset ( string new_preset_name)
inlineprotected

◆ RenderPresetItems()

void RenderPresetItems ( )
inlineprotected
839 {
840 // load preset items list
841 int i;
842 m_PresetItemsTextListbox.ClearItems();
843 if (GetCurrentPresetIndex() != -1)
844 {
847
848 if (isFixed)
849 {
851 }
852 else
853 {
855 }
856
857 if (preset_array)
858 {
859 for (i = 0; i < preset_array.Count(); i++)
860 {
862 }
863 }
864 }
865 }
bool IsCurrentPresetFixed()
Definition ScriptConsoleItemsTab.c:402
PluginConfigDebugProfileFixed m_ConfigDebugProfileFixed
Definition ScriptConsoleTabBase.c:12

Перекрестные ссылки GetCurrentPresetIndex(), GetCurrentPresetName(), IsCurrentPresetFixed(), ScriptConsoleTabBase::m_ConfigDebugProfile, ScriptConsoleTabBase::m_ConfigDebugProfileFixed и m_PresetItemsTextListbox.

Используется в AddItemToPreset(), Init(), ItemMoveDown(), ItemMoveUp(), RefreshLists(), RemoveItemFromPreset() и SelectPreset().

◆ RenderPresets()

void RenderPresets ( )
inlineprotected
800 {
801 m_PresetsTextListbox.ClearItems();
802
803 int i;
805
806 // load custom presets list
808 for (i = custom_presets_array.Count() - 1; i >= 0; i--)
809 {
810 m_PresetsTextListbox.AddItem(custom_presets_array.Get(i), new PresetParams (custom_presets_array.Get(i),false, false), 0);
811 }
812
813 // load fixed presets list
815 for (i = 0; i < presets_array.Count(); i++)
816 {
817 m_PresetsTextListbox.AddItem("["+presets_array.Get(i)+"]", new PresetParams (presets_array.Get(i), true, false), 0);
818 }
819 string default_preset = m_ConfigDebugProfile.GetDefaultPreset();
820 if (default_preset != "")
821 {
822 // if is fixed
825 {
826 default_preset = "[" + default_preset + "]";
827 }
829 if (index > -1 && index < m_PresetsTextListbox.GetNumItems())
830 {
833 }
834 }
835 }
Param3< string, bool, bool > PresetParams
Definition ScriptConsoleItemsTab.c:1
bool IsPresetFixed(string preset_name)
Definition ScriptConsoleItemsTab.c:414
const string CONST_DEFAULT_PRESET_PREFIX
Definition ScriptConsoleItemsTab.c:5

Перекрестные ссылки CONST_DEFAULT_PRESET_PREFIX, GetPresetIndexByName(), IsPresetFixed(), ScriptConsoleTabBase::m_ConfigDebugProfile, ScriptConsoleTabBase::m_ConfigDebugProfileFixed и m_PresetsTextListbox.

Используется в Init() и RefreshLists().

◆ SaveProfileSpawnDistance()

void SaveProfileSpawnDistance ( )
inlineprotected
548 {
550 {
551 m_ConfigDebugProfile.SetSpawnDistance(m_SpawnDistanceEditBox.GetText().ToFloat());
552 }
553 }

Перекрестные ссылки ScriptConsoleTabBase::m_ConfigDebugProfile и m_SpawnDistanceEditBox.

Используется в OnClick() и OnDoubleClick().

◆ SelectObject()

◆ SelectPreset()

void SelectPreset ( )
inlineprotected
368 {
369 m_ObjectsTextListbox.SelectRow(-1);
374 m_SelectedObjectText.SetText("Preset : " + m_SelectedObject);
376
378
380
382 if (command_array.IsValidIndex(0))
383 {
384 string first_line = command_array.Get(0);
385 first_line.ToLower();
386 clear = (first_line == "clear_inv");
387 }
388
389 m_ClearInventory.SetChecked(clear);
390 }
void ShowPresetButtons()
Definition ScriptConsoleItemsTab.c:722

Перекрестные ссылки GetCurrentPresetName(), IsPresetFixed(), m_ClearInventory, ScriptConsoleTabBase::m_ConfigDebugProfileFixed, m_ObjectsTextListbox, m_SelectedObject, m_SelectedObjectIsPreset, m_SelectedObjectText, RenderPresetItems(), ShowItemTransferButtons() и ShowPresetButtons().

Используется в Init(), OnClick() и OnItemSelected().

◆ SetDefaultPreset()

void SetDefaultPreset ( int preset_index)
inlineprotected
630 {
631 // remove previous default parameter
632 string default_preset = m_ConfigDebugProfile.GetDefaultPreset();
633 if (default_preset != "")
634 {
636 // if is fixed
638 {
639 default_preset = "[" + default_preset + "]";
640 }
642 if (index > -1 && index < m_PresetsTextListbox.GetNumItems())
643 {
645 prev_preset_params_array.param3 = false; // remove DEFAULT
647 }
648 }
649
650 // set preset on preset_index to default
651 // if is fixed
654 {
655 preset_name = "[" + preset_name + "]";
656 }
657 // set new default preset
660 if (index > -1 && index < m_PresetsTextListbox.GetNumItems())
661 {
663 preset_params_array.param3 = true; // DEFAULT
665 }
666 // store preset
667 m_ConfigDebugProfile.SetDefaultPreset(GetCurrentPresetName());
668 }

Перекрестные ссылки CONST_DEFAULT_PRESET_PREFIX, GetCurrentPresetIndex(), GetCurrentPresetName(), GetPresetIndexByName(), IsPresetFixed(), ScriptConsoleTabBase::m_ConfigDebugProfile и m_PresetsTextListbox.

Используется в OnClick().

◆ SetFilterOrder()

void SetFilterOrder ( bool reversed)
inlineprotected
1049 {
1051 if (reversed)
1052 m_FilterOrderImage.SetRotation(0,0,180,true);
1053 else
1054 m_FilterOrderImage.SetRotation(0,0,0,true);
1055 ChangeFilterItems(true);
1057 {
1058 m_ConfigDebugProfile.SetFilterOrderReversed(reversed);
1059 }
1060 }

Перекрестные ссылки ChangeFilterItems(), ScriptConsoleTabBase::m_ConfigDebugProfile, m_FilterOrderImage и m_FilterOrderReversed.

Используется в Init() и OnClick().

◆ SetObject()

void SetObject ( string object)
inlineprotected
671 {
673
674 if (m_ConfigDebugProfile && m_ConfigDebugProfile.GetShowItemPreview())
675 {
676 SetPreviewObject(object);
677 }
678
679 }
void SetPreviewObject(string object)
Definition ScriptConsoleItemsTab.c:681

Перекрестные ссылки ScriptConsoleTabBase::m_ConfigDebugProfile, m_SelectedObject и SetPreviewObject().

Используется в Init(), OnClick(), OnItemSelected() и SelectObject().

◆ SetPreviewObject()

void SetPreviewObject ( string object)
inlineprotected
682 {
683 #ifdef DEVELOPER
684 if (m_PreviewEntity)
685 {
686 m_PreviewEntity.Delete();
687 }
688
689 m_SelectedObjectLocalized.SetText("");
690
691 if (!GetGame().IsKindOf(object, "DZ_LightAI") && !GetGame().IsKindOf(object, "Man"))
692 {
693 DayZGame.m_IsPreviewSpawn = true;
695 m_PreviewEntity = EntityAI.Cast(GetGame().CreateObjectEx(object, "0 0 0", ECE_LOCAL | ECE_CREATEPHYSICS | ECE_TRACE));
696 DayZGame.m_IsPreviewSpawn = false;
697 if (m_PreviewEntity)
698 {
699 dBodyDestroy(m_PreviewEntity);//prevents cars from acting up when spawned this way(we only want the preview pic, no physics required)
700 m_PreviewEntity.DisableSimulation(true);
702 m_PreviewEntity.SetAllowDamage(false);
703
704 m_SelectedObjectLocalized.SetText(m_PreviewEntity.GetDisplayName());
705 }
706 }
707 #endif
708 }
const int ECE_LOCAL
Definition CentralEconomy.c:24
const int ECE_TRACE
Definition CentralEconomy.c:10
const int ECE_CREATEPHYSICS
Definition CentralEconomy.c:16
proto native void dBodyDestroy(notnull IEntity ent)
Destroys attached physics body.

Перекрестные ссылки dBodyDestroy(), ECE_CREATEPHYSICS, ECE_LOCAL, ECE_TRACE, GetGame(), m_ItemPreviewWidget, m_PreviewEntity, m_SelectedObjectLocalized и ItemPreviewWidget::SetItem().

Используется в SetObject().

◆ SetTextSpawnButton()

void SetTextSpawnButton ( ButtonWidget w,
bool special,
string suffix = " Special" )
inlineprotected
1530 {
1531 string text = m_SpawnButtonsOriginalText.Get(w);
1532 if (special)
1533 text += suffix;
1534 w.SetText(text);
1535 }

Перекрестные ссылки m_SpawnButtonsOriginalText.

Используется в UpdateButtonNames().

◆ ShowItemButtons()

void ShowItemButtons ( )
inlineprotected
443 {
445 {
447
450
451 m_ItemMoveUpButton.Show(true);
452 m_ItemMoveDownButton.Show(true);
453
454 m_ItemDamageLabel.Show(true);
455 m_ItemQuantityLabel.Show(true);
456
457 if (preset_name != "" && item_index > -1)
458 {
459 m_DamageEditBox.Show(true);
460 m_QuantityEditBox.Show(true);
461 m_WithPhysicsCheckbox.Show(true);
462
466
467 // damage
468 m_DamageEditBox.SetText(item_health.ToString());
469
470 // quantity
471 m_QuantityEditBox.SetText(item_quantity.ToString());
472
473 // with physics
475 }
476 else
477 {
478 m_DamageEditBox.Show(false);
479 m_QuantityEditBox.Show(false);
480 m_WithPhysicsCheckbox.Show(false);
481
482 }
483 }
484 }

Перекрестные ссылки GetCurrentItemIndex(), GetCurrentPresetName(), IsCurrentPresetFixed(), ScriptConsoleTabBase::m_ConfigDebugProfile, m_DamageEditBox, m_ItemDamageLabel, m_ItemMoveDownButton, m_ItemMoveUpButton, m_ItemQuantityLabel, m_QuantityEditBox, m_WithPhysicsCheckbox и ShowItemTransferButtons().

Используется в OnClick() и OnItemSelected().

◆ ShowItemTransferButtons()

void ShowItemTransferButtons ( )
inlineprotected
493 {
494 int object_row = m_ObjectsTextListbox.GetSelectedRow();
496 {
497 m_PresetAddItemtButton.Show(true);
498 }
499 else
500 {
501 m_PresetAddItemtButton.Show(false);
502 }
503
505 {
506 m_PresetRemoveItemButton.Show(true);
507 }
508 else
509 {
510 m_PresetRemoveItemButton.Show(false);
511 }
512
513 if (object_row > -1)
514 {
515 m_ItemNameCopy.Show(true);
516 }
517 else
518 {
519 m_ItemNameCopy.Show(false);
520 }
521
522 }

Перекрестные ссылки GetCurrentItemIndex(), GetCurrentPresetIndex(), IsCurrentPresetFixed(), m_ItemNameCopy, m_ObjectsTextListbox, m_PresetAddItemtButton и m_PresetRemoveItemButton.

Используется в Init(), OnClick(), OnDoubleClick(), OnItemSelected(), SelectObject(), SelectPreset() и ShowItemButtons().

◆ ShowPresetButtons()

void ShowPresetButtons ( )
inlineprotected
723 {
724 bool show = true;
726 {
727 show = false;
728 }
729 m_PresetDeleteButton.Show(show);
730 m_PresetRenameButton.Show(show);
731
733
734 }

Перекрестные ссылки HideItemButtons(), IsCurrentPresetFixed(), m_PresetDeleteButton и m_PresetRenameButton.

Используется в SelectPreset().

◆ SpawnPreset()

void SpawnPreset ( EntityAI target,
bool clear_inventory,
string preset_name,
InventoryLocationType location = InventoryLocationType.ATTACHMENT,
float distance = 0 )
inlineprotected
566 {
567 // spawn preset items into inventory
569 if (GetCurrentPresetIndex() != -1)
570 {
573
574 if (is_preset_fixed)
575 {
577
578 }
579 else
580 {
582 }
583
584 if (clear_inventory)
585 {
586 m_Developer.ClearInventory(target);
587 }
588
589 for (int i = 0; i < preset_array.Count(); i++)
590 {
591 float health = -1;
592 int quantity = 1;
593 bool with_physics = false;
594 if (is_preset_fixed)
595 {
599 }
600 else
601 {
602 health = m_ConfigDebugProfile.GetItemHealth(preset_name, i);
603 quantity = m_ConfigDebugProfile.GetItemQuantity(preset_name, i);
604 with_physics = m_ConfigDebugProfile.GetItemWithPhysics(preset_name, i);
605 }
606 if (location == InventoryLocationType.ATTACHMENT)
607 EntityAI ent = m_Developer.SpawnEntityInInventory(target, preset_array.Get(i), -1, quantity, false, preset_name);
608 //m_Developer.SpawnEntityAsAttachment(player, target, preset_array.Get(i), -1, quantity, false, preset_name);
609 else if (location == InventoryLocationType.GROUND)
610 {
611 m_Developer.SpawnEntityOnCursorDir(player, preset_array.Get(i), quantity, distance, health, false, preset_name, with_physics);
612 }
613 }
614 if (GetGame().IsMultiplayer())
615 {
616 ScriptRPC rpc = new ScriptRPC();
617 rpc.Write(preset_name);
618 rpc.Write(target);
619 rpc.Send(player, ERPCs.DEV_RPC_SPAWN_PRESET, true, player.GetIdentity());
620 }
621 else
622 {
623 PluginDeveloper plugin = PluginDeveloper.Cast(GetPlugin(PluginDeveloper));
624 plugin.HandlePresetSpawn(player,preset_name,target);
625 }
626 }
627 }
ERPCs
Definition ERPCs.c:2
Definition gameplay.c:105

Перекрестные ссылки GetCurrentPresetIndex(), GetGame(), GetPlayer(), GetPlugin(), IsCurrentPresetFixed(), ScriptConsoleTabBase::m_ConfigDebugProfile, ScriptConsoleTabBase::m_ConfigDebugProfileFixed и m_Developer.

Используется в OnClick().

◆ Update()

override void Update ( float timeslice)
inlineprotected
1523 {
1524 super.Update(timeslice);
1525
1527 }
void UpdateButtonNames()
Definition ScriptConsoleItemsTab.c:1537

Перекрестные ссылки UpdateButtonNames().

◆ UpdateButtonNames()

Поля

◆ CLEAR_IVN

bool CLEAR_IVN
staticprotected

Используется в OnChange() и OnClick().

◆ CONST_DEFAULT_PRESET_PREFIX

const string CONST_DEFAULT_PRESET_PREFIX = "[Default]"
protected

Используется в RenderPresets() и SetDefaultPreset().

◆ DRAW_DISTANCE

float DRAW_DISTANCE = 1000
staticprotected

Используется в DrawItems(), Init() и OnChange().

◆ ITEMS_IN_PRESET_SELECTED_ROW

int ITEMS_IN_PRESET_SELECTED_ROW
staticprotected

Используется в Init() и ~ScriptConsoleItemsTab().

◆ ITEMS_SELECTED_ROW

int ITEMS_SELECTED_ROW = -1
staticprotected

Используется в Init() и ~ScriptConsoleItemsTab().

◆ m_BatchSpawnQuantity

EditBoxWidget m_BatchSpawnQuantity
protected

Используется в Init(), OnChange(), OnClick() и ScriptConsoleItemsTab().

◆ m_CategoryButtonsNames

ref array<string> m_CategoryButtonsNames = {"FIREARMS","MELEE","ATTACHMENTS","MAGAZINES","AMMO","FOOD","MEDICAL","CARS","BACKPACKS","B-BUILDING"}
protected
21{"FIREARMS","MELEE","ATTACHMENTS","MAGAZINES","AMMO","FOOD","MEDICAL","CARS","BACKPACKS","B-BUILDING"};

Используется в Init().

◆ m_CategoryButtonsWidgets

ref array<Widget> m_CategoryButtonsWidgets = new array<Widget>
protected

Используется в Init() и OnChange().

◆ m_CategoryMask

int m_CategoryMask
protected

◆ m_CategoryMergeType

CheckBoxWidget m_CategoryMergeType
protected

Используется в Init(), OnClick() и ScriptConsoleItemsTab().

◆ m_ClearInventory

CheckBoxWidget m_ClearInventory
protected

Используется в OnChange(), ScriptConsoleItemsTab() и SelectPreset().

◆ m_DamageEditBox

EditBoxWidget m_DamageEditBox
protected

◆ m_DebugShapes

ref array<Shape> m_DebugShapes = new array<Shape>
staticprotected

Используется в DrawItems() и DrawItemsClear().

◆ m_Developer

PluginDeveloper m_Developer
protected

◆ m_DrawDistanceWidget

EditBoxWidget m_DrawDistanceWidget
protected

Используется в Init(), OnChange() и ScriptConsoleItemsTab().

◆ m_DrawInWorld

ButtonWidget m_DrawInWorld
protected

Используется в OnClick() и ScriptConsoleItemsTab().

◆ m_DrawInWorldClear

ButtonWidget m_DrawInWorldClear
protected

Используется в OnClick() и ScriptConsoleItemsTab().

◆ m_FilterOrderButton

ButtonWidget m_FilterOrderButton
protected

Используется в OnClick() и ScriptConsoleItemsTab().

◆ m_FilterOrderImage

ImageWidget m_FilterOrderImage
protected

Используется в ScriptConsoleItemsTab() и SetFilterOrder().

◆ m_FilterOrderReversed

bool m_FilterOrderReversed
protected

Используется в ChangeFilter(), OnClick() и SetFilterOrder().

◆ m_FilterTextPrev

string m_FilterTextPrev
protected

Используется в ChangeFilterItems().

◆ m_ItemDamageLabel

TextWidget m_ItemDamageLabel
protected

Используется в ScriptConsoleItemsTab() и ShowItemButtons().

◆ m_ItemMoveDownButton

ButtonWidget m_ItemMoveDownButton
protected

◆ m_ItemMoveUpButton

ButtonWidget m_ItemMoveUpButton
protected

◆ m_ItemNameCopy

ButtonWidget m_ItemNameCopy
protected

◆ m_ItemPreviewCheckbox

CheckBoxWidget m_ItemPreviewCheckbox
protected

Используется в Init(), OnClick() и ScriptConsoleItemsTab().

◆ m_ItemPreviewWidget

ItemPreviewWidget m_ItemPreviewWidget
protected

Используется в OnClick(), ScriptConsoleItemsTab() и SetPreviewObject().

◆ m_ItemQuantity

float m_ItemQuantity = 1
staticprotected

Используется в Init() и ~ScriptConsoleItemsTab().

◆ m_ItemQuantityLabel

TextWidget m_ItemQuantityLabel
protected

Используется в ScriptConsoleItemsTab() и ShowItemButtons().

◆ m_LastSelectedObject

string m_LastSelectedObject
staticprotected

Используется в GetLastSelectedObject(), Init(), OnDoubleClick() и SelectObject().

◆ m_ListActions

ButtonWidget m_ListActions
protected

Используется в OnClick() и ScriptConsoleItemsTab().

◆ m_MissionGameplay

MissionGameplay m_MissionGameplay
protected

Используется в Init() и OnClick().

◆ m_ObjectFilter

MultilineEditBoxWidget m_ObjectFilter
protected

Используется в ChangeFilterItems(), Init(), OnClick() и ScriptConsoleItemsTab().

◆ m_ObjectsScope

int m_ObjectsScope = 2
staticprotected

Используется в ChangeFilter(), Init() и OnChange().

◆ m_ObjectsTextListbox

◆ m_PresetAddItemtButton

ButtonWidget m_PresetAddItemtButton
protected

◆ m_PresetDeleteButton

ButtonWidget m_PresetDeleteButton
protected

Используется в Init(), OnClick(), ScriptConsoleItemsTab() и ShowPresetButtons().

◆ m_PresetItemsTextListbox

◆ m_PresetNewButton

ButtonWidget m_PresetNewButton
protected

Используется в OnClick() и ScriptConsoleItemsTab().

◆ m_PresetRemoveItemButton

ButtonWidget m_PresetRemoveItemButton
protected

◆ m_PresetRenameButton

ButtonWidget m_PresetRenameButton
protected

Используется в Init(), OnClick(), ScriptConsoleItemsTab() и ShowPresetButtons().

◆ m_PresetSetDefaultButton

ButtonWidget m_PresetSetDefaultButton
protected

Используется в OnClick() и ScriptConsoleItemsTab().

◆ m_PresetsTextListbox

◆ m_PreviewEntity

EntityAI m_PreviewEntity
staticprotected

◆ m_QuantityEditBox

◆ m_RectSpawnColumn

EditBoxWidget m_RectSpawnColumn
protected

Используется в Init(), OnChange(), OnClick() и ScriptConsoleItemsTab().

◆ m_RectSpawnColumnStep

EditBoxWidget m_RectSpawnColumnStep
protected

Используется в Init(), OnChange(), OnClick() и ScriptConsoleItemsTab().

◆ m_RectSpawnRow

EditBoxWidget m_RectSpawnRow
protected

Используется в Init(), OnChange(), OnClick() и ScriptConsoleItemsTab().

◆ m_RectSpawnRowStep

EditBoxWidget m_RectSpawnRowStep
protected

Используется в Init(), OnChange(), OnClick() и ScriptConsoleItemsTab().

◆ m_RefreshFilterTimer

ref Timer m_RefreshFilterTimer = new Timer()
protected

Используется в Init() и ~ScriptConsoleItemsTab().

◆ m_ReloadShapeButton

ButtonWidget m_ReloadShapeButton
protected

Используется в OnClick() и ScriptConsoleItemsTab().

◆ m_SelectedObject

string m_SelectedObject
protected

◆ m_SelectedObjectIsPreset

int m_SelectedObjectIsPreset = -1
staticprotected

◆ m_SelectedObjectLocalized

TextWidget m_SelectedObjectLocalized
protected

Используется в ScriptConsoleItemsTab() и SetPreviewObject().

◆ m_SelectedObjectText

TextWidget m_SelectedObjectText
protected

◆ m_ShowProtected

CheckBoxWidget m_ShowProtected
protected

Используется в Init(), OnChange() и ScriptConsoleItemsTab().

◆ m_SpawnBatchButton

ButtonWidget m_SpawnBatchButton
protected

Используется в OnClick(), ScriptConsoleItemsTab() и UpdateButtonNames().

◆ m_SpawnButtonsOriginalText

ref map<Widget, string> m_SpawnButtonsOriginalText = new map<Widget, string>()
protected

Используется в ScriptConsoleItemsTab() и SetTextSpawnButton().

◆ m_SpawnDistanceEditBox

EditBoxWidget m_SpawnDistanceEditBox
protected

◆ m_SpawnGroundButton

ButtonWidget m_SpawnGroundButton
protected

Используется в OnClick(), ScriptConsoleItemsTab() и UpdateButtonNames().

◆ m_SpawnGroundPatternGrid

ButtonWidget m_SpawnGroundPatternGrid
protected

Используется в OnClick().

◆ m_SpawnInHands

ButtonWidget m_SpawnInHands
protected

Используется в OnClick(), ScriptConsoleItemsTab() и UpdateButtonNames().

◆ m_SpawnInInvButton

ButtonWidget m_SpawnInInvButton
protected

Используется в OnClick(), ScriptConsoleItemsTab() и UpdateButtonNames().

◆ m_SpawnOnCursor

ButtonWidget m_SpawnOnCursor
protected

Используется в OnClick(), ScriptConsoleItemsTab() и UpdateButtonNames().

◆ m_SpawnOnTarget

ButtonWidget m_SpawnOnTarget
protected

Используется в OnClick(), ScriptConsoleItemsTab() и UpdateButtonNames().

◆ m_WithPhysics

bool m_WithPhysics = false
staticprotected

Используется в Init() и ~ScriptConsoleItemsTab().

◆ m_WithPhysicsCheckbox

CheckBoxWidget m_WithPhysicsCheckbox
protected

◆ PRESETS_SELECTED_ROW

int PRESETS_SELECTED_ROW = 0
staticprotected

Используется в Init() и ~ScriptConsoleItemsTab().


Объявления и описания членов класса находятся в файле: