Merge pull request #1150 from acemod/mainMenuVersionHTML

Show Version / HTML Git Version on main menu
This commit is contained in:
PabstMirror 2015-06-13 14:07:36 -05:00
commit 0c45d2308a
5 changed files with 108 additions and 1 deletions

View File

@ -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);
};
};

View File

@ -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

View File

@ -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};
};
};
};
};
};

View File

@ -0,0 +1,31 @@
/*
* Author: PabstMirror
* Loads the version info HTML box from main menu
*
* Arguments:
* 0: Display (from onMouseMoving) <DISPLAY>
*
* 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;
};

View File

@ -330,5 +330,11 @@
<Spanish>Envía información de depuración al RPT y el portapapeles.</Spanish>
<Czech>Pošle debug informace do RPT a schránky.</Czech>
</Key>
<Key ID="STR_ACE_OptionsMenu_aceNews">
<English>ACE News</English>
</Key>
<Key ID="STR_ACE_OptionsMenu_showNewsOnMainMenu_name">
<English>Show News on Main Menu</English>
</Key>
</Package>
</Project>