Sign in to follow this  
graylyn

Change Server Rules Button?

17 posts in this topic

I would like to change the default vanilla XM8's Server Rules button to something else.

There is not much assistance I can find on here, but I made an app called rules, and the Server Rules button tells my players to check there.

I would like to rename it Server Information if possible.

Share this post


Link to post
Share on other sites

Just create an overwrite for ExileClient_gui_xm8_slide_apps_onOpen and paste in a button ontop of the existing server rules button. You'll need to make or find a .paa image for your new button and assign the directory to the button. So in step by step we will add the overwrite to CfgExileCustomCode

//XM8 Home Screen
ExileClient_gui_xm8_slide_apps_onOpen = "overwrites\ExileClient_gui_xm8_slide_apps_onOpen.sqf";

and then we will edit ExileClient_gui_xm8_slide_apps_onOpen and add in our new button over top the existing button.

Spoiler

/**
 * ExileClient_gui_xm8_slide_apps_onOpen
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_display", "_killDeathRatio", "_killDeathRatioControl", "_popTabsValue", "_popTabs", "_respectValue", "_respect", "_serverInfo", "_serverControl"];
disableSerialization;
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
if (ExileClientPlayerDeaths < 1) then 
{
    _killDeathRatio = ExileClientPlayerKills;
}
else 
{
    _killDeathRatio = [ExileClientPlayerKills / ExileClientPlayerDeaths, 2] call ExileClient_util_math_round;
};
_killDeathRatioControl = _display displayCtrl 4057;
_killDeathRatioControl ctrlSetTooltip format ["%1 Kills / %2 Deaths", ExileClientPlayerKills, ExileClientPlayerDeaths];
_killDeathRatioControl ctrlSetStructuredText parseText (format ["<t color='#00b2cd' font='OrbitronLight' size='1.6' valign='middle' align='center' shadow='0'><br/><br/><br/><t font='OrbitronMedium' size='3.5' color='#ffffff'>%1</t><br/>K/D</t>", _killDeathRatio]);
_popTabsValue = (player getVariable ["ExileLocker", 0]);
if (_popTabsValue > 999) then
{
    _popTabsValue = format ["%1k", floor (_popTabsValue / 1000)];
};
_popTabs = _display displayCtrl 4058;
_popTabs ctrlSetTooltip format["You have %1 Pop Tabs in your locker", (player getVariable ["ExileLocker", 0])];
_popTabs ctrlSetStructuredText parseText (format ["<t color='#00b2cd' font='OrbitronLight' size='1.6' valign='middle' align='center' shadow='0'><br/><br/><br/><t font='OrbitronMedium' size='3.5' color='#ffffff'>%1</t><br/>POP TABS</t>", _popTabsValue]);
_respectValue = ExileClientPlayerScore;
if (_respectValue > 999) then
{
    _respectValue = format ["%1k", floor (_respectValue / 1000)];
};
_respect = _display displayCtrl 4059;
_respect ctrlSetTooltip format["%1", ExileClientPlayerScore];
_respect ctrlSetStructuredText parseText (format ["<t color='#00b2cd' font='OrbitronLight' size='1.6' valign='middle' align='center' shadow='0'><br/><br/><br/><t font='OrbitronMedium' size='3.5' color='#ffffff'>%1</t><br/>RESPECT</t>", _respectValue]);

//New Button Start
_btnOne = 1;
_AppsLogo1 = "image.paa"; //assigne an image

if(_btnOne == 1)then{
_serverInfo = _display displayCtrl 1107;
_serverInfo ctrlSetText "Server Rule";
_serverInfo ctrlSetFade 1;
_serverInfo ctrlCommit 0;

//Location of the new button
_serverIcon = _display ctrlCreate ["RscPicture", 9897, _display displayCtrl 4040];
_serverIcon ctrlSetPosition [(24.25 - 3) * (0.025), (15.5 - 2) * (0.04), 2.75 * (0.04), 2.75 * (0.04)];
_serverIcon ctrlCommit 0.01;
_serverIcon ctrlSetText _AppsLogo1;

//What is executed when clicked
_serverControl = _display ctrlCreate ["RscExileXM8AppButton1x1", 9898, _display displayCtrl 4040];
_serverControl ctrlSetPosition [(23.5 - 3) * (0.025), (15 - 2) * (0.04)];
_serverControl ctrlCommit 0.01;
_serverControl ctrlSetEventHandler ["ButtonClick", "createDialog 'RscDisplayServerInfoMenu'"];
_serverControl ctrlSetStructuredText (parseText (format ["Server Rules"]));
};

 

Edited by Beowulfv

Share this post


Link to post
Share on other sites
Advertisement
8 hours ago, Beowulfv said:

Just create an overwrite for ExileClient_gui_xm8_slide_apps_onOpen and paste in a button ontop of the existing server rules button. You'll need to make or find a .paa image for your new button and assign the directory to the button. So in step by step we will add the overwrite to CfgExileCustomCode


//XM8 Home Screen
ExileClient_gui_xm8_slide_apps_onOpen = "overwrites\ExileClient_gui_xm8_slide_apps_onOpen.sqf";

and then we will edit ExileClient_gui_xm8_slide_apps_onOpen and add in our new button over top the existing button.

  Hide contents

/**
 * ExileClient_gui_xm8_slide_apps_onOpen
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_display", "_killDeathRatio", "_killDeathRatioControl", "_popTabsValue", "_popTabs", "_respectValue", "_respect", "_serverInfo", "_serverControl"];
disableSerialization;
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
if (ExileClientPlayerDeaths < 1) then 
{
    _killDeathRatio = ExileClientPlayerKills;
}
else 
{
    _killDeathRatio = [ExileClientPlayerKills / ExileClientPlayerDeaths, 2] call ExileClient_util_math_round;
};
_killDeathRatioControl = _display displayCtrl 4057;
_killDeathRatioControl ctrlSetTooltip format ["%1 Kills / %2 Deaths", ExileClientPlayerKills, ExileClientPlayerDeaths];
_killDeathRatioControl ctrlSetStructuredText parseText (format ["<t color='#00b2cd' font='OrbitronLight' size='1.6' valign='middle' align='center' shadow='0'><br/><br/><br/><t font='OrbitronMedium' size='3.5' color='#ffffff'>%1</t><br/>K/D</t>", _killDeathRatio]);
_popTabsValue = (player getVariable ["ExileLocker", 0]);
if (_popTabsValue > 999) then
{
    _popTabsValue = format ["%1k", floor (_popTabsValue / 1000)];
};
_popTabs = _display displayCtrl 4058;
_popTabs ctrlSetTooltip format["You have %1 Pop Tabs in your locker", (player getVariable ["ExileLocker", 0])];
_popTabs ctrlSetStructuredText parseText (format ["<t color='#00b2cd' font='OrbitronLight' size='1.6' valign='middle' align='center' shadow='0'><br/><br/><br/><t font='OrbitronMedium' size='3.5' color='#ffffff'>%1</t><br/>POP TABS</t>", _popTabsValue]);
_respectValue = ExileClientPlayerScore;
if (_respectValue > 999) then
{
    _respectValue = format ["%1k", floor (_respectValue / 1000)];
};
_respect = _display displayCtrl 4059;
_respect ctrlSetTooltip format["%1", ExileClientPlayerScore];
_respect ctrlSetStructuredText parseText (format ["<t color='#00b2cd' font='OrbitronLight' size='1.6' valign='middle' align='center' shadow='0'><br/><br/><br/><t font='OrbitronMedium' size='3.5' color='#ffffff'>%1</t><br/>RESPECT</t>", _respectValue]);

//New Button Start
_btnOne = 1;
_AppsLogo1 = "image.paa"; //assigne an image

if(_btnOne == 1)then{
_serverInfo = _display displayCtrl 1107;
_serverInfo ctrlSetText "Server Rule";
_serverInfo ctrlSetFade 1;
_serverInfo ctrlCommit 0;

//Location of the new button
_serverIcon = _display ctrlCreate ["RscPicture", 9897, _display displayCtrl 4040];
_serverIcon ctrlSetPosition [(24.25 - 3) * (0.025), (15.5 - 2) * (0.04), 2.75 * (0.04), 2.75 * (0.04)];
_serverIcon ctrlCommit 0.01;
_serverIcon ctrlSetText _AppsLogo1;

//What is executed when clicked
_serverControl = _display ctrlCreate ["RscExileXM8AppButton1x1", 9898, _display displayCtrl 4040];
_serverControl ctrlSetPosition [(23.5 - 3) * (0.025), (15 - 2) * (0.04)];
_serverControl ctrlCommit 0.01;
_serverControl ctrlSetEventHandler ["ButtonClick", "createDialog 'RscDisplayServerInfoMenu'"];
_serverControl ctrlSetStructuredText (parseText (format ["Server Rules"]));
}; 

 

I ended up doing this, and the button is not being overwritten.

Custom code is there as well.

Edit:

10:43:46 Could not load 'Custom\XM8HomeOverwrite\ExileClient_gui_xm8_slide_apps_onOpen.sqf '. Extension not listed in allowedPreprocessFileExtensions
10:43:46 "ERROR: Override of ExileClient_gui_xm8_slide_apps_onOpen in CfgExileCustomCode points to a non-existent file: Custom\XM8HomeOverwrite\ExileClient_gui_xm8_slide_apps_onOpen.sqf . Defaulting to vanilla Exile code!"

 

Edited by graylyn

Share this post


Link to post
Share on other sites
20 minutes ago, Beowulfv said:

Means your directory is wrong.

I moved it to the main directory and loaded it from there JIC and it wouldnt load it eiter.

Share this post


Link to post
Share on other sites

Same as before

but just
ExileClient_gui_xm8_slide_apps_onOpen.sqf '. Extension not listed in allowedPreprocessFileExtensions
ExileClient_gui_xm8_slide_apps_onOpen.sqf . Defaulting to vanilla Exile code!"

Share this post


Link to post
Share on other sites
25 minutes ago, Beowulfv said:

show me your custom code config

66iFcTq.jpg

This is already included in the mission config, otherwise, none of the other stuff would work. its JUST the xm8

Edited by graylyn

Share this post


Link to post
Share on other sites
Advertisement

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.