Skip to content

Commit

Permalink
wait screen
Browse files Browse the repository at this point in the history
  • Loading branch information
McDiod committed May 13, 2017
1 parent 011ef28 commit 93528cb
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 3 deletions.
2 changes: 1 addition & 1 deletion buyables/blu_us_army/vehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Vehicles {
class I_Heli_light_03_unarmed_F {
description = "Seats: 8";
price = 5000;
stock = 2;
stock = 1;
code = "if (isServer) then {(_this select 2) disableTIEquipment true};";
};

Expand Down
2 changes: 2 additions & 0 deletions functions/caches/fn_spawnCaches.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ while {count _allCachePositions < _cacheAmount && {_loopCount < _cacheAmount * 5
};

DEBUGMSG_3("cache spawn completed in %1s (%2/%3 caches).",diag_tickTime-_startTime,count _allCachePositions,_cacheAmount);

missionNamespace setVariable ["WITA_SETUP_CACHESDONE",true,true];
2 changes: 2 additions & 0 deletions functions/civs/fn_boats.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ while {count _thesePositions < _boatsToCreate && {_loopCount < _boatsToCreate *
};

DEBUGMSG_2("boat spawn completed in %1s (%2 boats).",diag_tickTime-_startTime,count _thesePositions);

missionNamespace setVariable ["WITA_SETUP_BOATSDONE",true,true];
2 changes: 2 additions & 0 deletions functions/civs/fn_cars.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ private _roadMinDist = [missionConfigFile >> "cfgMission" >> "civVehicles", "car
[[worldSize/2,worldSize/2,0],worldSize * 1.5,_roadAmountFactor,-1,_roadMinDist] call wita_civs_fnc_createSideRoadVehicles;

DEBUGMSG_2("car spawn completed in %1s (%2 cars).",diag_tickTime-_startTime,count wita_civs_vehiclePositions);

missionNamespace setVariable ["WITA_SETUP_CARSDONE",true,true];
2 changes: 2 additions & 0 deletions functions/civs/fn_helicopters.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ private _thesePositions = [];
} count _allAirportsPositions;

DEBUGMSG_2("helicopter spawn completed in %1s (%2 helicopters).",diag_tickTime-_startTime,count _thesePositions);

missionNamespace setVariable ["WITA_SETUP_HELISDONE",true,true];
6 changes: 6 additions & 0 deletions functions/init/fn_initMission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ wita_missionParam_RESPAWNTIME = "RESPAWNTIME" call BIS_fnc_getParamValue;
};
};
}, []] call CBA_fnc_waitUntilAndExecute;

if (hasInterface) then {
[{!isNull (findDisplay 46)},{
[] call wita_setup_fnc_waitScreen;
}, []] call CBA_fnc_waitUntilAndExecute;
};
1 change: 1 addition & 0 deletions functions/setup/cfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ class wita_setup {
class setMoney {};
class startGame {};
class teleportSide {};
class waitScreen {};
};
};
2 changes: 2 additions & 0 deletions functions/setup/fn_blufor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ WITA_BLUFORBASEAREA setTriggerArea [_baseAreaSize,_baseAreaSize,0,false];
["wita_blufor_startPosition",_startPosition,"ICON",[1,1],"PERSIST","TYPE:","b_hq","COLOR:","COLORWEST"] call CBA_fnc_createMarker;
["wita_blufor_baseArea",_startPosition,"ELLIPSE",[_baseAreaSize,_baseAreaSize],"PERSIST","BRUSH:","Border","COLOR:","COLORWEST"] call CBA_fnc_createMarker;

missionNamespace setVariable ["WITA_SETUP_BLUFORDONE",true,true];

_startPosition
2 changes: 2 additions & 0 deletions functions/setup/fn_independent.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ if (WITA_DEBUGMODE) then {
["wita_indep_startPosition",_startPosition,"ICON",[1,1],"PERSIST","TYPE:","hd_start","COLOR:","COLORGUER"] call CBA_fnc_createMarker;
};

missionNamespace setVariable ["WITA_SETUP_INDEPENDENTDONE",true,true];

_startPosition
2 changes: 1 addition & 1 deletion functions/setup/fn_setMoney.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ params ["_account"];

private _moneyFactorConfig = [missionConfigFile >> "cfgMission","bluforMoneyStartFactor",1] call BIS_fnc_returnConfigEntry;
private _moneyFactorGain = [missionConfigFile >> "cfgMission","bluforMoneyGainFactor",1] call BIS_fnc_returnConfigEntry;
private _moneyFactorParam = switch ("DEBUG_MODE" call BIS_fnc_getParamValue) do {
private _moneyFactorParam = switch ("BLUFOR_MONEY" call BIS_fnc_getParamValue) do {
case (0): {0.8};
case (1): {1.0};
case (2): {1.2};
Expand Down
47 changes: 47 additions & 0 deletions functions/setup/fn_waitScreen.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include "component.hpp"



if (missionNamespace getVariable ["WITA_GAMESTARTED",false]) exitWith {};
player enableSimulationGlobal false;

"wita_waitScreen" cutRsc ["RscTitleDisplayEmpty","PLAIN",0,false];
[{!isNull (uiNamespace getVariable ["RscTitleDisplayEmpty",displayNull])}, {

_display = uiNamespace getVariable ["RscTitleDisplayEmpty",displayNull];

_ctrlText = _display ctrlCreate ["RscStructuredText",-1];
_ctrlText ctrlSetBackgroundColor [0,0,0,1];
_ctrlText ctrlSetFontHeight 0.05;
_ctrlText ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH];
_ctrlText ctrlCommit 0;

[{
params ["_ctrlText","_handle"];
if (missionNamespace getVariable ["WITA_GAMESTARTED",false]) exitWith {
"wita_waitScreen" cutRsc ["RscTitleDisplayEmpty","PLAIN",0,false];
player enableSimulationGlobal true;
[_handle] call CBA_fnc_removePerFrameHandler;
};

private _checkVar = {
params ["_varname"];

if (missionNamespace getVariable [_varName,false]) then {
"<t color='#00ff00'>complete!</t>"
} else {
"<t color='#ff0000'>in progress...</t>"
}
};

_text = composeText [
parseText format ["Independent start position: %1",["WITA_SETUP_INDEPENDENTDONE"] call _checkVar], lineBreak,
parseText format ["Blufor start position: %1",["WITA_SETUP_BLUFORDONE"] call _checkVar], lineBreak,
parseText format ["Random cars: %1",["WITA_SETUP_CARSDONE"] call _checkVar], lineBreak,
parseText format ["Random helicopters: %1",["WITA_SETUP_HELISDONE"] call _checkVar], lineBreak,
parseText format ["Random boats: %1",["WITA_SETUP_BOATSDONE"] call _checkVar], lineBreak,
parseText format ["Random caches: %1",["WITA_SETUP_CACHESDONE"] call _checkVar]
];
_ctrlText ctrlSetStructuredText _text;
} , 0.2, _ctrlText] call CBA_fnc_addPerFrameHandler;
}, []] call CBA_fnc_waitUntilAndExecute;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tvt-wita2016",
"description": "Where is the agent?",
"version": "0.4.0",
"version": "0.5.0",
"contributors": [
{
"name": "XiviD"
Expand Down

0 comments on commit 93528cb

Please sign in to comment.