Skip to content

Commit

Permalink
Merge pull request #1475 from SOF-Ice/Set-day-time-and-change-weather…
Browse files Browse the repository at this point in the history
…-for-officer

Add: Set day time and change weather
  • Loading branch information
Vdauphin authored Jan 18, 2023
2 parents 55119e2 + bdeddde commit 5e18f15
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 0 deletions.
2 changes: 2 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ btc_p_db_autoRestartHour = [
];
btc_p_db_autoRestartType = "btc_p_db_autoRestartType" call BIS_fnc_getParamValue;
btc_p_slot_isShare = "btc_p_slot_isShare" call BIS_fnc_getParamValue isEqualTo 1;
btc_p_change_time = ("btc_p_change_time" call BIS_fnc_getParamValue) isEqualTo 1;
btc_p_change_weather = ("btc_p_change_weather" call BIS_fnc_getParamValue) isEqualTo 1;

//<< Respawn options >>
btc_p_respawn_location = "btc_p_respawn_location" call BIS_fnc_getParamValue;
Expand Down
12 changes: 12 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ class Params {
texts[]={"1","2","3","4","5","6","7","8","9","10","11","12"};
default = 5;
};
class btc_p_change_time { // Enable change day time for officer on the arsenal box:
title = __EVAL(format [" %1", localize "STR_BTC_HAM_CHANGE_TIME_ENABLEARSENAL"]);
values[]={0,1};
texts[]={$STR_DISABLED,$STR_ENABLED};
default = 0;
};
class btc_p_change_weather { // Enable change weather for officer on the arsenal box
title = __EVAL(format [" %1", localize "STR_BTC_HAM_CHANGE_WEATHER_ENABLEARSENAL"]);
values[]={0,1};
texts[]={$STR_DISABLED,$STR_ENABLED};
default = 0;
};
class btc_p_db_title { // << Server management >>
title = $STR_BTC_HAM_PARAM_DB_TITLE;
values[]={0};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

/* ----------------------------------------------------------------------------
Function: btc_fnc_changeWeather
Description:
Change weather: stop rain, stop fog and make sunny weather.
Parameters:
Returns:
Examples:
Author:
Ice
---------------------------------------------------------------------------- */

5 setRain 0;
5 setFog 0;
5 setOvercast 0;
10 setRainbow 1;
1 change: 1 addition & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ if (isServer) then {
btc_fnc_typeOf = compileScript ["core\fnc\common\typeOf.sqf"];
btc_fnc_roof = compileScript ["core\fnc\common\roof.sqf"];
btc_fnc_moveOut = compileScript ["core\fnc\common\moveOut.sqf"];
btc_fnc_changeWeather = compileScript ["core\fnc\common\changeWeather.sqf"];

//CHEM
btc_chem_fnc_checkLoop = compileScript ["core\fnc\chem\checkLoop.sqf"];
Expand Down
17 changes: 17 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/int/add_actions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,20 @@ if (btc_p_flag > 1) then {
}, {getForcedFlagTexture _target isNotEqualTo ""}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions", "ACE_Equipment"], _action] call ace_interact_menu_fnc_addActionToObject;
};

//Change day time and weather
_action = ["env_menu", localize "str_a3_credits_environment", "", {}, {player getVariable ["side_mission", false] && (btc_p_change_time || btc_p_change_weather)}] call ace_interact_menu_fnc_createAction;
[btc_gear_object, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToObject;
_action = ["set_day", localize "STR_BTC_HAM_ACTION_SET_DAY", "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Watch_ca.paa", {
private _hour = date call BIS_fnc_sunriseSunsetTime select 0;
((_hour + 1 - dayTime + 24) % 24) remoteExecCall ["skipTime", 2];
}, {btc_p_change_time && player getVariable ["side_mission", false]}] call ace_interact_menu_fnc_createAction;
[btc_gear_object, 0, ["ACE_MainActions", "env_menu"], _action] call ace_interact_menu_fnc_addActionToObject;
_action = ["set_night", localize "STR_BTC_HAM_ACTION_SET_NIGHT", "\A3\Ui_f\data\GUI\Rsc\RscDisplayArsenal\Watch_ca.paa", {
private _hour = date call BIS_fnc_sunriseSunsetTime select 1;
((_hour + 1 - dayTime + 24) % 24) remoteExecCall ["skipTime", 2];
}, {btc_p_change_time && player getVariable ["side_mission", false]}] call ace_interact_menu_fnc_createAction;

[btc_gear_object, 0, ["ACE_MainActions", "env_menu"], _action] call ace_interact_menu_fnc_addActionToObject;
_action = ["set_weather", localize "STR_BTC_HAM_ACTION_CHANGE_WEATHER", "a3\3den\data\attributes\slidertimeday\sun_ca.paa", {[] remoteExecCall ["btc_fnc_changeWeather", 2]}, {btc_p_change_weather && player getVariable ["side_mission", false]}] call ace_interact_menu_fnc_createAction;
[btc_gear_object, 0, ["ACE_MainActions","env_menu"], _action] call ace_interact_menu_fnc_addActionToObject;
22 changes: 22 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2173,6 +2173,28 @@
<Czech>Rozbijte zámek dveří</Czech>
</Key>
</Container>
<Container name="Action(ACE): Change day time and weather">
<Key ID="STR_BTC_HAM_ACTION_SET_DAY">
<Original>Set day time</Original>
<French>Mettre le jour</French>
</Key>
<Key ID="STR_BTC_HAM_ACTION_SET_NIGHT">
<Original>Set night time</Original>
<French>Mettre la nuit</French>
</Key>
<Key ID="STR_BTC_HAM_ACTION_CHANGE_WEATHER">
<Original>Change weather</Original>
<French>Changer la météo</French>
</Key>
<Key ID="STR_BTC_HAM_CHANGE_TIME_ENABLEARSENAL">
<Original>Enable change day time for officer on the arsenal box:</Original>
<French>Autoriser le changement d'heure pour les officiers sur la caisse arsenal:</French>
</Key>
<Key ID="STR_BTC_HAM_CHANGE_WEATHER_ENABLEARSENAL">
<Original>Enable change weather for officer on the arsenal box:</Original>
<French>Autoriser le changement de météo pour les officiers sur la caisse arsenal:</French>
</Key>
</Container>
</Package>
<Package name="Conversations">
<Container name="Conversations: Info">
Expand Down

0 comments on commit 5e18f15

Please sign in to comment.