82 m_DrawInWorld = ButtonWidget.Cast(root.FindAnyWidget(
"ButtonDrawItem"));
88 m_ShowProtected = CheckBoxWidget.Cast(root.FindAnyWidget(
"ShowProtectedCheckbox"));
90 m_ClearInventory = CheckBoxWidget.Cast(root.FindAnyWidget(
"ForceClearCheckbox"));
92 m_ObjectFilter = MultilineEditBoxWidget.Cast(root.FindAnyWidget(
"ObjectFilter"));
104 m_ItemNameCopy = ButtonWidget.Cast(root.FindAnyWidget(
"ItemNameCopy"));
118 m_SpawnOnTarget = ButtonWidget.Cast(root.FindAnyWidget(
"ButtonSpawnInTarget"));
119 m_SpawnOnCursor = ButtonWidget.Cast(root.FindAnyWidget(
"ButtonSpawnCursor"));
120 m_SpawnInHands = ButtonWidget.Cast(root.FindAnyWidget(
"ButtonSpawnHands"));
137 m_ListActions = ButtonWidget.Cast(root.FindAnyWidget(
"ListActions"));
207 m_RectSpawnRow.SetText(CfgParamInt.Cast(params.Get(0)).GetValue().ToString());
208 m_RectSpawnColumn.SetText(CfgParamInt.Cast(params.Get(1)).GetValue().ToString());
222 string widget_name =
"ItemCategory" + counter;
224 CheckBoxWidget btw = CheckBoxWidget.Cast(
m_ParentRoot.FindAnyWidget(widget_name));
229 int bit = 1 << counter;
232 btw.SetChecked(
true);
233 btw.SetTextColor(
ARGB(255, 255, 0, 0));
304 foreach (
Object o: objects)
306 if (o.IsKindOf(type))
309 ScriptConsole.m_MarkedEntities.Insert(
new MapMarker(o.GetPosition(),
"",
COLOR_RED,eMapMarkerTypes.MARKERTYPE_MAP_BORDER_CROSS));
312 lines[0] = o.GetPosition();
313 lines[1] = o.GetPosition() +
"0 30 0";
322 Debug.
Log(
string.Format(
"found %1 instances of type %1", i, type));
328 ScriptConsole.m_MarkedEntities.Clear();
350 return super.OnKeyDown(w,
x,
y, key);
382 if (command_array.IsValidIndex(0))
384 string first_line = command_array.Get(0);
386 clear = (first_line ==
"clear_inv");
409 return item_params_array.param2;
421 return item_params_array.param2;
434 if (item_params_array.param1 == preset_name)
457 if (preset_name !=
"" && item_index > -1)
589 for (
int i = 0; i < preset_array.Count(); i++)
593 bool with_physics =
false;
607 EntityAI ent =
m_Developer.SpawnEntityInInventory(target, preset_array.Get(i), -1, quantity,
false, preset_name);
611 m_Developer.SpawnEntityOnCursorDir(player, preset_array.Get(i), quantity, distance, health,
false, preset_name, with_physics);
617 rpc.
Write(preset_name);
619 rpc.
Send(player,
ERPCs.DEV_RPC_SPAWN_PRESET,
true, player.GetIdentity());
623 PluginDeveloper plugin = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
624 plugin.HandlePresetSpawn(player,preset_name,target);
633 if (default_preset !=
"")
639 default_preset =
"[" + default_preset +
"]";
645 prev_preset_params_array.param3 =
false;
655 preset_name =
"[" + preset_name +
"]";
663 preset_params_array.param3 =
true;
691 if (!
GetGame().IsKindOf(
object,
"DZ_LightAI") && !
GetGame().IsKindOf(
object,
"Man"))
693 DayZGame.m_IsPreviewSpawn =
true;
696 DayZGame.m_IsPreviewSpawn =
false;
764 return item_params_array.param1;
783 if (selected_row_index != -1)
808 for (i = custom_presets_array.Count() - 1; i >= 0; i--)
815 for (i = 0; i < presets_array.Count(); i++)
820 if (default_preset !=
"")
826 default_preset =
"[" + default_preset +
"]";
859 for (i = 0; i < preset_array.Count(); i++)
887 return ARGB(255,255,0,0);
889 return ARGB(255,0,255,0);
891 return ARGB(255,130,130,255);
893 return ARGB(255,255,255,0);
895 return ARGB(255,255,169,0);
907 filter.
Split(
" ", rawFilters);
912 foreach (
int i,
string f:rawFilters)
915 if (f.IndexOf(
":") == 1)
917 string clr = f.Substring(0, 1);
918 f = f.Substring(2, f.Length() - 2);
925 color =
ARGB(200,255,255,255);
929 colors.Insert(color);
934 void ChangeFilter(
TStringArray classes, TextListboxWidget widget, MultilineEditBoxWidget filterWidget,
int categoryMask = -1,
bool ignoreScope =
false)
942 filterWidget.GetText(widgetText);
950 for (
int i = 0; i < classes.Count(); i++)
952 string config_path = classes.Get(i);
955 for (
int j = 0; j < objects_count; j++)
965 int category_bit =
GetGame().
ConfigGetInt(config_path +
" " + child_name +
" debug_ItemCategory") - 1;
966 category_bit = (1 << category_bit);
968 bool display =
false;
970 if (category_bit & categoryMask)
976 string child_name_lower = child_name;
979 foreach (
int indx,
string filter:filters)
981 if (child_name_lower.
Contains(filter))
984 color = filterColors.Get(indx);
989 itemsByFilters.Set(filter, arr);
991 arr.Insert(child_name);
992 itemsAndColors.Insert(child_name,color);
997 else if (categoryMask == 0)
1004 itemsArray.Insert(child_name);
1014 foreach (
string it:itemsArray)
1016 widget.AddItem(it, NULL, 0);
1025 foreach (
string f:filters)
1031 foreach (
string itm: arr2)
1033 int row = widget.AddItem(itm, NULL, 0);
1034 int clr = itemsAndColors.Get(itm);
1037 widget.SetItemColor(row, 0, clr);
1064 super.OnChange(w,
x,
y, finished);
1088 CheckBoxWidget cbw = CheckBoxWidget.Cast(w);
1089 if (cbw.IsChecked())
1092 cbw.SetTextColor(
ARGB(255, 255, 0, 0));
1097 cbw.SetTextColor(
ARGB(255, 255, 255,255));
1141 int result = columnQ * rowQ;
1157 super.OnItemSelected(w,
x,
y, row, column, oldRow, oldColumn);
1189 super.OnClick(w,
x,
y,button);
1191 int objects_row_index;
1229 int hitComponentIndex;
1230 set<Object> hitObjects =
new set<Object>;
1232 DayZPhysics.
RaycastRV(rayStart, rayEnd, hitPos, hitNormal, hitComponentIndex, hitObjects, NULL, player,
false,
false, ObjIntersectView, 0.3);
1235 if (hitObjects.Count())
1236 target =
EntityAI.Cast(hitObjects.Get(0));
1251 if (target && target.IsInherited(
EntityAI))
1292 if (target && target.IsInherited(
EntityAI))
1310 if (spawnOnCrossHair)
1407 m_Developer.SpawnEntityOnGroundPatternGrid(player,
m_SelectedObject,count,
m_DamageEditBox.GetText().ToFloat(), 1, rows, columns, rowStep, columnStep,
m_IsShiftDown,
m_WithPhysicsCheckbox.IsChecked());
1449 super.OnDoubleClick(w,
x,
y, button);
1452 int objects_row_index;
1476 int hitComponentIndex;
1477 set<Object> hitObjects =
new set<Object>;
1478 DayZPhysics.
RaycastRV(rayStart, rayEnd, hitPos, hitNormal, hitComponentIndex, hitObjects, NULL, player);
1481 if (hitObjects.Count())
1482 target = hitObjects.Get(0);
1493 else if (button == 1)
1495 if (
GetGame().IsMultiplayer())
1502 player.LocalTakeEntityToHands(spawned_entity);
1506 else if (button == 2)
1524 super.Update(timeslice);
1555 w.GetText(widgetText);
1560 w.SetLine(0,widgetText);
1580 string message =
"";
1584 if (interactActions)
1586 message +=
"\n== Interact (F)\n\n";
1593 message +=
string.
Format(
"%1 <%2>\n",
Widget.TranslateString(ia.
GetText()), ia.ClassName());
1599 if (continuousInteractActions)
1601 message +=
"\n== Continuous Interact (F hold)\n\n";
1608 message +=
string.
Format(
"%1 <%2>\n",
Widget.TranslateString(cia.
GetText()), cia.ClassName());
1616 message +=
"\n== Single (LMB)\n\n";
1623 message +=
string.
Format(
"%1 <%2>\n",
Widget.TranslateString(sa.
GetText()), sa.ClassName());
1629 if (continuousActions)
1632 message +=
"\n== Continuous (LMB hold)\n\n";
1638 message +=
string.
Format(
"%1 <%2>\n",
Widget.TranslateString(ca.
GetText()), ca.ClassName());
1642 craftingAction = caction;
1645 message +=
"\n== Crafting recipes \n\n";
1648 PluginRecipesManager pluginRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
1652 if (recipe.IsItemInRecipe(
"Inventory_Base"))
1655 message +=
string.
Format(
"%1 <%2>\n",
Widget.TranslateString(recipe.GetName()), recipe.Type());
1661 infoDialog.SetLabel(
string.Format(
"%1 related actions",
m_PreviewEntity.GetType()));
1662 infoDialog.SetContent(message);
const int ECE_CREATEPHYSICS
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
PluginBase GetPlugin(typename plugin_type)
Param3< string, bool, bool > PresetParams
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native void GetObjectsAtPosition(vector pos, float radius, out array< Object > objects, out array< CargoBase > proxyCargos)
Returns list of all objects in circle "radius" around position "pos".
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto native vector GetCurrentCameraPosition()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native vector GetCurrentCameraDirection()
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.
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.
static bool IsFreeCameraEnabled()
ButtonWidget m_DrawInWorldClear
ref array< string > m_CategoryButtonsNames
void SpawnPreset(EntityAI target, bool clear_inventory, string preset_name, InventoryLocationType location=InventoryLocationType.ATTACHMENT, float distance=0)
TextWidget m_ItemQuantityLabel
ButtonWidget m_SpawnOnCursor
void PrepareFilters(string filter, out TStringArray filters, out TIntArray colors)
ButtonWidget m_PresetSetDefaultButton
CheckBoxWidget m_WithPhysicsCheckbox
ButtonWidget m_SpawnGroundPatternGrid
ref map< Widget, string > m_SpawnButtonsOriginalText
CheckBoxWidget m_ClearInventory
EditBoxWidget m_QuantityEditBox
TextListboxWidget m_PresetItemsTextListbox
static int m_ObjectsScope
ButtonWidget m_DrawInWorld
CheckBoxWidget m_ShowProtected
static string GetLastSelectedObject()
MissionGameplay m_MissionGameplay
MultilineEditBoxWidget m_ObjectFilter
CheckBoxWidget m_ItemPreviewCheckbox
void SelectObject(bool hide_presets=true)
ButtonWidget m_ReloadShapeButton
int GetCurrentItemIndex()
void ShowItemTransferButtons()
override bool OnKeyDown(Widget w, int x, int y, int key)
ButtonWidget m_PresetRemoveItemButton
void NewPreset(string preset_name)
CheckBoxWidget m_CategoryMergeType
ButtonWidget m_ItemMoveUpButton
static bool m_WithPhysics
static void DrawItemsClear()
static int ITEMS_SELECTED_ROW
TextWidget m_SelectedObjectText
EditBoxWidget m_DamageEditBox
void SetDefaultPreset(int preset_index)
ButtonWidget m_SpawnInHands
ButtonWidget m_PresetDeleteButton
string GetCurrentItemName()
override bool OnDoubleClick(Widget w, int x, int y, int button)
static float m_ItemQuantity
EditBoxWidget m_BatchSpawnQuantity
static EntityAI m_PreviewEntity
EditBoxWidget m_DrawDistanceWidget
ButtonWidget m_SpawnOnTarget
ButtonWidget m_PresetNewButton
bool ListItemRelatedActions()
string GetCurrentObjectName()
override bool OnChange(Widget w, int x, int y, bool finished)
bool IsCurrentPresetFixed()
void ~ScriptConsoleItemsTab()
ButtonWidget m_SpawnGroundButton
int GetPresetIndexByName(string preset_name)
static ref array< Shape > m_DebugShapes
ButtonWidget m_ItemNameCopy
ButtonWidget m_FilterOrderButton
EditBoxWidget m_RectSpawnRow
ImageWidget m_FilterOrderImage
bool m_FilterOrderReversed
TextListboxWidget m_ObjectsTextListbox
PluginDeveloper m_Developer
string PreprocessFilterText(MultilineEditBoxWidget w)
ItemPreviewWidget m_ItemPreviewWidget
void ChangeFilter(TStringArray classes, TextListboxWidget widget, MultilineEditBoxWidget filterWidget, int categoryMask=-1, bool ignoreScope=false)
static void DrawItems(string type, float distance=0)
ButtonWidget m_ListActions
EditBoxWidget m_RectSpawnRowStep
EditBoxWidget m_RectSpawnColumnStep
TextListboxWidget m_PresetsTextListbox
int GetCurrentPresetIndex()
void RenamePreset(string new_preset_name)
const string CONST_DEFAULT_PRESET_PREFIX
void SetTextSpawnButton(ButtonWidget w, bool special, string suffix=" Special")
ButtonWidget m_PresetRenameButton
bool IsPresetFixed(string preset_name)
override bool OnClick(Widget w, int x, int y, int button)
ButtonWidget m_ItemMoveDownButton
void SetPreviewObject(string object)
static int PRESETS_SELECTED_ROW
ref array< Widget > m_CategoryButtonsWidgets
static float DRAW_DISTANCE
void ScriptConsoleItemsTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
ref Timer m_RefreshFilterTimer
static string m_LastSelectedObject
static int ITEMS_IN_PRESET_SELECTED_ROW
string GetCurrentPresetName()
TextWidget m_ItemDamageLabel
EditBoxWidget m_RectSpawnColumn
ButtonWidget m_PresetAddItemtButton
int GetFilterColor(string color)
override bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
void RemoveItemFromPreset()
TStringArray GetItemsClasses()
EditBoxWidget m_SpawnDistanceEditBox
void SetObject(string object)
void SaveProfileSpawnDistance()
void ChangeFilterItems(bool forced=false)
void SetFilterOrder(bool reversed)
TextWidget m_SelectedObjectLocalized
ButtonWidget m_SpawnBatchButton
ButtonWidget m_SpawnInInvButton
override void Update(float timeslice)
static int m_SelectedObjectIsPreset
PluginConfigDebugProfile m_ConfigDebugProfile
void ScriptConsoleTabBase(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent=null)
void AddItemToClipboard(TextListboxWidget text_listbox_widget)
ScriptConsole m_ScriptConsole
PluginConfigDebugProfileFixed m_ConfigDebugProfileFixed
proto native void Send(Object target, int rpc_type, bool guaranteed, PlayerIdentity recipient=NULL)
Initiate remote procedure call. When called on client, RPC is evaluated on server; When called on ser...
proto bool Write(void value_out)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString(bool simple=true)
proto native CGame GetGame()
array< string > TStringArray
static proto float Pow(float v, float power)
Return power of v ^ power.
proto native void dBodyDestroy(notnull IEntity ent)
Destroys attached physics body.
class JsonUndergroundAreaTriggerData GetPosition
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.
proto string Trim()
Returns trimmed string with removed leading and trailing whitespaces.
bool Contains(string sample)
Returns true if sample is substring of string.
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.
proto int ToLower()
Changes string to lowercase. Returns length.
int ARGB(int a, int r, int g, int b)