Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dogtags - Allow dogtags display to be repositioned #6351

Merged
merged 3 commits into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions addons/dogtags/CfgUIGrids.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class CfgUIGrids {
class IGUI {
class Presets {
class Arma3 {
class Variables {
GVAR(grid)[] = {
{
(safeZoneX + safeZoneW) - 12.9 * GUI_GRID_W,
safeZoneY + 0.175 * safeZoneH,
8 * GUI_GRID_W,
8 * GUI_GRID_H
},
GUI_GRID_W,
GUI_GRID_H
};
};
};
};
class Variables {
class GVAR(grid) {
displayName = COMPONENT_NAME;
description = CSTRING(IGUI_Description);
preview = QPATHTOF(ui\igui_preview.paa);
saveToProfile[] = {0, 1};
canResize = 0;
};
};
};
};
34 changes: 13 additions & 21 deletions addons/dogtags/Dogtag.hpp → addons/dogtags/RscTitles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,30 @@ class RscTitles {
idd = -1;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),_this select 0)]);
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),nil)]);
movingEnable = false;
duration = 5;
fadeIn = 0.2;
fadeOut = 0.2;

duration = 5;
movingEnable = 0;
class controls {
class background: RscPicture {
idc = 1000;
text = QUOTE(PATHTOF(data\dogtagSingle.paa));
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
x = profileNamespace getVariable ['TRIPLES(IGUI,GVAR(grid),X)', (safeZoneX + safeZoneW) - 12.9 * GUI_GRID_W];
y = profileNamespace getVariable ['TRIPLES(IGUI,GVAR(grid),Y)', safeZoneY + 0.175 * safeZoneH];
w = 8 * GUI_GRID_W;
h = 8 * GUI_GRID_H;
text = QPATHTOF(data\dogtagSingle.paa);
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0, 0, 0, 0};
x = ((safezoneX + safezoneW) - (10 * (((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 * (((safezoneW / safezoneH) min 1.2) / 40));
y = safeZoneY + 0.175 * safezoneH;
w = (8 * (((safezoneW / safezoneH) min 1.2) / 40));
h = (8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25));
font = "EtelkaMonospacePro";
};
class nickname: RscStructuredText {
idc = 1001;
text = "";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
sizeEx = GUI_GRID_H;
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0, 0, 0, 0};
x = ((safezoneX + safezoneW) - (8.4 * (((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 * (((safezoneW / safezoneH) min 1.2) / 40));
y = safeZoneY + 0.24 * safezoneH;
w = (5.9 * (((safezoneW / safezoneH) min 1.2) / 40));
h = (3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25));
x = 1.6 * GUI_GRID_W + (profileNamespace getVariable ['TRIPLES(IGUI,GVAR(grid),X)', (safeZoneX + safeZoneW) - 12.9 * GUI_GRID_W]);
y = 0.065 * safeZoneH + (profileNamespace getVariable ['TRIPLES(IGUI,GVAR(grid),Y)', safeZoneY + 0.175 * safeZoneH]);
w = 5.9 * GUI_GRID_W;
h = 3 * GUI_GRID_H;
font = "RobotoCondensed";
class Attributes {
font = "RobotoCondensed";
Expand All @@ -48,13 +44,9 @@ class RscTitles {
};
};
class GVAR(doubleTag): GVAR(singleTag) {
idd = -1;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),_this select 0)]);
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),nil)]);

class controls: controls {
class background: background {
text = QUOTE(PATHTOF(data\dogtagDouble.paa));
text = QPATHTOF(data\dogtagDouble.paa);
};
class nickname: nickname {
class Attributes: Attributes {
Expand Down
3 changes: 2 additions & 1 deletion addons/dogtags/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ class CfgPatches {
#include "CfgEventHandlers.hpp"
#include "CfgWeapons.hpp"
#include "CfgVehicles.hpp"
#include "Dogtag.hpp"
#include "RscTitles.hpp"
#include "CfgUIGrids.hpp"
2 changes: 2 additions & 0 deletions addons/dogtags/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include "\z\ace\addons\main\script_macros.hpp"

#include "\a3\ui_f\hpp\defineCommonGrids.inc"

#define DOGTAG_SHOW_DELAY 1

#define RUSTLING_SOUNDS [\
Expand Down
3 changes: 3 additions & 0 deletions addons/dogtags/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,8 @@
<Chinese>已經有人把他的兵籍牌拿走了...</Chinese>
<Chinesesimp>已经有人把他的兵籍牌拿走了...</Chinesesimp>
</Key>
<Key ID="STR_ACE_Dogtags_IGUI_Description">
<English>Onscreen display for checking dogtags</English>
</Key>
</Package>
</Project>
Binary file added addons/dogtags/ui/igui_preview.paa
Binary file not shown.