From b1523bc07287cbe67191a79f0363050989630f5c Mon Sep 17 00:00:00 2001 From: McDiod Date: Wed, 1 Feb 2017 23:59:57 +0100 Subject: [PATCH] more fixes --- cfgDialogs.hpp | 7 -- description.ext | 6 +- dialogs/RscTitles.hpp | 161 ------------------------- dialogs/baseDefines.hpp | 124 ++++++++++++------- dialogs/baseRsc.hpp | 6 +- dialogs/cfgDialogs.hpp | 16 +++ dialogs/killcam/defines.hpp | 8 ++ dialogs/killcam/title.hpp | 20 +++ dialogs/scoreboard/defines.hpp | 18 +++ dialogs/scoreboard/title.hpp | 58 +++++++++ dialogs/upgradeWeaponTitle/defines.hpp | 12 ++ dialogs/upgradeWeaponTitle/title.hpp | 43 +++++++ dialogs/votecountdown/title.hpp | 37 ++++++ functions/fn_scoreBoard.sqf | 2 +- functions/fn_showGRADScoreboard.sqf | 2 +- functions/fn_upgradeWeaponTitle.sqf | 2 +- player/killCam.sqf | 2 +- player/scoreBoard.sqf | 2 +- server/endGame.sqf | 1 + 19 files changed, 307 insertions(+), 220 deletions(-) delete mode 100644 cfgDialogs.hpp delete mode 100644 dialogs/RscTitles.hpp create mode 100644 dialogs/cfgDialogs.hpp create mode 100644 dialogs/killcam/defines.hpp create mode 100644 dialogs/killcam/title.hpp create mode 100644 dialogs/scoreboard/defines.hpp create mode 100644 dialogs/scoreboard/title.hpp create mode 100644 dialogs/upgradeWeaponTitle/defines.hpp create mode 100644 dialogs/upgradeWeaponTitle/title.hpp create mode 100644 dialogs/votecountdown/title.hpp diff --git a/cfgDialogs.hpp b/cfgDialogs.hpp deleted file mode 100644 index 0aa4823..0000000 --- a/cfgDialogs.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "dialogs\ui_toolkit.hpp" -#include "dialogs\baseDefines.hpp" -#include "dialogs\baseRsc.hpp" - -class RscTitles { - #include "dialogs\RscTitles.hpp" -}; diff --git a/description.ext b/description.ext index 4d620b2..916e3a6 100644 --- a/description.ext +++ b/description.ext @@ -1,13 +1,13 @@ #define MODULES_DIRECTORY node_modules #include "cfgParams.hpp" -#include "cfgDialogs.hpp" +#include "dialogs\cfgDialogs.hpp" -#include "node_modules\grad-scoreboard\grad_scoreboard.hpp" #include "node_modules\grad-scoreboard\grad_scoreboard.hpp" -class CfgFunctions { +class CfgFunctions { #include "functions\cfgFunctions.hpp" + #include "node_modules\grad-scoreboard\cfgFunctions.hpp" }; // HEADER ====================================================================== diff --git a/dialogs/RscTitles.hpp b/dialogs/RscTitles.hpp deleted file mode 100644 index ed05230..0000000 --- a/dialogs/RscTitles.hpp +++ /dev/null @@ -1,161 +0,0 @@ -class voteCountdownTitle -{ - idd = 1400; - duration = 99999; - - enableSimulation = 1; - enableDisplay = 1; - onLoad = "disableSerialization; _this call mcd_fnc_voteDialogText;"; - - class ControlsBackground - { - class statusMessage: mcd_RscMapText - { - moving = 1; - idc = 1401; - text = "PLAYZONE VOTING"; - x = safeZoneX + safeZoneW - 0.6 * 3/4; - y = safeZoneY + safeZoneH - 1.600; - }; - - class skipMessage: mcd_RscMapTextSmall - { - idc = 1403; - text = ""; - x = safeZoneX + safeZoneW - 0.6 * 3/4; - y = safeZoneY + safeZoneH - 1.545; - }; - - class waitMessage: mcd_RscMapTextSmall - { - idc = 1402; - text = ""; - x = safeZoneX + safeZoneW - 0.6 * 3/4; - y = safeZoneY + safeZoneH - 1.490; - }; - }; -}; - -class upgradeWeaponTitle -{ - idd = UPGRADEWEAPON_DIALOG; - duration = 99999; - - enableSimulation = 1; - enableDisplay = 1; - - onload = "disableSerialization; _this call mcd_fnc_upgradeWeaponTitle;"; - - class ControlsBackground - { - class Background: mcd_IGUIBack - { - idc = UPGRADEWEAPON_BG; - x = uw_x; - y = uw_y; - w = uw_w; - h = uw_h; - }; - - class WeaponPicture: mcd_RscPicture - { - idc = UPGRADEWEAPON_PIC; - x = uw_x + uw_paddingX; - y = uw_y; - w = uw_w - 2*uw_paddingX; - h = uw_h - uw_paddingY; - text = ""; - }; - - class WeaponText: RscText - { - idc = UPGRADEWEAPON_TEXT; - style = ST_CENTER; - x = uw_x; - y = uw_y + uw_h - uw_paddingY*1.4; - w = uw_w; - h = uw_paddingY; - - }; - }; -}; - -class KillCamTitle -{ - idd = KILLCAMTITLE_DIALOG; - enableDisplay = true; - enableSimulation = true; - duration = 8; - onLoad = "uiNamespace setVariable [""KillCamTitle_Display"", _this select 0]"; - - class ControlsBackground - { - class Title: KillCamText - { - idc = KILLCAMTITLE_TITLE; - x = kc_titleX; - y = kc_titleY; - w = kc_W; - h = kc_H; - }; - }; -}; - -class ScoreBoard -{ - idd = SCOREBOARD_DIALOG; - enableDisplay = true; - enableSimulation = true; - duration = 1e+1000; - onLoad = "uiNamespace setVariable [""ScoreBoard_Display"", _this select 0]"; - - class ControlsBackground { - class Item1: ScoreBoardItem - { - idc = SCOREBOARD_ITEM1; - y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 0); - }; - - class Score1: ScoreBoardScore - { - idc = SCOREBOARD_SCORE1; - y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 0); - }; - - class Item2: ScoreBoardItem - { - idc = SCOREBOARD_ITEM2; - y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 1); - }; - - class Score2: ScoreBoardScore - { - idc = SCOREBOARD_SCORE2; - y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 1); - }; - - class Item3: ScoreBoardItem - { - idc = SCOREBOARD_ITEM3; - y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 2); - }; - - class Score3: ScoreBoardScore - { - idc = SCOREBOARD_SCORE3; - y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 2); - }; - - class Item4: ScoreBoardItem - { - idc = SCOREBOARD_ITEM4; - y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 3); - }; - - class Score4: ScoreBoardScore - { - idc = SCOREBOARD_SCORE4; - y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 3); - }; - }; -}; diff --git a/dialogs/baseDefines.hpp b/dialogs/baseDefines.hpp index 5a8a41f..cab65ed 100644 --- a/dialogs/baseDefines.hpp +++ b/dialogs/baseDefines.hpp @@ -1,46 +1,88 @@ -//TYPES AND STYLES ============================================================= +// Control types #define CT_STATIC 0 +#define CT_BUTTON 1 +#define CT_EDIT 2 +#define CT_SLIDER 3 +#define CT_COMBO 4 +#define CT_LISTBOX 5 +#define CT_TOOLBOX 6 +#define CT_CHECKBOXES 7 +#define CT_PROGRESS 8 +#define CT_HTML 9 +#define CT_STATIC_SKEW 10 +#define CT_ACTIVETEXT 11 +#define CT_TREE 12 +#define CT_STRUCTURED_TEXT 13 +#define CT_CONTEXT_MENU 14 +#define CT_CONTROLS_GROUP 15 +#define CT_SHORTCUTBUTTON 16 +#define CT_XKEYDESC 40 +#define CT_XBUTTON 41 +#define CT_XLISTBOX 42 +#define CT_XSLIDER 43 +#define CT_XCOMBO 44 +#define CT_ANIMATED_TEXTURE 45 +#define CT_OBJECT 80 +#define CT_OBJECT_ZOOM 81 +#define CT_OBJECT_CONTAINER 82 +#define CT_OBJECT_CONT_ANIM 83 +#define CT_LINEBREAK 98 +#define CT_USER 99 +#define CT_MAP 100 +#define CT_MAP_MAIN 101 +#define CT_LISTNBOX 102 +// Static styles +#define ST_POS 0x0F +#define ST_HPOS 0x03 +#define ST_VPOS 0x0C #define ST_LEFT 0x00 +#define ST_RIGHT 0x01 #define ST_CENTER 0x02 +#define ST_DOWN 0x04 +#define ST_UP 0x08 +#define ST_VCENTER 0x0C -//KILLCAM ====================================================================== -#define KILLCAMTITLE_DIALOG 5000 -#define KILLCAMTITLE_TITLE 5001 - -#define kc_W (1 * X_SCALE) -#define kc_H (0.1 * Y_SCALE) -#define kc_titleX CENTER(1, kc_W) -#define kc_titleY (0.65 * Y_SCALE) - -//UPGRADE WEAPON =============================================================== -#define UPGRADEWEAPON_DIALOG 6000 -#define UPGRADEWEAPON_BG 6001 -#define UPGRADEWEAPON_PIC 6002 -#define UPGRADEWEAPON_TEXT 6003 - -#define uw_x (SZ_RIGHT - 0.442) -#define uw_y (SZ_TOP + 0.33) -#define uw_w (0.30 * X_SCALE) -#define uw_h (uw_w * 0.75) -#define uw_paddingX (uw_w * 0.1) -#define uw_paddingY (uw_h * 0.1) - -//SCOREBOARD =================================================================== -#define SCOREBOARD_DIALOG 7000 -#define SCOREBOARD_ITEM1 7001 -#define SCOREBOARD_ITEM2 7002 -#define SCOREBOARD_ITEM3 7003 -#define SCOREBOARD_ITEM4 7004 -#define SCOREBOARD_SCORE1 7011 -#define SCOREBOARD_SCORE2 7012 -#define SCOREBOARD_SCORE3 7013 -#define SCOREBOARD_SCORE4 7014 - -#define sb_itemW (0.25 * X_SCALE) -#define sb_itemH (0.025 * Y_SCALE) -#define sb_scoreW (sb_itemH * 0.75) -#define sb_totalX (SZ_RIGHT - 0.25) -#define sb_totalY (0.135 * Y_SCALE) -#define sb_itemSpacingX (0.03 * sb_itemH * X_SCALE) -#define sb_itemSpacingY (0.03 * sb_itemH * Y_SCALE) +#define ST_TYPE 0xF0 +#define ST_SINGLE 0x00 +#define ST_MULTI 0x10 +#define ST_TITLE_BAR 0x20 +#define ST_PICTURE 0x30 +#define ST_FRAME 0x40 +#define ST_BACKGROUND 0x50 +#define ST_GROUP_BOX 0x60 +#define ST_GROUP_BOX2 0x70 +#define ST_HUD_BACKGROUND 0x80 +#define ST_TILE_PICTURE 0x90 +#define ST_WITH_RECT 0xA0 +#define ST_LINE 0xB0 + +#define ST_SHADOW 0x100 +#define ST_NO_RECT 0x200 +#define ST_KEEP_ASPECT_RATIO 0x800 + +#define ST_TITLE ST_TITLE_BAR + ST_CENTER + +// Slider styles +#define SL_DIR 0x400 +#define SL_VERT 0 +#define SL_HORZ 0x400 + +#define SL_TEXTURES 0x10 + +// progress bar +#define ST_VERTICAL 0x01 +#define ST_HORIZONTAL 0 + +// Listbox styles +#define LB_TEXTURES 0x10 +#define LB_MULTI 0x20 + +// Tree styles +#define TR_SHOWROOT 1 +#define TR_AUTOCOLLAPSE 2 + +// MessageBox styles +#define MB_BUTTON_OK 1 +#define MB_BUTTON_CANCEL 2 +#define MB_BUTTON_USER 4 diff --git a/dialogs/baseRsc.hpp b/dialogs/baseRsc.hpp index 19cb948..82841a6 100644 --- a/dialogs/baseRsc.hpp +++ b/dialogs/baseRsc.hpp @@ -21,7 +21,7 @@ class mcd_IGUIBack }; }; -class RscText +class mcd_RscText { access = 0; type = 0; @@ -42,7 +42,7 @@ class RscText linespacing = 1; }; -class mcd_RscMapText: RscText +class mcd_RscMapText: mcd_RscText { idc = -1; type = CT_STATIC; @@ -56,7 +56,7 @@ class mcd_RscMapText: RscText duration = 1e+1000; }; -class mcd_RscMapTextSmall: RscText +class mcd_RscMapTextSmall: mcd_RscText { idc = -1; type = CT_STATIC; diff --git a/dialogs/cfgDialogs.hpp b/dialogs/cfgDialogs.hpp new file mode 100644 index 0000000..79df51b --- /dev/null +++ b/dialogs/cfgDialogs.hpp @@ -0,0 +1,16 @@ +#include "ui_toolkit.hpp" +#include "baseDefines.hpp" +#include "baseRsc.hpp" + +class RscTitles { + #include "killcam\defines.hpp" + #include "killcam\title.hpp" + + #include "scoreboard\defines.hpp" + #include "scoreboard\title.hpp" + + #include "upgradeWeaponTitle\defines.hpp" + #include "upgradeWeaponTitle\title.hpp" + + #include "votecountdown\title.hpp" +}; diff --git a/dialogs/killcam/defines.hpp b/dialogs/killcam/defines.hpp new file mode 100644 index 0000000..9973cde --- /dev/null +++ b/dialogs/killcam/defines.hpp @@ -0,0 +1,8 @@ +//KILLCAM ====================================================================== +#define KILLCAMTITLE_DIALOG 5000 +#define KILLCAMTITLE_TITLE 5001 + +#define kc_W (1 * X_SCALE) +#define kc_H (0.1 * Y_SCALE) +#define kc_titleX CENTER(1, kc_W) +#define kc_titleY (0.65 * Y_SCALE) diff --git a/dialogs/killcam/title.hpp b/dialogs/killcam/title.hpp new file mode 100644 index 0000000..d7a7960 --- /dev/null +++ b/dialogs/killcam/title.hpp @@ -0,0 +1,20 @@ +class KillCamTitle +{ + idd = KILLCAMTITLE_DIALOG; + enableDisplay = true; + enableSimulation = true; + duration = 8; + onLoad = "uiNamespace setVariable [""KillCamTitle_Display"", _this select 0]"; + + class ControlsBackground + { + class Title: KillCamText + { + idc = KILLCAMTITLE_TITLE; + x = kc_titleX; + y = kc_titleY; + w = kc_W; + h = kc_H; + }; + }; +}; diff --git a/dialogs/scoreboard/defines.hpp b/dialogs/scoreboard/defines.hpp new file mode 100644 index 0000000..236b4f6 --- /dev/null +++ b/dialogs/scoreboard/defines.hpp @@ -0,0 +1,18 @@ +//SCOREBOARD =================================================================== +#define SCOREBOARD_DIALOG 7000 +#define SCOREBOARD_ITEM1 7001 +#define SCOREBOARD_ITEM2 7002 +#define SCOREBOARD_ITEM3 7003 +#define SCOREBOARD_ITEM4 7004 +#define SCOREBOARD_SCORE1 7011 +#define SCOREBOARD_SCORE2 7012 +#define SCOREBOARD_SCORE3 7013 +#define SCOREBOARD_SCORE4 7014 + +#define sb_itemW (0.25 * X_SCALE) +#define sb_itemH (0.025 * Y_SCALE) +#define sb_scoreW (sb_itemH * 0.75) +#define sb_totalX (SZ_RIGHT - 0.25) +#define sb_totalY (0.135 * Y_SCALE) +#define sb_itemSpacingX (0.03 * sb_itemH * X_SCALE) +#define sb_itemSpacingY (0.03 * sb_itemH * Y_SCALE) diff --git a/dialogs/scoreboard/title.hpp b/dialogs/scoreboard/title.hpp new file mode 100644 index 0000000..c054304 --- /dev/null +++ b/dialogs/scoreboard/title.hpp @@ -0,0 +1,58 @@ +class ScoreBoard +{ + idd = SCOREBOARD_DIALOG; + enableDisplay = true; + enableSimulation = true; + duration = 1e+1000; + onLoad = "uiNamespace setVariable [""ScoreBoard_Display"", _this select 0]"; + + class ControlsBackground { + class Item1: ScoreBoardItem + { + idc = SCOREBOARD_ITEM1; + y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 0); + }; + + class Score1: ScoreBoardScore + { + idc = SCOREBOARD_SCORE1; + y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 0); + }; + + class Item2: ScoreBoardItem + { + idc = SCOREBOARD_ITEM2; + y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 1); + }; + + class Score2: ScoreBoardScore + { + idc = SCOREBOARD_SCORE2; + y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 1); + }; + + class Item3: ScoreBoardItem + { + idc = SCOREBOARD_ITEM3; + y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 2); + }; + + class Score3: ScoreBoardScore + { + idc = SCOREBOARD_SCORE3; + y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 2); + }; + + class Item4: ScoreBoardItem + { + idc = SCOREBOARD_ITEM4; + y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 3); + }; + + class Score4: ScoreBoardScore + { + idc = SCOREBOARD_SCORE4; + y = sb_totalY + ((sb_itemSpacingY + sb_itemH) * 3); + }; + }; +}; diff --git a/dialogs/upgradeWeaponTitle/defines.hpp b/dialogs/upgradeWeaponTitle/defines.hpp new file mode 100644 index 0000000..ac6e1ed --- /dev/null +++ b/dialogs/upgradeWeaponTitle/defines.hpp @@ -0,0 +1,12 @@ +//UPGRADE WEAPON =============================================================== +#define UPGRADEWEAPON_DIALOG 6000 +#define UPGRADEWEAPON_BG 6001 +#define UPGRADEWEAPON_PIC 6002 +#define UPGRADEWEAPON_TEXT 6003 + +#define uw_x (SZ_RIGHT - 0.442) +#define uw_y (SZ_TOP + 0.33) +#define uw_w (0.30 * X_SCALE) +#define uw_h (uw_w * 0.75) +#define uw_paddingX (uw_w * 0.1) +#define uw_paddingY (uw_h * 0.1) diff --git a/dialogs/upgradeWeaponTitle/title.hpp b/dialogs/upgradeWeaponTitle/title.hpp new file mode 100644 index 0000000..06348ed --- /dev/null +++ b/dialogs/upgradeWeaponTitle/title.hpp @@ -0,0 +1,43 @@ +class upgradeWeaponTitle +{ + idd = UPGRADEWEAPON_DIALOG; + duration = 99999; + + enableSimulation = 1; + enableDisplay = 1; + + onload = "disableSerialization; _this call mcd_fnc_upgradeWeaponTitle;"; + + class ControlsBackground + { + class Background: mcd_IGUIBack + { + idc = UPGRADEWEAPON_BG; + x = uw_x; + y = uw_y; + w = uw_w; + h = uw_h; + }; + + class WeaponPicture: mcd_RscPicture + { + idc = UPGRADEWEAPON_PIC; + x = uw_x + uw_paddingX; + y = uw_y; + w = uw_w - 2*uw_paddingX; + h = uw_h - uw_paddingY; + text = ""; + }; + + class WeaponText: mcd_RscText + { + idc = UPGRADEWEAPON_TEXT; + style = ST_CENTER; + x = uw_x; + y = uw_y + uw_h - uw_paddingY*1.4; + w = uw_w; + h = uw_paddingY; + + }; + }; +}; diff --git a/dialogs/votecountdown/title.hpp b/dialogs/votecountdown/title.hpp new file mode 100644 index 0000000..28d1952 --- /dev/null +++ b/dialogs/votecountdown/title.hpp @@ -0,0 +1,37 @@ +class voteCountdownTitle +{ + idd = 1400; + duration = 99999; + + enableSimulation = 1; + enableDisplay = 1; + onLoad = "disableSerialization; _this call mcd_fnc_voteDialogText;"; + + class ControlsBackground + { + class statusMessage: mcd_RscMapText + { + moving = 1; + idc = 1401; + text = "PLAYZONE VOTING"; + x = safeZoneX + safeZoneW - 0.6 * 3/4; + y = safeZoneY + safeZoneH - 1.600; + }; + + class skipMessage: mcd_RscMapTextSmall + { + idc = 1403; + text = ""; + x = safeZoneX + safeZoneW - 0.6 * 3/4; + y = safeZoneY + safeZoneH - 1.545; + }; + + class waitMessage: mcd_RscMapTextSmall + { + idc = 1402; + text = ""; + x = safeZoneX + safeZoneW - 0.6 * 3/4; + y = safeZoneY + safeZoneH - 1.490; + }; + }; +}; diff --git a/functions/fn_scoreBoard.sqf b/functions/fn_scoreBoard.sqf index 9eba633..7f0d642 100644 --- a/functions/fn_scoreBoard.sqf +++ b/functions/fn_scoreBoard.sqf @@ -1,4 +1,4 @@ -/*#include "..\player\defines.hpp"*/ +#include "..\dialogs\scoreboard\defines.hpp" private ["_display", "_teamScore", "_teamName"]; if (!alive player) exitWith {}; diff --git a/functions/fn_showGRADScoreboard.sqf b/functions/fn_showGRADScoreboard.sqf index b6c7387..57dc8e4 100644 --- a/functions/fn_showGRADScoreboard.sqf +++ b/functions/fn_showGRADScoreboard.sqf @@ -12,4 +12,4 @@ _myStats = [ [_kills,_deaths,(round (_kd*100))/100,format ["%1m",round _longestKill],format ["%1m",_distanceMoved]] ]; -[20,_compiledStats,"GAME OF GUNS LEADERBOARD",false,_myStats,"MY STATS THIS GAME",false,false] call grad_scoreboard_fnc_loadScoreboard; +[20,_serverStats,"GAME OF GUNS LEADERBOARD",false,false,_myStats,"MY STATS THIS GAME",false,false] call grad_scoreboard_fnc_loadScoreboard; diff --git a/functions/fn_upgradeWeaponTitle.sqf b/functions/fn_upgradeWeaponTitle.sqf index c3744b4..78e6de7 100644 --- a/functions/fn_upgradeWeaponTitle.sqf +++ b/functions/fn_upgradeWeaponTitle.sqf @@ -1,4 +1,4 @@ -/*#include "..\player\defines.hpp"*/ +#include "..\dialogs\upgradeWeaponTitle\defines.hpp" params ["_dialog"]; diff --git a/player/killCam.sqf b/player/killCam.sqf index 76fe583..40733cd 100644 --- a/player/killCam.sqf +++ b/player/killCam.sqf @@ -1,4 +1,4 @@ -#include "defines.hpp" +#include "..\dialogs\killcam\defines.hpp" params ["_totalTime"]; disableSerialization; diff --git a/player/scoreBoard.sqf b/player/scoreBoard.sqf index f3a7349..f403709 100644 --- a/player/scoreBoard.sqf +++ b/player/scoreBoard.sqf @@ -1,4 +1,4 @@ -#include "defines.hpp" +#include "..\dialogs\scoreboard\defines.hpp" waitUntil {!isNil "isSpectator"}; if (isSpectator) exitWith {}; diff --git a/server/endGame.sqf b/server/endGame.sqf index f3ce954..ae0dd2b 100644 --- a/server/endGame.sqf +++ b/server/endGame.sqf @@ -14,6 +14,7 @@ _stats = [] call mcd_fnc_updateLeaderboard; _compiledStats = [_stats] call mcd_fnc_compileForGRADScoreboard; //show on clients +sleep 10; [_compiledStats] remoteExec ["mcd_fnc_showGRADScoreboard",0,false]; //end mission