Skip to content

Commit 946246c

Browse files
committed
Selectable fast travel rules
1 parent 400132c commit 946246c

3 files changed

Lines changed: 68 additions & 1 deletion

File tree

addons/overthrow_main.pbo

2.99 KB
Binary file not shown.

addons/overthrow_main/functions/UI/dialogs/fn_newGameDialog.sqf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ server setVariable ["generals",[getplayeruid player],true];
44

55
private _diff = server getVariable ["OT_difficulty",1];
66
private _ft = server getVariable ["OT_fastTravelType",1];
7+
private _ftr = server getVariable ["OT_fastTravelRules",_diff];
78

89
if(_diff isEqualTo 0) then {
910
(findDisplay 8099) displayCtrl 1600 ctrlSetTextColor [0,0.8,0,1];
@@ -36,3 +37,19 @@ if(_ft isEqualTo 2) then {
3637
(findDisplay 8099) displayCtrl 1604 ctrlSetTextColor [1,1,1,1];
3738
(findDisplay 8099) displayCtrl 1605 ctrlSetTextColor [0,0.8,0,1];
3839
};
40+
41+
if(_ftr isEqualTo 0) then {
42+
(findDisplay 8099) displayCtrl 1607 ctrlSetTextColor [0,0.8,0,1];
43+
(findDisplay 8099) displayCtrl 1608 ctrlSetTextColor [1,1,1,1];
44+
(findDisplay 8099) displayCtrl 1609 ctrlSetTextColor [1,1,1,1];
45+
};
46+
if(_ftr isEqualTo 1) then {
47+
(findDisplay 8099) displayCtrl 1607 ctrlSetTextColor [1,1,1,1];
48+
(findDisplay 8099) displayCtrl 1608 ctrlSetTextColor [0,0.8,0,1];
49+
(findDisplay 8099) displayCtrl 1609 ctrlSetTextColor [1,1,1,1];
50+
};
51+
if(_ftr isEqualTo 2) then {
52+
(findDisplay 8099) displayCtrl 1607 ctrlSetTextColor [1,1,1,1];
53+
(findDisplay 8099) displayCtrl 1608 ctrlSetTextColor [1,1,1,1];
54+
(findDisplay 8099) displayCtrl 1609 ctrlSetTextColor [0,0.8,0,1];
55+
};

addons/overthrow_main/ui/dialogs/main.hpp

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class OT_dialog_start
3232
class RscButton_1601: RscOverthrowButton
3333
{
3434
idc = 1601;
35-
action = "closeDialog 0;createDialog ""OT_dialog_newgame"";";
35+
action = "closeDialog 0;createDialog ""OT_dialog_newgame"";call OT_fnc_newGameDialog;";
3636

3737
text = "New Game"; //--- ToDo: Localize;
3838
x = 0.448438 * safezoneW + safezoneX;
@@ -1499,6 +1499,7 @@ class OT_dialog_newgame
14991499
w = 0.0876563 * safezoneW;
15001500
h = 0.077 * safezoneH;
15011501
action = "server setvariable [""OT_difficulty"",0,true];call OT_fnc_newGameDialog;";
1502+
tooltip = "Recommended for beginners playing solo";
15021503
};
15031504
class RscButton_1601: RscOverthrowButton
15041505
{
@@ -1510,6 +1511,7 @@ class OT_dialog_newgame
15101511
h = 0.077 * safezoneH;
15111512
action = "server setvariable [""OT_difficulty"",1,true];call OT_fnc_newGameDialog;";
15121513
color[] = {0,0.8,0,1};
1514+
tooltip = "Recommended for beginners playing in groups or experienced players solo";
15131515
};
15141516
class RscButton_1602: RscOverthrowButton
15151517
{
@@ -1520,6 +1522,7 @@ class OT_dialog_newgame
15201522
w = 0.0876563 * safezoneW;
15211523
h = 0.077 * safezoneH;
15221524
action = "server setvariable [""OT_difficulty"",2,true];call OT_fnc_newGameDialog;";
1525+
tooltip = "For the hardcore";
15231526
};
15241527
class RscStructuredText_1101: RscOverthrowStructuredText
15251528
{
@@ -1550,6 +1553,7 @@ class OT_dialog_newgame
15501553
w = 0.0876563 * safezoneW;
15511554
h = 0.077 * safezoneH;
15521555
action = "server setvariable [""OT_fastTravelType"",0,true];call OT_fnc_newGameDialog;";
1556+
tooltip = "Fast travel will not cost anything";
15531557
};
15541558
class RscButton_1604: RscOverthrowButton
15551559
{
@@ -1561,6 +1565,7 @@ class OT_dialog_newgame
15611565
h = 0.077 * safezoneH;
15621566
color[] = {0,0.8,0,1};
15631567
action = "server setvariable [""OT_fastTravelType"",1,true];call OT_fnc_newGameDialog;";
1568+
tooltip = "Fast travel will cost money";
15641569
};
15651570
class RscButton_1605: RscOverthrowButton
15661571
{
@@ -1571,6 +1576,51 @@ class OT_dialog_newgame
15711576
w = 0.0876563 * safezoneW;
15721577
h = 0.077 * safezoneH;
15731578
action = "server setvariable [""OT_fastTravelType"",2,true];call OT_fnc_newGameDialog;";
1579+
tooltip = "Fast travel will be disabled";
1580+
};
1581+
class RscStructuredText_1102: RscOverthrowStructuredText
1582+
{
1583+
idc = 1103;
1584+
text = "<t size=""1.5"">Fast Travel Rules</t>"; //--- ToDo: Localize;
1585+
x = 0.329844 * safezoneW + safezoneX;
1586+
y = 0.577 * safezoneH + safezoneY;
1587+
w = 0.159844 * safezoneW;
1588+
h = 0.033 * safezoneH;
1589+
colorBackground[] = {0,0,0,0};
1590+
};
1591+
class RscButton_1607: RscOverthrowButton
1592+
{
1593+
idc = 1607;
1594+
text = "Open"; //--- ToDo: Localize;
1595+
x = 0.329844 * safezoneW + safezoneX;
1596+
y = 0.621 * safezoneH + safezoneY;
1597+
w = 0.0876563 * safezoneW;
1598+
h = 0.077 * safezoneH;
1599+
action = "server setvariable [""OT_fastTravelRules"",0,true];call OT_fnc_newGameDialog;";
1600+
tooltip = "No rules for fast travel";
1601+
};
1602+
class RscButton_1608: RscOverthrowButton
1603+
{
1604+
idc = 1608;
1605+
text = "No Weapons"; //--- ToDo: Localize;
1606+
x = 0.453594 * safezoneW + safezoneX;
1607+
y = 0.621 * safezoneH + safezoneY;
1608+
w = 0.0876563 * safezoneW;
1609+
h = 0.077 * safezoneH;
1610+
color[] = {0,0.8,0,1};
1611+
action = "server setvariable [""OT_fastTravelRules"",1,true];call OT_fnc_newGameDialog;";
1612+
tooltip = "Cannot fast travel while holding a weapon or carrying drugs";
1613+
};
1614+
class RscButton_1609: RscOverthrowButton
1615+
{
1616+
idc = 1609;
1617+
text = "Restricted"; //--- ToDo: Localize;
1618+
x = 0.577344 * safezoneW + safezoneX;
1619+
y = 0.621 * safezoneH + safezoneY;
1620+
w = 0.0876563 * safezoneW;
1621+
h = 0.077 * safezoneH;
1622+
action = "server setvariable [""OT_fastTravelRules"",2,true];call OT_fnc_newGameDialog;";
1623+
tooltip = "Cannot fast travel while holding a weapon, carrying drugs, or in an offensive vehicle";
15741624
};
15751625
class RscButton_1606: RscOverthrowButton
15761626
{

0 commit comments

Comments
 (0)