Jump to content

[RELEASE] Custom GUI / Menu


theduke

Recommended Posts

If I want to remove a box I do so by removing it in the rules_init and the rules.hpp? For example


//(_finddialog displayCtrl 1103) ctrlSetText format["%1",_rule4text];

//class slk_rules4: slkRscStructuredText
//{
//	idc = 1103;
//	text = ""; //--- ToDo: Localize;
//	x = 0.226719 * safezoneW + safezoneX;
//	y = 0.6078 * safezoneH + safezoneY;
//	w = 0.546562 * safezoneW;
//	h = 0.066 * safezoneH;
//};

?

Link to comment
Share on other sites

12 hours ago, DangerRuss said:

If I want to remove a box I do so by removing it in the rules_init and the rules.hpp? For example



//(_finddialog displayCtrl 1103) ctrlSetText format["%1",_rule4text];


//class slk_rules4: slkRscStructuredText
//{
//	idc = 1103;
//	text = ""; //--- ToDo: Localize;
//	x = 0.226719 * safezoneW + safezoneX;
//	y = 0.6078 * safezoneH + safezoneY;
//	w = 0.546562 * safezoneW;
//	h = 0.066 * safezoneH;
//};

?

for hpp Russ

Do

 

/*class slk_rules4: slkRscStructuredText
{
idc = 1103;
text = ""; //--- ToDo: Localize;
x = 0.226719 * safezoneW + safezoneX;
y = 0.6078 * safezoneH + safezoneY;
w = 0.546562 * safezoneW;
h = 0.066 * safezoneH;
};*/

Link to comment
Share on other sites

On 5/3/2016 at 5:34 PM, dztancem8 said:

For some reason my donation box wont work, I dont know what ive done wrong >_<

The menu works 100%

I click on the new button I added and the next dialogue opened is blank. Please add me on steam or PM me for help?

make sure you added the new HPP in the description.ext

Link to comment
Share on other sites

Hello at all,

 

nice Release but for me don´t work...

here r my settings:

 

description.ext:

 

Spoiler

#include "ZSC\config\cfgServerTrader.hpp"

respawn = "BASE";
respawndelay = 5;
onLoadMission= "DayZ Epoch Chernarus";
OnLoadIntro = "Welcome to DayZ Epoch Chernarus";
OnLoadIntroTime = False;
OnLoadMissionTime = False;
disabledAI = true;
disableChannels[]={0,2,6};
enableItemsDropping = 0;

briefing = 0;
debriefing = 0;

onPauseScript = "";
loadScreen = "\z\addons\dayz_code\gui\dayz_logo_ca.paa";

class Header
{
 gameType = COOP;            //DM, Team, Coop, ...
 minPlayers = 1;             //min # of players the mission supports
 maxPlayers = 100;            //Max # of players the mission supports
};

aiKills = 1;
diagRadio = 1;
diagHit = 1;

class RscText
{
    type = 0;
    idc = -1;
    x = 0;
    y = 0;
    h = 0.037;
    w = 0.3;
    style = 0x100; 
    font = Zeppelin32;
    SizeEx = 0.03921;
    colorText[] = {1,1,1,1};
    colorBackground[] = {0, 0, 0, 0};
    linespacing = 1;
};
class RscPicture
{
    access=0;
    type=0;
    idc=-1;
    style=48;
    colorBackground[]={0,0,0,0};
    colorText[]={1,1,1,1};
    font="TahomaB";
    sizeEx=0;
    lineSpacing=0;
    text="";
};
class RscLoadingText : RscText
{
    style = 2;
    x = 0.323532;
    y = 0.666672;
    w = 0.352944;
    h = 0.039216;
    sizeEx = 0.03921;
    colorText[] = {0.543,0.5742,0.4102,1.0};
};
class RscProgress
{
    x = 0.344;
    y = 0.619;
    w = 0.313726;
    h = 0.0261438;
    texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
    colorFrame[] = {0,0,0,0};
    colorBar[] = {1,1,1,1};
};
class RscProgressNotFreeze
{
    idc = -1;
    type = 45;
    style = 0;
    x = 0.022059;
    y = 0.911772;
    w = 0.029412;
    h = 0.039216;
    texture = "#(argb,8,8,3)color(0,0,0,0)";
};
//
// the loading screen itself
//

class CfgSounds
    {
        sounds[] =
        {
            Radio_Message_Sound
        };
        class Radio_Message_Sound
        {
            name = "Radio_Message_Sound";
            sound[] = {custom\remote\radio.ogg,0.4,1};
            titles[] = {};
        };
    };
    
class DayZ_loadingScreen

    idd = -1;
    duration = 10e10;
    fadein = 0;
    fadeout = 0;
    name = "loading screen";
    class controlsBackground
    {
        class blackBG : RscText
        {
            x = safezoneX;
            y = safezoneY;
            w = safezoneW;
            h = safezoneH;
            text = "";
            colorText[] = {0,0,0,0};
            colorBackground[] = {0,0,0,1};
        };
        /*
        class nicePic : RscPicture
        {
            style = 48 + 0x800; // ST_PICTURE + ST_KEEP_ASPECT_RATIO
            x = safezoneX + safezoneW/2 - 0.25;
            y = safezoneY + safezoneH/2 - 0.2;
            w = 0.5;
            h = 0.4;
            text = "img\nicePic.paa";
        };
        */
    };
    class controls
    {
        class Title1 : RscLoadingText
        {
            text = "$STR_LOADING"; // "Loading" text in the middle of the screen
        };
        class CA_Progress : RscProgress // progress bar, has to have idc 104
        {
            idc = 104;
            type = 8; // CT_PROGRESS
            style = 0; // ST_SINGLE
            texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
        };
        class CA_Progress2 : RscProgressNotFreeze // progress bar that will go reverse
        {
            idc = 103;
        };
        class Name2: RscText // the text on the top-left
        {
            idc = 101;
            x = 0.05;
            y = 0.029412;
            w = 0.9;
            h = 0.04902;
            text = "";
            sizeEx = 0.05;
            colorText[] = {0.543,0.5742,0.4102,1.0};
        };
    };
};

class RscTitles
{
#include "ZSC\config\ZSChud.hpp"
#include "wm_disp.hpp"
};
#include "ZSC\config\ZSCdefines.hpp"
#include "ZSC\config\ZSCdialogs.hpp"
#include "zupa\advancedTrading\advancedTrading.hpp"
#include "spawn\class.hpp"
#include "spawn\halo.hpp"
#include "spawn\spawn.hpp"
#include "custom\menu\defines.hpp"
#include "custom\menu\menu.hpp"
#include "custom\menu\rules.hpp"
#include "custom\menu\rules2.hpp"

dayz_spaceInterrupt.sqf:

 

Spoiler

private ["_dikCode","_handled","_primaryWeapon","_secondaryWeapon","_nearbyObjects","_nill","_shift","_ctrl","_alt","_dropPrimary","_dropSecondary","_iItem","_removed","_iPos","_radius","_item"];
_dikCode =     _this select 1;

_handled = false;

if (_dikCode in[0x02,0x03,0x04,0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D,0x3C,0x3B,0x0B,0x0A,0x09,0x08,0x07,0x06,0x05]) then {
    _handled = true;
};

if ((_dikCode == 0x3E || _dikCode == 0x0F || _dikCode == 0xD3)) then {
    if(diag_tickTime - dayz_lastCheckBit > 10) then {
        dayz_lastCheckBit = diag_tickTime;
        call dayz_forceSave;
    };
    call dayz_EjectPlayer;
};

// esc
if (_dikCode == 0x01) then {
    DZE_cancelBuilding = true;
    call dayz_EjectPlayer;
};
// Disable ESC after death
if (_dikCode == 0x01 && r_player_dead) then {
    _handled = true;
};

// surrender 
if (_dikCode in actionKeys "Surrender") then {
    
    _vehicle = vehicle player;
    _inVehicle = (_vehicle != player);
    _onLadder =    (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
    _canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder && !_inVehicle);
    
    if (_canDo && !DZE_Surrender && !(player isKindOf  "PZombie_VB")) then {
        DZE_Surrender = true;
        _dropPrimary = false;
        _dropSecondary = false;

        _primaryWeapon = primaryWeapon player;
        if (_primaryWeapon != "") then {_dropPrimary = true;};
        _secondaryWeapon = "";
        {
            if ((getNumber (configFile >> "CfgWeapons" >> _x >> "Type")) == 2) exitWith {
                    _secondaryWeapon = _x;
            };
        } count (weapons player);
        if (_secondaryWeapon != "") then {_dropSecondary = true;};

        if (_dropPrimary || _dropSecondary) then {
            player playActionNow "PutDown";
            _iPos = getPosATL player;
            _radius = 1;
            _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
            _item setposATL _iPos;
            if (_dropPrimary) then {
                _iItem = _primaryWeapon;
                _removed = ([player,_iItem,1] call BIS_fnc_invRemove);
                if (_removed == 1) then {
                    _item addWeaponCargoGlobal [_iItem,1];
                };
            };
            if (_dropSecondary) then {
                _iItem = _secondaryWeapon;
                _removed = ([player,_iItem,1] call BIS_fnc_invRemove);
                if (_removed == 1) then {
                    _item addWeaponCargoGlobal [_iItem,1];
                };
            };
            player reveal _item;
        };

        // set publicvariable that allows other player to access gear
        player setVariable ["DZE_Surrendered", true, true];
        // surrender animation
        player playMove "AmovPercMstpSsurWnonDnon";
    };
    _handled = true;
};

if (_dikCode in actionKeys "MoveForward") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};};
if (_dikCode in actionKeys "MoveLeft") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};};
if (_dikCode in actionKeys "MoveRight") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};};
if (_dikCode in actionKeys "MoveBack") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};};

//Prevent exploit of drag body
if ((_dikCode in actionKeys "Prone") && r_drag_sqf) exitWith { force_dropBody = true; };
if ((_dikCode in actionKeys "Crouch") && r_drag_sqf) exitWith { force_dropBody = true; };

_shift =     _this select 2;
_ctrl =     _this select 3;
_alt =        _this select 4;

//diag_log format["Keypress: %1", _this];
if ((_dikCode in actionKeys "Gear") && (vehicle player != player) && !_shift && !_ctrl && !_alt && !dialog) then {
            createGearDialog [player, "RscDisplayGear"];
            _handled = true;
};

if (_dikCode in (actionKeys "GetOver")) then {
    
    if (player isKindOf  "PZombie_VB") then {
        _handled = true;
        DZE_PZATTACK = true;
    } else {
        _nearbyObjects = nearestObjects[getPosATL player, dayz_disallowedVault, 8];
        if (count _nearbyObjects > 0) then {
            if((diag_tickTime - dayz_lastCheckBit > 4)) then {
                [objNull, player, rSwitchMove,"GetOver"] call RE;
                player playActionNow "GetOver";
                dayz_lastCheckBit = diag_tickTime;
            } else {
                _handled = true;
            };
        };
    };
};
//ESLK Menu
if (_dikCode == 0x0F) then {  
    
_null = execVM "custom\menu\menu_init.sqf";

};
//if (_dikCode == 57) then {_handled = true}; // space
//if (_dikCode in actionKeys 'MoveForward' || _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
if (_dikCode == 210) then {
        _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};

if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
if (_dikCode in actionKeys "PushToTalk" && (diag_tickTime - dayz_lastCheckBit > 10)) then {
    dayz_lastCheckBit = diag_tickTime;
    [player,50,true,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "VoiceOverNet" && (diag_tickTime - dayz_lastCheckBit > 10)) then {
    dayz_lastCheckBit = diag_tickTime;
    [player,50,true,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "PushToTalkDirect" && (diag_tickTime - dayz_lastCheckBit > 10)) then {
    dayz_lastCheckBit = diag_tickTime;
    [player,15,false,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "Chat" && (diag_tickTime - dayz_lastCheckBit > 10)) then {
    dayz_lastCheckBit = diag_tickTime;
    [player,15,false,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "User20" && (diag_tickTime - dayz_lastCheckBit > 5)) then {
    dayz_lastCheckBit = diag_tickTime;
    _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};

// numpad 8 0x48 now pgup 0xC9 1
if ((_dikCode == 0xC9 && (!_alt || !_ctrl)) || (_dikCode in actionKeys "User15")) then {
    DZE_Q = true;
};
// numpad 2 0x50 now pgdn 0xD1
if ((_dikCode == 0xD1 && (!_alt || !_ctrl)) || (_dikCode in actionKeys "User16")) then {
    DZE_Z = true;
};


// numpad 8 0x48 now pgup 0xC9 0.1
if ((_dikCode == 0xC9 && (_alt && !_ctrl)) || (_dikCode in actionKeys "User13")) then {
    DZE_Q_alt = true;
};
// numpad 2 0x50 now pgdn 0xD1
if ((_dikCode == 0xD1 && (_alt && !_ctrl)) || (_dikCode in actionKeys "User14")) then {
    DZE_Z_alt = true;
};


// numpad 8 0x48 now pgup 0xC9 0.01
if ((_dikCode == 0xC9 && (!_alt && _ctrl)) || (_dikCode in actionKeys "User7")) then {
    DZE_Q_ctrl = true;
};
// numpad 2 0x50 now pgdn 0xD1
if ((_dikCode == 0xD1 && (!_alt && _ctrl)) || (_dikCode in actionKeys "User8")) then {
    DZE_Z_ctrl = true;
};


// numpad 4 0x4B now Q 0x10
if (_dikCode == 0x10 || (_dikCode in actionKeys "User17")) then {
    DZE_4 = true;
};        
// numpad 6 0x4D now E 0x12
if (_dikCode == 0x12 || (_dikCode in actionKeys "User18")) then {
    DZE_6 = true;
};
// numpad 5 0x4C now space 0x39
if (_dikCode == 0x39 || (_dikCode in actionKeys "User19")) then {
    DZE_5 = true;
};

_handled
 

so...whats wrong? folder is in mission pbo...

 

Please help!

 

€dit:  I use F1 for open this...i try with TAB but both don´t work....

Edited by SeCTioN
update
Link to comment
Share on other sites

  • 5 months later...

Hey Guys,

Thanks to Duke to make a such great menu.

Iam just having a small problem which is when people want to suicide. It only happens to player and not admins. I have followed everything what the installation showed. 

Iam using infistar and iam not getting any errors.

Hope you guys can help me out. thanks anyway...

Link to comment
Share on other sites

4 hours ago, sercanatici said:

Hey Guys,

Thanks to Duke to make a such great menu.

Iam just having a small problem which is when people want to suicide. It only happens to player and not admins. I have followed everything what the installation showed. 

Iam using infistar and iam not getting any errors.

Hope you guys can help me out. thanks anyway...

Unfortunately the scripts that came with it were just examples of things you could do with the menu. You might want to look for a suicide script that better suits your needs.

Link to comment
Share on other sites

@sercanatici  try this suicide.sqf

Spoiler

private ["_Secondary","_onLadder","_player"];

_player = player;
_Secondary = currentWeapon _player;

suicide_answer=nil;

if (dayz_combat == 1) exitWith {cutText ["You are in combat", "PLAIN DOWN"];};

DamiSpawn =
[
    ["Suicide Confirmation",true],
    ["Are you sure?", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5,         [["expression", ""]], "1", "0"],
    ["No", [2], "", -5,     [["expression", "suicide_answer=false;"]], "1", "1"],
    ["Yes", [3], "", -5,     [["expression", "suicide_answer=true;"]], "1", "1"],
    ["", [-1], "", -5,         [["expression", ""]], "1", "0"],
    ["Exit", [-1], "", -3,     [["expression", "suicide_answer=false;"]], "1", "1"]
];
showCommandingMenu "#USER:DamiSpawn";

waitUntil {((!isNil 'suicide_answer')||(commandingMenu == ""))};

if (isNil 'suicide_answer') then {suicide_answer=false;};

if (suicide_answer) then {
    cutText["You have grown tired of this endless battle.","PLAIN DOWN"];
    _player playmove "ActsPercMstpSnonWpstDnon_suicide1B";
    sleep 8.4;
    _player fire _Secondary;
    _selection = "body";
    _player setHit["body",1];
};

 

another:

Spoiler

private ["_position","_done","_timeLeft","_exitWith","_warning","_display","_weapon"];

// initialize variables
_weapon   = _this;
_exitWith = "nil";
_done     = false;
_position = position player;
_timeLeft = DZE_SUICIDE_CANCEL_TIME;
_warning  = "You will commit suicide in %1 seconds. Move to cancel!";
removeAllWeapons player;
	removeAllItems player;
	removeBackpack player;
// close the gear display when player starts to commit suicide
disableSerialization;
_display = findDisplay 106;
if(!(isNull _display)) then {
    _display closeDisplay 0;
};
	

// if we didn't get an exit reason back, time to die!
if (_exitWith == "nil") then {
    _exitWith = "Goodbye!";
    taskHint[_exitWith, DZE_COLOR_SUCCESS, "taskDone"];
    hint _exitWith;
    cutText[_exitWith,"PLAIN DOWN"];
    player selectWeapon _weapon;
    player switchMove "";
    player playActionNow "stop";
    player playMove (["ActsPercMstpSnonWpstDnon_suicide1B","ActsPercMstpSnonWpstDnon_suicide2B"] call BIS_fnc_selectRandom);
    sleep 7.5;

    player fire _weapon;
    sleep 1;
    player setDamage 1.5;
} else {
    taskHint[_exitWith, DZE_COLOR_DANGER, "taskFailed"];
    cutText[_exitWith,"PLAIN DOWN"];
};

 

Link to comment
Share on other sites

8 hours ago, theduke said:

Unfortunately the scripts that came with it were just examples of things you could do with the menu. You might want to look for a suicide script that better suits your needs.

 

7 hours ago, juandayz said:

@sercanatici  try this suicide.sqf

  Reveal hidden contents

private ["_Secondary","_onLadder","_player"];

_player = player;
_Secondary = currentWeapon _player;

suicide_answer=nil;

if (dayz_combat == 1) exitWith {cutText ["You are in combat", "PLAIN DOWN"];};

DamiSpawn =
[
    ["Suicide Confirmation",true],
    ["Are you sure?", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5,         [["expression", ""]], "1", "0"],
    ["No", [2], "", -5,     [["expression", "suicide_answer=false;"]], "1", "1"],
    ["Yes", [3], "", -5,     [["expression", "suicide_answer=true;"]], "1", "1"],
    ["", [-1], "", -5,         [["expression", ""]], "1", "0"],
    ["Exit", [-1], "", -3,     [["expression", "suicide_answer=false;"]], "1", "1"]
];
showCommandingMenu "#USER:DamiSpawn";

waitUntil {((!isNil 'suicide_answer')||(commandingMenu == ""))};

if (isNil 'suicide_answer') then {suicide_answer=false;};

if (suicide_answer) then {
    cutText["You have grown tired of this endless battle.","PLAIN DOWN"];
    _player playmove "ActsPercMstpSnonWpstDnon_suicide1B";
    sleep 8.4;
    _player fire _Secondary;
    _selection = "body";
    _player setHit["body",1];
};

 

another:

  Reveal hidden contents


private ["_position","_done","_timeLeft","_exitWith","_warning","_display","_weapon"];

// initialize variables
_weapon   = _this;
_exitWith = "nil";
_done     = false;
_position = position player;
_timeLeft = DZE_SUICIDE_CANCEL_TIME;
_warning  = "You will commit suicide in %1 seconds. Move to cancel!";
removeAllWeapons player;
	removeAllItems player;
	removeBackpack player;
// close the gear display when player starts to commit suicide
disableSerialization;
_display = findDisplay 106;
if(!(isNull _display)) then {
    _display closeDisplay 0;
};
	

// if we didn't get an exit reason back, time to die!
if (_exitWith == "nil") then {
    _exitWith = "Goodbye!";
    taskHint[_exitWith, DZE_COLOR_SUCCESS, "taskDone"];
    hint _exitWith;
    cutText[_exitWith,"PLAIN DOWN"];
    player selectWeapon _weapon;
    player switchMove "";
    player playActionNow "stop";
    player playMove (["ActsPercMstpSnonWpstDnon_suicide1B","ActsPercMstpSnonWpstDnon_suicide2B"] call BIS_fnc_selectRandom);
    sleep 7.5;

    player fire _weapon;
    sleep 1;
    player setDamage 1.5;
} else {
    taskHint[_exitWith, DZE_COLOR_DANGER, "taskFailed"];
    cutText[_exitWith,"PLAIN DOWN"];
};

 

Thanks to both of you, i kinda wonder how infistar is blocking regular players scroll wheel menu.

Link to comment
Share on other sites

3 hours ago, sercanatici said:

 

Thanks to both of you, i kinda wonder how infistar is blocking regular players scroll wheel menu.

Ahh sorry. In your AHconfig, look for

_cMenu

add this

#USER:DamiSpawn

Make sure you DONT have a comma for the last one.

 

Link to comment
Share on other sites

2 hours ago, sercanatici said:

cMenu is true so i had to set it to false. Will that be a problem for the server?

there should be 2 spots with _cmenu.  One will be the true or false. Dont change that.

The other you will see a block of available menus to be whitelisted. Just add that menu to it

Link to comment
Share on other sites

Just now, theduke said:

there should be 2 spots with _cmenu.  One will be the true or false. Dont change that.

The other you will see a block of available menus to be whitelisted. Just add that menu to it

It didnt take any effect after just adding it tho. So i had to put cMenu on false

Link to comment
Share on other sites

1 minute ago, sercanatici said:

It didnt take any effect after just adding it tho. So i had to put cMenu on false

By setting it to false, if anyone with hack menus, they could possibly open some hacks. But TBH i wouldnt worry too much about it.

Link to comment
Share on other sites

  • 3 months later...

Hi all,

I have try to install this script in 1.0.6.0, work good but only one time. You press TAB and menu appear, you close it and it never appear again. I have try to add _handled = true; but dont work.

I add the dik code in keyboard.sqf wich replace dayz_spaceinterrupt.sqf.

 

Any help plz :)

Link to comment
Share on other sites

I answer to my question :)

To work with 1.0.6.0, you need to extract keyboard.sqf (no more dayz_space interrupt.sqf in 1.0.6.0) in dayz_code\compile and put it in your mission file.

Modify keyboard.sqf ass follow.

Add

	//ESLK Menu
	_informenu = {if (isNull findDisplay 7777) then {
	execVM "custom\menu\menu_init.sqf";
	};
	_handled = true;
	};

before 

    _block = {
        _handled = true;
    };

and add:

	[[DIK_TAB], _informenu] call _addArray;

At line 265 before:

    [[DIK_ESCAPE], _cancelBuild] call _addArray;

 

Enjoy :)

Link to comment
Share on other sites

6 hours ago, juandayz said:

@theduke  @Casual_Jeff  a new post in 1.6 section  about this, gonna make happy a lot of people who not know about an existent adaptation for 1,6 :biggrin:

Sure no problem. Ill make a post in there for this as soon as i get it running on my 106 server

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...