Jump to content
Sign in to follow this  
defk0n_NL

Overwriting Inventory Configs?

Recommended Posts

Im trying to add functionality to the inventory system.

There is a zombie mod who shall not be named ;P which uses a action menu on items. After looking through the code i tried to recreate the most basic of functionality.

But it when i try to test it out. It does not respond.

Does anyone have a deep knowledge of resources and is willing to help?

I know its a very long shot by just hacking apart dayz code and expect it too work i just need to know if im on the right path.

Let me just show you what i got.

init.sqf (loaded via mission)

player_selectSlot = compile preprocessFileLineNumbers "ui_selectSlot.sqf"; // ui_selectSlot not important seeing it doesnt even calls the test hints below. 
gear_ui_offMenu = {
       private["_control","_parent","_menu"];
       disableSerialization;
       _control =  _this select 0;
       _parent =   findDisplay 106;
       if (!(_this select 3)) then {
           for "_i" from 0 to 9 do {
               _menu = _parent displayCtrl (1600 + _i);
               _menu ctrlShow false;
           };
           _grpPos = ctrlPosition _control;
           _grpPos set [3,0];
           _control ctrlSetPosition _grpPos;
           _control ctrlShow false;
           _control ctrlCommit 0;
       };
   }; 

   gear_ui_init = {
       private["_control","_parent","_menu","_dspl","_grpPos"];
       disableSerialization;
       _parent = findDisplay 106;
       _control =  _parent displayCtrl 6902;
       for "_i" from 0 to 9 do {
           _menu = _parent displayCtrl (1600 + _i);
           _menu ctrlShow false;
       };
       _grpPos = ctrlPosition _control;
       _grpPos set [3,0];
       _control ctrlSetPosition _grpPos;
       _control ctrlShow false;
       _control ctrlCommit 0;
   };

config.cpp (separate addon)

#include "gear.hpp"

gear.hpp (separate addon)

I dont know about the parents but i checked most of these classes from dayz_code.pbo\rscTitles.hpp and they are present in A3\Addons\ui_f\config.bin

Question is: Can it be overridden and/or does A3 supports them?

dont mind the \ca\ui\data\ its just me being lazy. My goal right now is to have a hint being displayed when you click a item.

Kidzone_kid also mentions somewhere on his blog that you cant have duplicate names for rsc classes? true/false?

also the actual file (rscTitles.hpp) has a bunch of diffrent stuff mixed. (most of it are duplicate classes normally found in ui_f\config.bin, anyone know why?)

I tried to just jank the classes that are more likely to port over to a3

class RscPicture;
class RscButton;
class CA_IGUI_Title;
class RscText;
class RscControlsGroup;
class RscLineBreak;
class RscIGUIShortcutButton;
class RscGearShortcutButton;
class RscIGUIListNBox;
class RscActiveText;

class RscPictureKeepAspect;
class RscStandardDisplay;
class RscProgress;
class RscProgressNotFreeze;
class RscButtonTextOnly;

class RscButtonActionMenu: RscButton
{
   SizeEx = 0.02674;
   colorBackground[] = {0.44,0.7,0.44,1};
   colorBackgroundActive[] = {0.24,0.5,0.24,1};
   colorBackgroundDisabled[] = {1,1,1,0};
   colorFocused[] = {0.2,0.5,0.2,1};
   colorShadow[] = {1,1,1,0};
   borderSize = 0;
   w = 0.095 * safezoneW;
   h = 0.025 * safezoneH;
};
class RscDisplayGear
{
   idd = 106;
   enableDisplay = 1;
   //onUnload = "";
   onLoad = "hint 'Gear Called'; call gear_ui_init; if (isNil('IGUI_GEAR_activeFilter')) then { IGUI_GEAR_activeFilter = 0;}; private ['_dummy']; _dummy = [_this,'initDialog'] call compile preprocessFile '\A3\ui_f\scripts\handleGear.sqf'; _dummy = [_this,'onLoad'] execVM   '\A3\ui_f\scripts\handleGear.sqf'; _dummy;";
           class ControlsBackground
           {
               class Mainback: RscPicture
               {
                   idc = 1005;
                   x = 0.04;
                   y = 0.01;
                   w = 1.2549;
                   h = 1.6732;
                   moving = 1;
                   text = "\ca\ui\data\igui_background_gear_ca.paa";
               };
           };
           class controls
           {
               class G_Interaction: RscControlsGroup
               {
                   idc = 6902;
                   x = 0.502;
                   y = 0.250 * safezoneH;
                   w = 0.145 * safezoneW;
                   h = 0; //0.250 * safezoneH;
                   onMouseMoving = "hint 'test'; _this call gear_ui_offMenu;";
                   class VScrollbar
                   {
                       autoScrollSpeed = -1;
                       autoScrollDelay = 5;
                       autoScrollRewind = 0;
                       color[] = {1,1,1,0};
                       width = 0.001;
                   };
                   class HScrollbar
                   {
                       color[] = {1,1,1,0};
                       height = 0.001;
                   };
                   class Controls
                   {
                       class RscButton_1600: RscButtonActionMenu
                       {
                           idc = 1600;
                           text = "";
                           x = 0;
                           y = 0 * safezoneH;
                       };
                       class RscButton_1601: RscButtonActionMenu
                       {
                           idc = 1601;
                           text = "";
                           x = 0;
                           y = 0.025 * safezoneH;
                       };
                       class RscButton_1602: RscButtonActionMenu
                       {
                           idc = 1602;
                           text = "";
                           x = 0;
                           y = 0.05 * safezoneH;
                       };
                       class RscButton_1603: RscButtonActionMenu
                       {
                           idc = 1603;
                           text = "";
                           x = 0;
                           y = 0.075 * safezoneH;
                       };
                       class RscButton_1604: RscButtonActionMenu
                       {
                           idc = 1604;
                           text = "";
                           x = 0;
                           y = 0.1 * safezoneH;
                       };
                       class RscButton_1605: RscButtonActionMenu
                       {
                           idc = 1605;
                           text = "";
                           x = 0;
                           y = 0.125 * safezoneH;
                       };
                       class RscButton_1606: RscButtonActionMenu
                       {
                           idc = 1606;
                           text = "";
                           x = 0;
                           y = 0.15 * safezoneH;
                       };
                       class RscButton_1607: RscButtonActionMenu
                       {
                           idc = 1607;
                           text = "";
                           x = 0;
                           y = 0.175 * safezoneH;
                       };
                       class RscButton_1608: RscButtonActionMenu
                       {
                           idc = 1608;
                           text = "";
                           x = 0;
                           y = 0.2 * safezoneH;
                       };
                       class RscButton_1609: RscButtonActionMenu
                       {
                           idc = 1609;
                           text = "";
                           x = 0;
                           y = 0.225 * safezoneH;
                       };
                   };
               };
               class G_GearItems: RscControlsGroup
               {
           idc = 160;
           x = 0.502;
           y = 0.09;
           w = 0.463;
           h = 0.776;
           class VScrollbar
           {
               autoScrollSpeed = -1;
               autoScrollDelay = 5;
               autoScrollRewind = 0;
               color[] = {1,1,1,0};
               width = 0.001;
           };
           class HScrollbar
           {
               color[] = {1,1,1,0};
               height = 0.001;
           };
                   class Controls 
                   {

                       class CA_Gear_slot_primary: RscActiveText
                       {
                           idc = 107;
                           x = "0.502 - 0.502";
                           y = "0.244 - 0.09";
                           w = 0.286;
                           h = 0.15;
                           style = "0x30 + 0x800";
                           onMouseButtonDown = "hint 'test'; _this call player_selectSlot;";
                           soundDoubleClick[] = {"",0.1,1};
                           color[] = {1,1,1,1};
                           colorBackground[] = {1,1,1,1.0};
                           colorBackgroundSelected[] = {1,1,1,1.0};
                           colorFocused[] = {0.0,0.0,0.0,0};
                           canDrag = 1;
                       };
               class CA_Gear_slot_secondary: CA_Gear_slot_primary
               {
                   idc = 108;
                   y = "0.398 -0.09";
               };
               class CA_Gear_slot_item1: CA_Gear_slot_primary
               {
                   idc = 109;
                   x = "0.790 - 0.502";
                   y = "0.244 - 0.09";
                   w = 0.055;
                   h = 0.074;
               };
               class CA_Gear_slot_item2: CA_Gear_slot_item1
               {
                   idc = 110;
                   x = "0.847 - 0.502";
                   y = "0.244 - 0.09";
               };
               class CA_Gear_slot_item3: CA_Gear_slot_item1
               {
                   idc = 111;
                   x = "0.904366 - 0.502";
                   y = "0.244 - 0.09";
               };
               class CA_Gear_slot_item4: CA_Gear_slot_item1
               {
                   idc = 112;
                   x = "0.790 - 0.502";
                   y = "0.321 - 0.09";
               };
               class CA_Gear_slot_item5: CA_Gear_slot_item1
               {
                   idc = 113;
                   x = "0.847 - 0.502";
                   y = "0.321 - 0.09";
               };
               class CA_Gear_slot_item6: CA_Gear_slot_item1
               {
                   idc = 114;
                   x = "0.904366 - 0.502";
                   y = "0.321 - 0.09";
               };
               class CA_Gear_slot_item7: CA_Gear_slot_item1
               {
                   idc = 115;
                   x = "0.790 - 0.502";
                   y = "0.398 - 0.09";
               };
               class CA_Gear_slot_item8: CA_Gear_slot_item7
               {
                   idc = 116;
                   x = "0.847 - 0.502";
                   y = "0.398 - 0.09";
               };
               class CA_Gear_slot_item9: CA_Gear_slot_item7
               {
                   idc = 117;
                   x = "0.904366 - 0.502";
                   y = "0.398 - 0.09";
               };
               class CA_Gear_slot_item10: CA_Gear_slot_item7
               {
                   idc = 118;
                   x = "0.790 - 0.502";
                   y = "0.474 - 0.09";
               };
               class CA_Gear_slot_item11: CA_Gear_slot_item7
               {
                   idc = 119;
                   x = "0.847 - 0.502";
                   y = "0.474 - 0.09";
               };
               class CA_Gear_slot_item12: CA_Gear_slot_item7
               {
                   idc = 120;
                   x = "0.904366 - 0.502";
                   y = "0.474 - 0.09";
               };
               class CA_Gear_slot_handgun: CA_Gear_slot_primary
               {
                   idc = 121;
                   x = "0.560 - 0.502";
                   y = "0.551 - 0.09";
                   w = 0.113;
                   h = 0.15;
               };
               class CA_Gear_slot_handgun_item1: CA_Gear_slot_item1
               {
                   idc = 122;
                   x = "0.674 - 0.502";
                   y = "0.551 - 0.09";
                   w = 0.055;
                   h = 0.074;
               };
               class CA_Gear_slot_handgun_item2: CA_Gear_slot_handgun_item1
               {
                   idc = 123;
                   x = "0.733 - 0.502";
                   y = "0.551 - 0.09";
               };
               class CA_Gear_slot_handgun_item3: CA_Gear_slot_handgun_item1
               {
                   idc = 124;
                   x = "0.790 - 0.502";
               };
               class CA_Gear_slot_handgun_item4: CA_Gear_slot_handgun_item1
               {
                   idc = 125;
                   x = "0.847 - 0.502";
               };
               class CA_Gear_slot_handgun_item5: CA_Gear_slot_handgun_item1
               {
                   idc = 126;
                   x = "0.674 - 0.502";
                   y = "0.628 - 0.09";
               };
               class CA_Gear_slot_handgun_item6: CA_Gear_slot_handgun_item5
               {
                   idc = 127;
                   x = "0.733 - 0.502";
                   y = "0.628 - 0.09";
               };
               class CA_Gear_slot_handgun_item7: CA_Gear_slot_handgun_item5
               {
                   idc = 128;
                   x = "0.790 - 0.502";
                   y = "0.628 - 0.09";
               };
               class CA_Gear_slot_handgun_item8: CA_Gear_slot_handgun_item5
               {
                   idc = 129;
                   x = "0.847 - 0.502";
                   y = "0.628 - 0.09";
               };
               class CA_Gear_slot_special1: CA_Gear_slot_item1
               {
                   idc = 130;
                   x = "0.502 - 0.502";
                   y = "0.09 - 0.09";
                   w = 0.113;
                   h = 0.15;
               };
               class CA_Gear_slot_special2: CA_Gear_slot_special1
               {
                   idc = 131;
                   x = "0.847 - 0.502";
                   y = "0.09 - 0.09";
                   w = 0.113;
                   h = 0.15;
               };
               class CA_Gear_slot_inventory1: CA_Gear_slot_special1
               {
                   idc = 134;
                   x = "0.560 - 0.502";
                   y = "0.705 - 0.09";
                   w = 0.055;
                   h = 0.074;
               };
               class CA_Gear_slot_inventory2: CA_Gear_slot_inventory1
               {
                   idc = 135;
                   x = "0.617 - 0.502";
                   y = "0.705 - 0.09";
               };
               class CA_Gear_slot_inventory3: CA_Gear_slot_inventory1
               {
                   idc = 136;
                   x = "0.674 - 0.502";
                   y = "0.705 - 0.09";
               };
               class CA_Gear_slot_inventory4: CA_Gear_slot_inventory1
               {
                   idc = 137;
                   x = "0.733 - 0.502";
                   y = "0.705 - 0.09";
               };
               class CA_Gear_slot_inventory5: CA_Gear_slot_inventory1
               {
                   idc = 138;
                   x = "0.790 - 0.502";
                   y = "0.705 - 0.09";
               };
               class CA_Gear_slot_inventory6: CA_Gear_slot_inventory1
               {
                   idc = 139;
                   x = "0.847 - 0.502";
                   y = "0.705 - 0.09";
               };
               class CA_Gear_slot_inventory7: CA_Gear_slot_inventory1
               {
                   idc = 140;
                   x = "0.560 - 0.502";
                   y = "0.782 - 0.09";
               };
               class CA_Gear_slot_inventory8: CA_Gear_slot_inventory7
               {
                   idc = 141;
                   x = "0.617 - 0.502";
                   y = "0.782 - 0.09";
               };
               class CA_Gear_slot_inventory9: CA_Gear_slot_inventory7
               {
                   idc = 142;
                   x = "0.674 - 0.502";
                   y = "0.782 - 0.09";
               };
               class CA_Gear_slot_inventory10: CA_Gear_slot_inventory7
               {
                   idc = 143;
                   x = "0.733 - 0.502";
                   y = "0.782 - 0.09";
               };
               class CA_Gear_slot_inventory11: CA_Gear_slot_inventory7
               {
                   idc = 144;
                   x = "0.790 - 0.502";
                   y = "0.782 - 0.09";
               };
               class CA_Gear_slot_inventory12: CA_Gear_slot_inventory7
               {
                   idc = 145;
                   x = "0.847 - 0.502";
                   y = "0.782 - 0.09";
               };
               class CA_Gear_slot_inventory13: CA_Gear_slot_inventory7
               {
                   idc = 1122;
                   x = 10.1;
                   y = 10.1;
               };
                   };
               };
       }; 
   };

Edited by defk0n_NL

Share this post


Link to post
Share on other sites

Feel like i should update this with a news.

Nice little nugget made by kidzone kid

[] spawn {
disableSerialization;
_gearDisplay = displayNull;
waitUntil {
	_gearDisplay = findDisplay 602;
	!isNull _gearDisplay;
};
for "_i" from 2 to 6554 do {
	_gearCtrl = _gearDisplay displayCtrl _i;
	if (!isNull _gearCtrl) then {
		_gearCtrl ctrlAddEventHandler [
			"ButtonClick",
			"hint str _this"
		];
	};
};
};

execute it ingame. then go to inventory and click on all the equipslots (vest/uniform/gps/etc)

So my question is now a bit more clear.

Where does one find the displays for the actual items ?

Edited by defk0n_NL

Share this post


Link to post
Share on other sites

are you asking where the defines are for all the displays?

if so.. I think its \ui_f\a3\ui_f\hpp\defineResincl.inc

Share this post


Link to post
Share on other sites
are you asking where the defines are for all the displays?

if so.. I think its \ui_f\a3\ui_f\hpp\defineResincl.inc

yes but what about the actual items. I have been looking through it. Have not been able to manipulate those ID's surrounding the container.

When say, you click the magazine. It turns white. What IDC's controls that item?

Share this post


Link to post
Share on other sites

tbh I havent done much with dialogs yet so cant really help there. there does seem to be a few related commands like ctrlSetFocus, ctrlActivate, User_Interface_Event_Handlers <-- see onLBSelChanged. I havent read through the scripts in the UI section but there is a FocusGear.sqf and a Handlegear.sqf that look like it will have what your looking for. Im guessing that there is a listbox somehow attached to each[uniform,vest,backpack] and its the listbox you want to manupulate based on what control is selected.?! sorry I can't help more.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×