diff --git a/addons/optionsmenu/ACE_Settings.hpp b/addons/optionsmenu/ACE_Settings.hpp index 9ebaf65095..0badbad660 100644 --- a/addons/optionsmenu/ACE_Settings.hpp +++ b/addons/optionsmenu/ACE_Settings.hpp @@ -6,4 +6,10 @@ class ACE_Settings { displayName = CSTRING(uiScaing); values[] = {"$str_medium", "$str_large", "$str_very_large"}; }; + class GVAR(showNewsOnMainMenu) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(showNewsOnMainMenu_name); + }; }; diff --git a/addons/optionsmenu/gui/define.hpp b/addons/optionsmenu/gui/define.hpp index cb4fe1b509..2a3fffc736 100644 --- a/addons/optionsmenu/gui/define.hpp +++ b/addons/optionsmenu/gui/define.hpp @@ -7,6 +7,9 @@ class ACE_gui_staticBase; class ACE_gui_listNBox; class ACE_gui_comboBoxBase; class RscXSliderH; +class RscControlsGroupNoScrollbars; +class RscHTML; +class RscText; #ifndef ACE_DEFINE_H diff --git a/addons/optionsmenu/gui/pauseMenu.hpp b/addons/optionsmenu/gui/pauseMenu.hpp index d009d78049..5bf4ced035 100644 --- a/addons/optionsmenu/gui/pauseMenu.hpp +++ b/addons/optionsmenu/gui/pauseMenu.hpp @@ -98,12 +98,73 @@ class RscDisplayInterruptEditor3D: RscStandardDisplay { class RscDisplayMain: RscStandardDisplay { //Hide the button if there is no world (-world=empty) //Seems odd to use onMouseMoving, but I don't want to overload onLoad - onMouseMoving = "((_this select 0) displayCtrl 80085) ctrlShow (missionName != '');"; + onMouseMoving = QUOTE(((_this select 0) displayCtrl 80085) ctrlShow (missionName != ''); _this execVM QUOTE(QUOTE(PATHTOF(script_loadMainMenuBox.sqf)));); + class controls { class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase { action = "if (missionName != '') then {createDialog 'ACE_settingsMenu';};"; y = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY"; idc = 80085; }; + + class ACE_news: RscControlsGroupNoScrollbars { + idc = 80086; + x = "safezoneX + safezoneW - (16 *(((safezoneW / safezoneH) min 1.2) / 40))"; + y = "safezoneY + (18.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))"; + w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "8.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + class controls { + class ACE_NewsTitle: RscText { + text = CSTRING(aceNews); + colorBackground[] = {(162/255),(28/255),(28/255),0.8}; + idc = -1; + x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "15 *(((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + class ACE_VersionInfo: RscText { + idc = 68; + x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0,0,0,0.5}; + }; + class ACE_NewsBackground: RscText { + idc = -1; + x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "5.75 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0,0,0,0.5}; + }; + class ACE_NewsText: RscHTML { + idc = 69; + x = "0.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "14 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "5.75 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + + shadow = 0; + class H1 { + font = "PuristaMedium"; + fontBold = "PuristaLight"; + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + }; + class H2: H1 { + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; + font = "PuristaLight"; + }; + class P: H1 { + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + fontBold = "PuristaLight"; + }; + colorBold[] = {0.6,0.6,0.6,1}; + colorLink[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1}; + colorLinkActive[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1}; + }; + }; + }; }; }; diff --git a/addons/optionsmenu/script_loadMainMenuBox.sqf b/addons/optionsmenu/script_loadMainMenuBox.sqf new file mode 100644 index 0000000000..9c556e5128 --- /dev/null +++ b/addons/optionsmenu/script_loadMainMenuBox.sqf @@ -0,0 +1,31 @@ +/* + * Author: PabstMirror + * Loads the version info HTML box from main menu + * + * Arguments: + * 0: Display (from onMouseMoving) + * + * Return Value: + * None + * + * Example: + * onMouseMovingEvent execVM "script_loadMainMenuBox.sqf"; + * + * Public: No + */ +#include "script_component.hpp" + +if (missionNamespace getVariable [QGVAR(newsLoaded), false]) exitWith {}; +GVAR(newsLoaded) = true; + +//Need to load from profileNamespace because ace_settings might not be init if world = empty +if (profileNamespace getVariable [QGVAR(showNewsOnMainMenu), true]) then { + ((_this select 0) displayCtrl 80086) ctrlShow true; + + private ["_version"]; + _version = getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr"); + ((_this select 0) displayCtrl 68) ctrlSetText format ["Installed Version: %1", _version]; + ((_this select 0) displayCtrl 69) htmlLoad "http://ace3mod.com/version.html"; +} else { + ((_this select 0) displayCtrl 80086) ctrlShow false; +}; diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index 4923ddea2e..4bbeb22cf5 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -330,5 +330,11 @@ Envía información de depuración al RPT y el portapapeles. Pošle debug informace do RPT a schránky. + + ACE News + + + Show News on Main Menu + \ No newline at end of file