diff --git a/Sources/epoch_code/System/task_control.fsm b/Sources/epoch_code/System/task_control.fsm index 6608e305..c8148d31 100644 --- a/Sources/epoch_code/System/task_control.fsm +++ b/Sources/epoch_code/System/task_control.fsm @@ -381,7 +381,7 @@ class FSM condition="diag_tickTime - _lastChat > _taskDiagSquelch && call _taskDiagCond3 && count _taskDiag3 > 0"; action="_diag = selectRandom _taskDiag3;" \n "" \n - "[format [""%1"",_diag], 5] call Epoch_dynamicText;" \n + "[_diag, 5] call Epoch_message;" \n "" \n "" \n "_chat3Done = true;" \n @@ -395,7 +395,7 @@ class FSM precondition = ""; condition="diag_tickTime - _lastChat > _taskDiagSquelch && call _taskDiagCond2 && count _taskDiag2 > 0"; action="_diag = selectRandom _taskDiag2;" \n - "[format [""%1"",_diag], 5] call Epoch_dynamicText;" \n + "[_diag, 5] call Epoch_message;" \n "_chat2Done = true;" \n "_lastChat = diag_tickTime;"; }; @@ -416,7 +416,7 @@ class FSM precondition = ""; condition="(!_chat1Done) && call _taskDiagCond1 && count _taskDiag1 > 0"; action="_diag = selectRandom _taskDiag1;" \n - "[format [""%1"",_diag], 5] call Epoch_dynamicText;" \n + "[_diag, 5] call Epoch_message;" \n "_chat1Done = true;" \n "_lastChat = diag_tickTime;"; }; @@ -764,7 +764,7 @@ class FSM precondition = ""; condition="!_diag1Done && count _taskCompleteDiag1 > 0"; action="_diag = selectRandom _taskCompleteDiag1;" \n - "[format [""%1"",_diag], 5] call Epoch_dynamicText;" \n + "[_diag, 5] call Epoch_message;" \n "_diag1Done = true;"; }; class diag_2 @@ -775,7 +775,7 @@ class FSM precondition = ""; condition="_diag1Done && (!_diag2Done) && diag_tickTime - _lastLoop > 20 && count _taskCompleteDiag2 > 0"; action="_diag = selectRandom _taskCompleteDiag2;" \n - "[format [""%1"",_diag], 5] call Epoch_dynamicText;" \n + "[_diag, 5] call Epoch_message;" \n "_diag2Done = true;"; }; class call @@ -1040,7 +1040,7 @@ class FSM precondition = ""; condition="count _taskFailedDiag > 0"; action="_diag = selectRandom _taskFailedDiag;" \n - "[format [""%1"",_diag], 5] call Epoch_dynamicText;" \n + "[_diag, 5] call Epoch_message;" \n "_taskFailedDiag = [];"; }; class pause @@ -1081,7 +1081,7 @@ class FSM precondition = ""; condition="count _taskReminder > 0 && !_taskFailed"; action="_diag = selectRandom _taskReminder;" \n - "[format [""%1"",_diag], 5] call Epoch_dynamicText;" \n + "[_diag, 5] call Epoch_message;" \n "_taskReminder = [];"; }; class markers diff --git a/Sources/epoch_code/compile/EPOCH_consumeItem.sqf b/Sources/epoch_code/compile/EPOCH_consumeItem.sqf index a8d7936d..5496a411 100644 --- a/Sources/epoch_code/compile/EPOCH_consumeItem.sqf +++ b/Sources/epoch_code/compile/EPOCH_consumeItem.sqf @@ -72,7 +72,7 @@ _unifiedInteract = { { _output = [_forEachIndex, _x] call _giveAttributes; if (_output != "") then { - [format["%1", _output], 5] call Epoch_dynamicText; + [_output, 5] call Epoch_message; }; } foreach _interactAttributes; }; @@ -106,7 +106,7 @@ switch _interactOption do { if ((_magazineSize % _magazineSizeMax) > 0) then { player addMagazine [_item, floor (_magazineSize % _magazineSizeMax)]; }; - ["Ammo Repacked", 5] call Epoch_dynamicText; + ["Ammo Repacked", 5] call Epoch_message; }; }; case 1: _unifiedInteract; // Eat 1 @@ -148,7 +148,7 @@ switch _interactOption do { [_object] spawn EPOCH_simulSwap; }; } else { - ["Building Disallowed: Frequency Unstable", 5] call Epoch_dynamicText; + ["Building Disallowed: Frequency Unstable", 5] call Epoch_message; }; } else { _object=createVehicle[_buildClass,_pos,[],0,"CAN_COLLIDE"]; @@ -156,14 +156,14 @@ switch _interactOption do { [_object,_item] spawn EPOCH_staticMove; }; // _object spawn EPOCH_countdown; - [format["Press '%1' to drop object.", "1"], 5] call Epoch_dynamicText; + [format["Press '%1' to drop object.", "1"], 5] call Epoch_message; } else { - ["Need Energy< / t>", 5] call Epoch_dynamicText; + ["Need Energy", 5] call Epoch_message; }; }; } else { - ["World limit reached", 5] call Epoch_dynamicText; + ["World limit reached", 5] call Epoch_message; }; }; }; @@ -185,7 +185,7 @@ switch _interactOption do { // send [_vehicle,_newFuel,player,Epoch_personalToken] remoteExec ["EPOCH_server_fillVehicle",2]; - ["Fuel Added", 5] call Epoch_dynamicText; + ["Fuel Added", 5] call Epoch_message; }; }; }; @@ -200,10 +200,10 @@ switch _interactOption do { if (_item call _removeItem) then { _interactReturnOnUse call EPOCH_fnc_addItemOverflow; [_vehicle,_newFuel,player,Epoch_personalToken] remoteExec ["EPOCH_server_fillVehicle",2]; - ["Fuel Siphoned", 5] call Epoch_dynamicText; + ["Fuel Siphoned", 5] call Epoch_message; }; } else { - ["Not Enough Fuel", 5] call Epoch_dynamicText; + ["Not Enough Fuel", 5] call Epoch_message; }; } else { @@ -216,10 +216,10 @@ switch _interactOption do { if (_transportFuel > _canCapacity) then { if (_item call _removeItem) then { _interactReturnOnUse call EPOCH_fnc_addItemOverflow; - ["Fuel Siphoned", 5] call Epoch_dynamicText; + ["Fuel Siphoned", 5] call Epoch_message; }; } else { - ["Not Enough Fuel", 5] call Epoch_dynamicText; + ["Not Enough Fuel", 5] call Epoch_message; }; }; }; @@ -260,7 +260,7 @@ switch _interactOption do { [_vehicle,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2]; }; }; - ["Vehicle Partially Repaired", 5] call Epoch_dynamicText; + ["Vehicle Partially Repaired", 5] call Epoch_message; }; }; }; @@ -270,7 +270,7 @@ switch _interactOption do { if (_vehicle in _vehicles) then { if (_item call _removeItem) then { [_vehicle,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2]; - ["Vehicle Fully Repaired", 5] call Epoch_dynamicText; + ["Vehicle Fully Repaired", 5] call Epoch_message; }; }; }; @@ -293,13 +293,12 @@ switch _interactOption do { [_vehicle,_paintCanIndex,player,Epoch_personalToken] remoteExec ["EPOCH_server_paintBUILD",2]; - _msg = format["Wall Painted %1", _paintCanColor]; - [format["%1", _msg], 5] call Epoch_dynamicText; + [format["Wall Painted %1", _paintCanColor], 5] call Epoch_message; }; }; } else { - ["Disallowed", 5] call Epoch_dynamicText; + ["Disallowed", 5] call Epoch_message; }; }; }; @@ -311,14 +310,14 @@ switch _interactOption do { if (damage _vehicle != 0) then { if (_item call _removeItem) then { [_vehicle,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2]; - ["Healed other player", 5] call Epoch_dynamicText; + ["Healed other player", 5] call Epoch_message; }; }; } else { if (damage player != 0) then { if (_item call _removeItem) then { [player,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2]; - ["Healed yourself", 5] call Epoch_dynamicText; + ["Healed yourself", 5] call Epoch_message; }; }; }; @@ -327,11 +326,11 @@ switch _interactOption do { case 14: { // Unpack Backpack if (_item call _removeItem) then { [_interactReturnOnUse,player,Epoch_personalToken] remoteExec ["EPOCH_server_unpackBackpack",2]; - ["Unpacked backpack", 5] call Epoch_dynamicText; + ["Unpacked backpack", 5] call Epoch_message; }; }; default { - ["Found nothing", 5] call Epoch_dynamicText; + ["Found nothing", 5] call Epoch_message; }; }; diff --git a/Sources/epoch_code/compile/EPOCH_fish.sqf b/Sources/epoch_code/compile/EPOCH_fish.sqf index 4667bff1..a5cadd5d 100644 --- a/Sources/epoch_code/compile/EPOCH_fish.sqf +++ b/Sources/epoch_code/compile/EPOCH_fish.sqf @@ -30,7 +30,7 @@ if (surfaceIsWater _currentPos) then { EPOCH_myBobber = _bobber; } else { if (_bobber distance player > 12) then { - ["No bobber found within 12m.", 5] call Epoch_dynamicText; + ["No bobber found within 12m.", 5] call Epoch_message; } else { _castTime = _bobber getVariable ["EPOCH_bobberTime", diag_tickTime]; _diffTime = (diag_tickTime - _castTime) / 10; @@ -59,10 +59,10 @@ if (surfaceIsWater _currentPos) then { _fish = selectRandom _fishes; if (_fish != "") then { _fish call EPOCH_fnc_addItemOverflow; - ["Fish Caught", 5] call Epoch_dynamicText; + ["Fish Caught", 5] call Epoch_message; }; } else { - ["Fish Got Away", 5] call Epoch_dynamicText; + ["Fish Got Away", 5] call Epoch_message; }; }; }; diff --git a/Sources/epoch_code/compile/EPOCH_handleServerMessage.sqf b/Sources/epoch_code/compile/EPOCH_handleServerMessage.sqf index 0bf26628..2bb1bb41 100644 --- a/Sources/epoch_code/compile/EPOCH_handleServerMessage.sqf +++ b/Sources/epoch_code/compile/EPOCH_handleServerMessage.sqf @@ -17,5 +17,5 @@ */ if (isLocalized (_this select 0)) then{ - [format["%1", format[localize (_this select 0), _this select 1]], 5] call Epoch_dynamicText; + [format["%1", format[localize (_this select 0), _this select 1]], 5] call Epoch_message; }; diff --git a/Sources/epoch_code/compile/EPOCH_lootTrash.sqf b/Sources/epoch_code/compile/EPOCH_lootTrash.sqf index 4001fe63..a7fb3e65 100644 --- a/Sources/epoch_code/compile/EPOCH_lootTrash.sqf +++ b/Sources/epoch_code/compile/EPOCH_lootTrash.sqf @@ -74,13 +74,13 @@ if (diag_tickTime - EPOCH_lastTrash > 2) then { // send [_lootAnimalObj, player, Epoch_personalToken] remoteExec ["EPOCH_server_lootAnimal",2]; _return = true; - ["Object Looted", 5] call Epoch_dynamicText; + ["Object Looted", 5] call Epoch_message; }; if (!isNull _destroyTrashObj) then { [_destroyTrashObj, _trashType, player, Epoch_personalToken] remoteExec ["EPOCH_server_destroyTrash",2]; EPOCH_playerSoiled = (EPOCH_playerSoiled + 1) min 100; _return = true; - ["Object Looted", 5] call Epoch_dynamicText; + ["Object Looted", 5] call Epoch_message; // Snake Den if (random 1 < 0.04) then { diff --git a/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf b/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf index 9a773621..9b6a11af 100644 --- a/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf +++ b/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf @@ -44,13 +44,13 @@ _config = 'CfgEpochClient' call EPOCH_returnConfig; _jammerRange = getNumber(_config >> "buildingJammerRange"); _jammers = nearestObjects[_targetPos, ["PlotPole_EPOCH"], _jammerRange]; if(count _jammers > 0 && (_unitClass in _nonJammer))exitWith{ - if(_doVariable)then{["Not allowed near a base - Please respawn !", 5] call Epoch_dynamicText;}; + if(_doVariable)then{["Not allowed near a base - Please respawn !", 5] call Epoch_message;}; }; _restricted = []; _restricted = nearestObjects [_targetPos, ["ProtectionZone_Invisible_F"], _nonTraderAIRange]; if(count _restricted > 0 && (_unitClass in _nonTrader))exitWith{ - if(_doVariable)then{["Not allowed near a trader - Please respawn !", 5] call Epoch_dynamicText;}; + if(_doVariable)then{["Not allowed near a trader - Please respawn !", 5] call Epoch_message;}; }; _disableAI = { diff --git a/Sources/epoch_code/compile/building/EPOCH_changeWallState.sqf b/Sources/epoch_code/compile/building/EPOCH_changeWallState.sqf index b7cdd508..61fc9d8f 100644 --- a/Sources/epoch_code/compile/building/EPOCH_changeWallState.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_changeWallState.sqf @@ -97,9 +97,9 @@ if !(isNull _object) then{ _object animate[_anim, _state, true]; // push interacted object to queue to save later EPOCH_arr_interactedObjs pushBackUnique _object; - [format["%1 part on %2", "Added", _objClass call EPOCH_itemDisplayName], 5] call Epoch_dynamicText; + [format["%1 part on %2", "Added", _objClass call EPOCH_itemDisplayName], 5] call Epoch_message; } else { - [format["%1", _msg], 5] call Epoch_dynamicText; + [_msg, 5] call Epoch_message; }; } else { // Remove part @@ -118,6 +118,6 @@ if !(isNull _object) then{ _craftItem call EPOCH_fnc_addItemOverflow; }; }forEach _recipe; - [format["%1 part on %2", "Removed", _objClass call EPOCH_itemDisplayName], 5] call Epoch_dynamicText; + [format["%1 part on %2", "Removed", _objClass call EPOCH_itemDisplayName], 5] call Epoch_message; }; }; diff --git a/Sources/epoch_code/compile/building/EPOCH_checkBuild.sqf b/Sources/epoch_code/compile/building/EPOCH_checkBuild.sqf index 7d3b9aa7..78f6cacd 100644 --- a/Sources/epoch_code/compile/building/EPOCH_checkBuild.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_checkBuild.sqf @@ -33,7 +33,7 @@ if (isNull _object) exitWith{ _out }; if ((player distance _object) > 9) exitWith { _out }; if !(EPOCH_buildMode > 0) exitWith {_out}; -if (EPOCH_playerEnergy <= 0) exitWith{ ["Need energy", 5] call Epoch_dynamicText; _out }; +if (EPOCH_playerEnergy <= 0) exitWith{ ["Need energy", 5] call Epoch_message; _out }; _objType = typeOf _object; _config = 'CfgBaseBuilding' call EPOCH_returnConfig; diff --git a/Sources/epoch_code/compile/building/EPOCH_fnc_SelectTargetBuild.sqf b/Sources/epoch_code/compile/building/EPOCH_fnc_SelectTargetBuild.sqf index 0d56b102..4d293d8e 100644 --- a/Sources/epoch_code/compile/building/EPOCH_fnc_SelectTargetBuild.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_fnc_SelectTargetBuild.sqf @@ -25,7 +25,7 @@ private ["_targeter","_stability"]; if !(isNil "EPOCH_simulSwap_Lock") exitWith{ false }; if !(isNull EPOCH_Target) exitWith{ false }; -if (EPOCH_playerEnergy <= 0) exitWith{ ["Need energy", 5] call Epoch_dynamicText; false }; +if (EPOCH_playerEnergy <= 0) exitWith{ ["Need energy", 5] call Epoch_message; false }; params [["_object",objNull]]; diff --git a/Sources/epoch_code/compile/building/EPOCH_isBuildAllowed.sqf b/Sources/epoch_code/compile/building/EPOCH_isBuildAllowed.sqf index 7af6a5fc..e9c2ae11 100644 --- a/Sources/epoch_code/compile/building/EPOCH_isBuildAllowed.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_isBuildAllowed.sqf @@ -29,7 +29,7 @@ _ownedJammerExists = false; _nearestJammer = objNull; // reject building if in vehicle -if (vehicle player != player)exitWith{["Building Disallowed: Inside Vehicle", 5] call Epoch_dynamicText; false }; +if (vehicle player != player)exitWith{["Building Disallowed: Inside Vehicle", 5] call Epoch_message; false }; // defaults _config = 'CfgEpochClient' call EPOCH_returnConfig; @@ -58,7 +58,7 @@ if !(_jammer isEqualTo []) then { { if (alive _x) exitWith{ _buildingAllowed = false; - ["Building Disallowed: Existing Jammer Signal", 5] call Epoch_dynamicText; + ["Building Disallowed: Existing Jammer Signal", 5] call Epoch_message; }; } foreach _jammer; } else { @@ -74,12 +74,12 @@ if !(_jammer isEqualTo []) then { _ownedJammerExists = true; } else { _buildingAllowed = false; - ["Building Disallowed: Frequency Blocked", 5] call Epoch_dynamicText; + ["Building Disallowed: Frequency Blocked", 5] call Epoch_message; }; _objectCount = count nearestObjects[_nearestJammer, ["Constructions_static_F"], _buildingJammerRange]; if (_objectCount >= _buildingCountLimit) then { _buildingAllowed = false; - ["Building Disallowed: Frequency Overloaded", 5] call Epoch_dynamicText; + ["Building Disallowed: Frequency Overloaded", 5] call Epoch_message; }; }; }; @@ -96,7 +96,7 @@ if (!_ownedJammerExists) then{ // TODO: not properly limiting simulated objects if (_objectCount >= _limitNearby) then{ _buildingAllowed = false; - [format["Building Disallowed: Limit %1", _limitNearby], 5] call Epoch_dynamicText; + [format["Building Disallowed: Limit %1", _limitNearby], 5] call Epoch_message; }; }; }; @@ -107,7 +107,7 @@ if (getNumber(_config >> "buildingRequireJammer") == 0 && _bypassJammer == 0) th if !(_objType in ["PlotPole_EPOCH", "PlotPole_SIM_EPOCH"]) then { _buildingAllowed = _ownedJammerExists; if !(_buildingAllowed) then { - ["Building Disallowed: Frequency Jammer Needed", 5] call Epoch_dynamicText; + ["Building Disallowed: Frequency Jammer Needed", 5] call Epoch_message; }; }; }; @@ -126,20 +126,20 @@ if (getNumber(_config >> "buildingNearbyMilitary") == 0) then{ }; if !(_restricted isEqualTo []) then { _buildingAllowed = false; - ["Building Disallowed: Protected Frequency", 5] call Epoch_dynamicText; + ["Building Disallowed: Protected Frequency", 5] call Epoch_message; }; _restrictedLocations = nearestLocations [player, ["NameCityCapital"], 300]; if !(_restrictedLocations isEqualTo []) then { _buildingAllowed = false; - ["Building Disallowed: Protected Frequency", 5] call Epoch_dynamicText; + ["Building Disallowed: Protected Frequency", 5] call Epoch_message; }; _myPosATL = getPosATL player; { if ((_x select 0) distance _myPosATL < (_x select 1)) exitWith { _buildingAllowed = false; - ["Building Disallowed: Protected Frequency", 5] call Epoch_dynamicText; + ["Building Disallowed: Protected Frequency", 5] call Epoch_message; }; } forEach(getArray(_config >> worldname >> "blockedArea")); diff --git a/Sources/epoch_code/compile/building/EPOCH_maintainIT.sqf b/Sources/epoch_code/compile/building/EPOCH_maintainIT.sqf index fb9ad95f..3440a405 100644 --- a/Sources/epoch_code/compile/building/EPOCH_maintainIT.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_maintainIT.sqf @@ -22,7 +22,7 @@ NOTHING */ private ["_buildingJammerRange","_maintainCount","_rnd","_config"]; -if !(isNil "EPOCH_maintainLockout") exitWith {["Already Maintaining a base.", 5] call Epoch_dynamicText;}; +if !(isNil "EPOCH_maintainLockout") exitWith {["Already Maintaining a base.", 5] call Epoch_message;}; if (EPOCH_playerCrypto > 0) then { _config = "CfgEpochClient" call EPOCH_returnConfig; _buildingJammerRange = getNumber(_config >> "buildingJammerRange"); @@ -51,10 +51,10 @@ if (EPOCH_playerCrypto > 0) then { EPOCH_maintainLockout = nil; }; - [format["Cost %1 Krypto to maintain base.", _maintainCount], 5] call Epoch_dynamicText; + [format["Cost %1 Krypto to maintain base.", _maintainCount], 5] call Epoch_message; } else { - ["Nothing needs Maintaining", 5] call Epoch_dynamicText; + ["Nothing needs Maintaining", 5] call Epoch_message; }; } else { - ["You need Krypto to maintain a base.", 5] call Epoch_dynamicText; + ["You need Krypto to maintain a base.", 5] call Epoch_message; }; diff --git a/Sources/epoch_code/compile/building/EPOCH_removeBUILD.sqf b/Sources/epoch_code/compile/building/EPOCH_removeBUILD.sqf index e1ad7f7d..86d4c03c 100644 --- a/Sources/epoch_code/compile/building/EPOCH_removeBUILD.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_removeBUILD.sqf @@ -58,7 +58,7 @@ if (_stability > 0) exitWith{ if (_objType == "PlotPole_EPOCH") then { if ((_object getVariable["BUILD_OWNER", "-1"]) != getPlayerUID player) then{ _buildingAllowed = false; - ["Remove Disallowed: Frequency Blocked", 5] call Epoch_dynamicText; + ["Remove Disallowed: Frequency Blocked", 5] call Epoch_message; }; } else { @@ -75,7 +75,7 @@ else { _ownedJammerExists = true; } else { _buildingAllowed = false; - ["Remove Disallowed: Frequency Blocked", 5] call Epoch_dynamicText; + ["Remove Disallowed: Frequency Blocked", 5] call Epoch_message; }; }; }; @@ -87,6 +87,6 @@ _removeParts = getArray(('CfgBaseBuilding' call EPOCH_returnConfig) >> _objType if !(_removeParts isEqualTo[]) then{ [_this, player, Epoch_personalToken] remoteExec ["EPOCH_server_removeBUILD",2]; _return = true; - ["Removed", 5] call Epoch_dynamicText; + ["Removed", 5] call Epoch_message; }; _return diff --git a/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf b/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf index 9199bd0b..6a245f37 100644 --- a/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_simulSwap.sqf @@ -32,7 +32,7 @@ _objType = typeOf _object; _isSnap = false; if (EPOCH_playerEnergy <= 0) exitWith { - ["Need Energy", 5] call Epoch_dynamicText; + ["Need Energy", 5] call Epoch_message; }; if !(_objType call EPOCH_isBuildAllowed) exitWith{}; diff --git a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf index 9b2154a1..822f7406 100644 --- a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf @@ -35,7 +35,7 @@ if (isNull _object) exitWith{ EPOCH_target = objNull; }; if (_item == "") exitWith{ EPOCH_target = objNull; }; if (EPOCH_playerEnergy <= 0) exitWith{ - ["Need Energy", 5] call Epoch_dynamicText; + ["Need Energy", 5] call Epoch_message; }; // Remove object if not allowed diff --git a/Sources/epoch_code/compile/building/EPOCH_upgradeBUILD.sqf b/Sources/epoch_code/compile/building/EPOCH_upgradeBUILD.sqf index 4d50a71a..2fdab86e 100644 --- a/Sources/epoch_code/compile/building/EPOCH_upgradeBUILD.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_upgradeBUILD.sqf @@ -71,7 +71,7 @@ if !(_jammer isEqualTo[]) then { } else { _buildingAllowed = false; - ["Upgrade Disallowed: Frequency Blocked", 5] call Epoch_dynamicText; + ["Upgrade Disallowed: Frequency Blocked", 5] call Epoch_message; }; }; }; @@ -123,10 +123,10 @@ if (_object isKindOf "Constructions_static_F") then { [_object,player,Epoch_upgradeIndex,Epoch_personalToken] remoteExec ["EPOCH_server_upgradeBUILD",2]; Epoch_upgradeIndex = nil; _return = true; - ["Upgraded", 5] call Epoch_dynamicText; + ["Upgraded", 5] call Epoch_message; }; } else { - [format["%1", _missingParts], 5] call Epoch_dynamicText; + [_missingParts, 5] call Epoch_message; }; }; }; diff --git a/Sources/epoch_code/compile/functions/EPOCH_fnc_playerDeath.sqf b/Sources/epoch_code/compile/functions/EPOCH_fnc_playerDeath.sqf index d2f12f61..f0a63744 100644 --- a/Sources/epoch_code/compile/functions/EPOCH_fnc_playerDeath.sqf +++ b/Sources/epoch_code/compile/functions/EPOCH_fnc_playerDeath.sqf @@ -45,7 +45,7 @@ if (Epoch_canBeRevived) then { createDialog _tapDiag; } else { setPlayerRespawnTime 15; - ["You can be just revived once per life!", 5] call Epoch_dynamicText; + ["You can be just revived once per life!", 5] call Epoch_message; }; [_killer, _tapDiag] spawn{ diff --git a/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf b/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf index 0b8daf98..a0820246 100644 --- a/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf +++ b/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf @@ -42,13 +42,13 @@ if (_dikCode in [0x02,0x03,0x04,0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3 if (_ctrl && _dikCode == EPOCH_keysVolumeUp) then { EPOCH_soundLevel = (EPOCH_soundLevel + 0.1) min 1; 5 fadeSound EPOCH_soundLevel; - [format["Internal sound level: %1%2 ", EPOCH_soundLevel * 100, "%"], 5] call Epoch_dynamicText; + [format["Internal sound level: %1%2", EPOCH_soundLevel * 100, "%"], 5] call Epoch_message; }; // lower vol if (_ctrl && _dikCode == EPOCH_keysVolumeDown) then { EPOCH_soundLevel = (EPOCH_soundLevel - 0.1) max 0.1; 5 fadeSound EPOCH_soundLevel; - [format["Internal sound level: %1%2 ", EPOCH_soundLevel * 100,"%"], 5] call Epoch_dynamicText; + [format["Internal sound level: %1%2", EPOCH_soundLevel * 100,"%"], 5] call Epoch_message; }; // ESC default to cancel @@ -59,7 +59,7 @@ if (_dikCode == 0x01) then { } else { EPOCH_Target = objNull; }; - ["Build Canceled", 5] call Epoch_dynamicText; + ["Build Canceled", 5] call Epoch_message; }; if !(EPOCH_arr_interactedObjs isEqualTo[]) then { [EPOCH_arr_interactedObjs] remoteExec["EPOCH_server_save_vehicles", 2]; @@ -71,9 +71,9 @@ if (_dikCode == 0x01) then { if (_dikCode == EPOCH_keysDebugMon) then { EPOCH_debugMode = !EPOCH_debugMode; if (EPOCH_debugMode) then { - ["Debug Mode Enabled", 5] call Epoch_dynamicText; + ["Debug Mode Enabled", 5] call Epoch_message; } else { - ["Debug Mode Disabled", 5] call Epoch_dynamicText; + ["Debug Mode Disabled", 5] call Epoch_message; hintSilent ""; }; _handled = true; @@ -100,7 +100,7 @@ if (vehicle player == player) then { _disableBuildMode = { EPOCH_buildMode = 0; EPOCH_snapDirection = 0; - ["Build Mode Disabled", 5] call Epoch_dynamicText; + ["Build Mode Disabled", 5] call Epoch_message; EPOCH_Target = objNull; EPOCH_Z_OFFSET = 0; EPOCH_X_OFFSET = 0; @@ -113,10 +113,10 @@ if (vehicle player == player) then { if (EPOCH_playerEnergy > 0) then { EPOCH_stabilityTarget = objNull; EPOCH_buildMode = 1; - ["Build Mode Enabled: Snap alignment", 5] call Epoch_dynamicText; + ["Build Mode Enabled: Snap alignment", 5] call Epoch_message; EPOCH_buildDirection = 0; } else { - ["Need Energy", 5] call Epoch_dynamicText; + ["Need Energy", 5] call Epoch_message; }; }; _handled = true; @@ -128,11 +128,11 @@ if (vehicle player == player) then { if (EPOCH_playerEnergy > 0) then { EPOCH_stabilityTarget = objNull; EPOCH_buildMode = 2; - ["Build Mode Enabled: Free", 5] call Epoch_dynamicText; + ["Build Mode Enabled: Free", 5] call Epoch_message; EPOCH_buildDirection = 0; } else { - ["Need Energy", 5] call Epoch_dynamicText; + ["Need Energy", 5] call Epoch_message; }; }; _handled = true; @@ -158,10 +158,10 @@ if (vehicle player == player) then { EPOCH_snapDirection = EPOCH_snapDirection + 1; if (EPOCH_snapDirection > 3) then { EPOCH_snapDirection = 0; - ["SNAP DIRECTION MODE: 0", 5] call Epoch_dynamicText; + ["SNAP DIRECTION MODE: 0", 5] call Epoch_message; } else { - [format["SNAP DIRECTION MODE: %1", EPOCH_snapDirection], 5] call Epoch_dynamicText; + [format["SNAP DIRECTION MODE: %1", EPOCH_snapDirection], 5] call Epoch_message; }; _handled = true; }; @@ -241,7 +241,7 @@ if (vehicle player == player) then { } else { EPOCH_Target = objNull; }; - ["Build Canceled", 5] call Epoch_dynamicText; + ["Build Canceled", 5] call Epoch_message; }; if (isTouchingGround player) then { // _handled = call EPOCH_lootTrash; diff --git a/Sources/epoch_code/compile/missions/EPOCH_mission_accept.sqf b/Sources/epoch_code/compile/missions/EPOCH_mission_accept.sqf index a0391ab4..5170ac97 100644 --- a/Sources/epoch_code/compile/missions/EPOCH_mission_accept.sqf +++ b/Sources/epoch_code/compile/missions/EPOCH_mission_accept.sqf @@ -93,7 +93,7 @@ _menuCondition = getText(getMissionConfig "epochMissions" >> (_missionClasses se _doTask = _uiNSTask; }else{ _allowTask = false; - [format ["Already on a mission - %1",selectRandom ['Chop Chop !','Get on With It !','What are you waiting for ?','No bonuses for tardiness !']], 5] call Epoch_dynamicText; + [format ["Already on a mission - %1",selectRandom ['Chop Chop !','Get on With It !','What are you waiting for ?','No bonuses for tardiness !']], 5] call Epoch_message; }; }; @@ -105,12 +105,12 @@ _menuCondition = getText(getMissionConfig "epochMissions" >> (_missionClasses se }else{ - [format["Mission Not Allowed !",_menuCondition], 5] call Epoch_dynamicText; + [format["Mission Not Allowed !",_menuCondition], 5] call Epoch_message; //Not formatting, is this intended? }; } else { //systemChat format ["Trader Not Found",""]; -["Trader Lost. Goodbye.", 5] call Epoch_dynamicText; +["Trader Lost. Goodbye.", 5] call Epoch_message; }; diff --git a/Sources/epoch_code/compile/missions/tasks/traderDebug_resetMissions.sqf b/Sources/epoch_code/compile/missions/tasks/traderDebug_resetMissions.sqf index 7079dc55..2b07e40f 100644 --- a/Sources/epoch_code/compile/missions/tasks/traderDebug_resetMissions.sqf +++ b/Sources/epoch_code/compile/missions/tasks/traderDebug_resetMissions.sqf @@ -1,2 +1,2 @@ missionNamespace setVariable ["EPOCH_playerMissionArray",[]]; -[format ["%1","Missions Reset - Re-open Trader Menu."], 5] call Epoch_dynamicText; +["Missions Reset - Re-open Trader Menu.", 5] call Epoch_message; diff --git a/Sources/epoch_code/compile/missions/tasks/traderDiag_name.sqf b/Sources/epoch_code/compile/missions/tasks/traderDiag_name.sqf index 47dfd8f1..c9020341 100644 --- a/Sources/epoch_code/compile/missions/tasks/traderDiag_name.sqf +++ b/Sources/epoch_code/compile/missions/tasks/traderDiag_name.sqf @@ -12,4 +12,4 @@ _trader setVariable ["traderName",_newName, true]; }; _responseArr = ["I don't know. You can only be regenerated so many times before the memory starts to go..","You again..! Go bother someone else.",format["There was a time when names mattered, call me %1.",name _trader],"My name..? What does it matter.","Hey buddy you rock up here unannounced and suddenly we're friends ? On your bike if you aren't buying or selling.",format["My name.. I am known as %1",name _trader], format["When names mattered I was called %1",name _trader],"I forget.. At least, I try to forget."]; -[format ["%1",selectRandom _responseArr], 5] call Epoch_dynamicText; \ No newline at end of file +[selectRandom _responseArr, 5] call Epoch_message; \ No newline at end of file diff --git a/Sources/epoch_code/compile/missions/tasks/traderDiag_nearPlayers.sqf b/Sources/epoch_code/compile/missions/tasks/traderDiag_nearPlayers.sqf index 0b953e52..173193eb 100644 --- a/Sources/epoch_code/compile/missions/tasks/traderDiag_nearPlayers.sqf +++ b/Sources/epoch_code/compile/missions/tasks/traderDiag_nearPlayers.sqf @@ -9,4 +9,4 @@ if (count _plyrs < 2) then { _plyr = selectRandom _plyrs; _trdrMsg = format["%2 %1.",name _plyr, selectRandom ["The last person picked up by the UAV was","I did spot someone earlier, their name was","I heard there was somebody new in the area, "]]; }; -[format ["%1",_trdrMsg], 5] call Epoch_dynamicText; \ No newline at end of file +[_trdrMsg, 5] call Epoch_message; \ No newline at end of file diff --git a/Sources/epoch_code/compile/missions/tasks/traderDiag_nearVehicles.sqf b/Sources/epoch_code/compile/missions/tasks/traderDiag_nearVehicles.sqf index 72b5b481..80ccf515 100644 --- a/Sources/epoch_code/compile/missions/tasks/traderDiag_nearVehicles.sqf +++ b/Sources/epoch_code/compile/missions/tasks/traderDiag_nearVehicles.sqf @@ -10,4 +10,4 @@ if (count _vehs < 1) then { _dist = _veh distance _plyr; _trdrMsg = format["I know of at least one vehicle within %1m of my current location. It looks like a %2.",_dist, typeof _veh]; }; -[format ["%1",_trdrMsg], 5] call Epoch_dynamicText; \ No newline at end of file +[_trdrMsg, 5] call Epoch_message; \ No newline at end of file diff --git a/Sources/epoch_code/compile/missions/tasks/traderDiag_news.sqf b/Sources/epoch_code/compile/missions/tasks/traderDiag_news.sqf index d2a36326..d08b9884 100644 --- a/Sources/epoch_code/compile/missions/tasks/traderDiag_news.sqf +++ b/Sources/epoch_code/compile/missions/tasks/traderDiag_news.sqf @@ -1,3 +1,3 @@ _newsArr = ["My dog was shot. That made me sad.","Business has been quiet since word got out that sappers are in the area.","Looters are expecting too much crypto for all the junk they bring in.","What do I look like ? A newspaper vendor. Go Away.","The sun came up again this morning.. That's good news I suppose.","Keep your dog fed with raw or cooked carcasses.","Sappers are known to be good for their pelts. Just don't get too close to one","Some very strange rumours that a Construct was seen in the mountains. Those things are just bedtime stories to scare kids with.","UAVs are a good source of components.","Some say the nearby town is haunted by malevolent spirits.","I hear the military are helping survivors with air drops. Your loot is always welcome here if you find one.","Dogs can help you find pelts and animal carcasses","I heard that a new vehicle has been seen, some kind of board that you stand on. I personally don't believe the rumours."]; -[format ["%1",selectRandom _newsArr], 5] call Epoch_dynamicText; \ No newline at end of file +[selectRandom _newsArr, 5] call Epoch_message; \ No newline at end of file diff --git a/Sources/epoch_code/compile/missions/tasks/traderDiag_timePlease.sqf b/Sources/epoch_code/compile/missions/tasks/traderDiag_timePlease.sqf index b819101f..88f5485c 100644 --- a/Sources/epoch_code/compile/missions/tasks/traderDiag_timePlease.sqf +++ b/Sources/epoch_code/compile/missions/tasks/traderDiag_timePlease.sqf @@ -10,4 +10,4 @@ if(count _min < 2)then{ _min = "0" + _min; }; -[format ["The time is %1:%2.",_hour, _min], 5] call Epoch_dynamicText; \ No newline at end of file +[format ["The time is %1:%2.",_hour, _min], 5] call Epoch_message; \ No newline at end of file diff --git a/Sources/epoch_code/compile/missions/tasks/traderDiag_triggerAirDrop.sqf b/Sources/epoch_code/compile/missions/tasks/traderDiag_triggerAirDrop.sqf index 503dc8c8..a2e3989c 100644 --- a/Sources/epoch_code/compile/missions/tasks/traderDiag_triggerAirDrop.sqf +++ b/Sources/epoch_code/compile/missions/tasks/traderDiag_triggerAirDrop.sqf @@ -1,6 +1,6 @@ if((random 100) < 6)then{ [] execFSM "\x\addons\a3_epoch_code\System\Event_Air_Drop.fsm"; -["Air Drop Incoming !", 5] call Epoch_dynamicText; +["Air Drop Incoming !", 5] call Epoch_message; }else{ -["Sorry, None Available!", 5] call Epoch_dynamicText; +["Sorry, None Available!", 5] call Epoch_message; }; \ No newline at end of file diff --git a/Sources/epoch_code/compile/p2p_trading/EPOCH_tradeRequest.sqf b/Sources/epoch_code/compile/p2p_trading/EPOCH_tradeRequest.sqf index 42e66b78..37cf244f 100644 --- a/Sources/epoch_code/compile/p2p_trading/EPOCH_tradeRequest.sqf +++ b/Sources/epoch_code/compile/p2p_trading/EPOCH_tradeRequest.sqf @@ -15,7 +15,7 @@ if !(isNull _this) then { // ignore request if either player is in a vehicle if (vehicle player == player && vehicle _this == _this) then { - ["Trade request received, press 'T' to accept", 5] call Epoch_dynamicText; + ["Trade request received, press 'T' to accept", 5] call Epoch_message; EPOCH_pendingP2ptradeTarget = _this; }; }; diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf index 95bada6c..1e96ceb4 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf @@ -62,7 +62,7 @@ if (_vehicle == player) then { if (EPOCH_buildMode > 0) then { EPOCH_buildMode = 0; EPOCH_snapDirection = 0; - [format["BUILD MODE:%1","DISABLED"], 5] call Epoch_dynamicText; + ["BUILD MODE: DISABLED", 5] call Epoch_message; EPOCH_Target = objNull; }; _increaseStamina = true; diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf index 66ca1a48..4642adb1 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf @@ -53,7 +53,7 @@ if (EPOCH_playerEnergy == 0) then { if (EPOCH_buildMode > 0) then { EPOCH_buildMode = 0; EPOCH_snapDirection = 0; - ["Build Mode Disabled: Need Energy< / t>", 5] call Epoch_dynamicText; + ["Build Mode Disabled: Need Energy", 5] call Epoch_message; EPOCH_Target = objNull; EPOCH_Z_OFFSET = 0; EPOCH_X_OFFSET = 0; diff --git a/Sources/epoch_code/compile/traders/EPOCH_npcTraderAdd.sqf b/Sources/epoch_code/compile/traders/EPOCH_npcTraderAdd.sqf index 3eafa1b0..f9816cb9 100644 --- a/Sources/epoch_code/compile/traders/EPOCH_npcTraderAdd.sqf +++ b/Sources/epoch_code/compile/traders/EPOCH_npcTraderAdd.sqf @@ -90,9 +90,9 @@ if !(isNull EPOCH_lastNPCtradeTarget) then { ctrlSetText[41005, (format["%1 Krypto", _cryptoCount])]; } else { if (_stockLimit) then{ - ["Trader has the maximum amount of this item", 5] call Epoch_dynamicText; + ["Trader has the maximum amount of this item", 5] call Epoch_message; } else { - ["Limit one per trade", 5] call Epoch_dynamicText; + ["Limit one per trade", 5] call Epoch_message; }; }; }; diff --git a/Sources/epoch_code/compile/traders/EPOCH_npcTraderAdd2.sqf b/Sources/epoch_code/compile/traders/EPOCH_npcTraderAdd2.sqf index 7b5a5143..3fcd0373 100644 --- a/Sources/epoch_code/compile/traders/EPOCH_npcTraderAdd2.sqf +++ b/Sources/epoch_code/compile/traders/EPOCH_npcTraderAdd2.sqf @@ -81,6 +81,6 @@ if (isClass (_config >> _uiItem)) then{ }; ctrlSetText [41005, (format ["%1 Krypto", _cryptoCount])]; } else { - ["Limit one per trade", 5] call Epoch_dynamicText; + ["Limit one per trade", 5] call Epoch_message; }; }; diff --git a/Sources/epoch_code/compile/traders/EPOCH_startNpcTrade.sqf b/Sources/epoch_code/compile/traders/EPOCH_startNpcTrade.sqf index 1fa833eb..51b3b9a7 100644 --- a/Sources/epoch_code/compile/traders/EPOCH_startNpcTrade.sqf +++ b/Sources/epoch_code/compile/traders/EPOCH_startNpcTrade.sqf @@ -125,13 +125,10 @@ if (alive _this) then { // SOLD ITEMS ARRAY if !((EPOCH_TRADE_COMPLETE select 0) isEqualTo[]) then { if ((EPOCH_TRADE_COMPLETE select 0) isEqualTo(_this select 0)) then { - _errorMsg = 'Items Sold'; - [format["%1", _errorMsg], 5] call Epoch_dynamicText; - + ['Items Sold', 5] call Epoch_message; } else { - _errorMsg = 'Failed To Sell Items'; - [format["%1", _errorMsg], 5] call Epoch_dynamicText; + ['Failed To Sell Items', 5] call Epoch_message; }; }; @@ -179,11 +176,10 @@ if (alive _this) then { }; } forEach(_this select 1); - [format["%1", _errorMsg], 5] call Epoch_dynamicText; + [_errorMsg, 5] call Epoch_message; } else { - _errorMsg = 'Failed To Purchase Items'; - [format["%1", _errorMsg], 5] call Epoch_dynamicText; + ['Failed To Purchase Items', 5] call Epoch_message; }; }; diff --git a/Sources/epoch_code/compile/traders/EPOCH_takeCrypto.sqf b/Sources/epoch_code/compile/traders/EPOCH_takeCrypto.sqf index f302d382..72ad2526 100644 --- a/Sources/epoch_code/compile/traders/EPOCH_takeCrypto.sqf +++ b/Sources/epoch_code/compile/traders/EPOCH_takeCrypto.sqf @@ -5,7 +5,7 @@ if (!isNull _this) then { if ((typeof _this) == "Land_MPS_EPOCH") then { _getCrypto = _this getVariable["Crypto", 0]; [player, Epoch_personalToken, _this] remoteExec ["EPOCH_server_takeCrypto",2]; - [format["You found %1 Krypto.", _getCrypto], 5] call Epoch_dynamicText; + [format["You found %1 Krypto.", _getCrypto], 5] call Epoch_message; }; }; [] spawn{ diff --git a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnMod.sqf b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnMod.sqf index 0eafbd83..40b2f457 100644 --- a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnMod.sqf +++ b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnMod.sqf @@ -35,7 +35,7 @@ if (getPlayerUID player == Epoch_my_GroupUID) then { }; }; } else { - ["You need to select a player!", 5] call Epoch_dynamicText; + ["You need to select a player!", 5] call Epoch_message; }; true } else { diff --git a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_invitePlayer.sqf b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_invitePlayer.sqf index abd7a46e..4f1350b4 100644 --- a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_invitePlayer.sqf +++ b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_invitePlayer.sqf @@ -14,5 +14,5 @@ */ if !(_this in Epoch_invited_GroupUIDs) then { Epoch_invited_GroupUIDs pushBack _this; - ["Group request received", 5] call Epoch_dynamicText; + ["Group request received", 5] call Epoch_message; }; diff --git a/Sources/epoch_code/gui/scripts/inventory/EPOCH_Inventory_iGroup.sqf b/Sources/epoch_code/gui/scripts/inventory/EPOCH_Inventory_iGroup.sqf index aa908f56..1b618799 100644 --- a/Sources/epoch_code/gui/scripts/inventory/EPOCH_Inventory_iGroup.sqf +++ b/Sources/epoch_code/gui/scripts/inventory/EPOCH_Inventory_iGroup.sqf @@ -17,4 +17,4 @@ disableSerialization; if !(Epoch_invited_GroupUIDs isEqualTo[]) exitWith { createDialog "GroupRequests"; }; -["No pending requests< / t>", 5] call Epoch_dynamicText; +["No pending requests", 5] call Epoch_message; diff --git a/Sources/epoch_code/gui/scripts/messaging/Epoch_message.sqf b/Sources/epoch_code/gui/scripts/messaging/Epoch_message.sqf new file mode 100644 index 00000000..b99ef479 --- /dev/null +++ b/Sources/epoch_code/gui/scripts/messaging/Epoch_message.sqf @@ -0,0 +1,147 @@ +/* + Author: Raimonds Virtoss - EpochMod.com + + Description: + Displays custom text message to player + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/scripts/Epoch_dynamicText.sqf + + Usage: + "TEST" call Epoch_message + + TODO: Add colors +*/ +#include "\A3\ui_f\hpp\defineCommonGrids.inc" +_msg = param [0, "No input"]; +_time = param [1, 2]; + +if !(_msg isEqualType "STRING") then {_msg = str (parseText _msg)}; + +if !(isNil "rmx_var_msgQueue") exitWith { rmx_var_msgQueue pushBack [_msg, _time];}; + +rmx_var_msgQueue = [[_msg, _time]]; + +[] spawn { + private ["_c1pos","_c2pos","_c3pos","_clr","_dsp"]; + + disableSerialization; + + _dsp = findDisplay 46; + + _yPos = 15; + _ySize = 2; + _c1StartPos = [safeZoneX,((_yPos - _ySize) * GUI_GRID_H + GUI_GRID_Y),safeZoneW, _ySize * GUI_GRID_H]; + _c1pos = [safeZoneX,(_yPos * GUI_GRID_H + GUI_GRID_Y),safeZoneW, _ySize * GUI_GRID_H]; + _c2pos = [safeZoneX,((_yPos + _ySize) * GUI_GRID_H + GUI_GRID_Y),safeZoneW, _ySize * GUI_GRID_H]; + _c3pos = [safeZoneX,((_yPos + _ySize * 2) * GUI_GRID_H + GUI_GRID_Y),safeZoneW, _ySize * GUI_GRID_H]; + + _getClr = call Epoch_getColorScheme; + _clr = [_getClr select 0, _getClr select 1, _getClr select 2, 0.2]; + + //Start anim + _msg = ""; + _time = (rmx_var_msgQueue select 0 select 1); + + _fnc_animFirst = { + private "_ctrl"; + + _ctrl = param [0]; + _msg = param [1]; + _ctrl ctrlSetBackgroundColor [_clr select 0, _clr select 1, _clr select 2, 0.2]; + _ctrl ctrlSetText _msg; + + _ctrl ctrlSetPosition _c1StartPos; + _ctrl ctrlSetFade 1; + _ctrl ctrlCommit 0; + + _ctrl ctrlSetPosition _c1pos; + _ctrl ctrlSetFade 0; + _ctrl ctrlCommit 0.3; + }; + + _fnc_animShiftCtrl = { + private ["_ctrl", "_fade", "_fontSize", "_pos"]; + _ctrl = param [0]; + _fade = param [1]; + _fontSize = param [2]; + _pos = param [3]; + + _ctrl ctrlSetPosition _pos; + _ctrl ctrlSetFontHeight _fontSize; + _ctrl ctrlSetFade _fade; + _ctrl ctrlCommit 0.3; + }; + + _tick = diag_tickTime; _ctrlArr = []; + while {(diag_tickTime - _tick) < _time} do { + + if !(rmx_var_msgQueue isEqualTo []) then { + + _msg = (rmx_var_msgQueue select 0 select 0); + _time = (rmx_var_msgQueue select 0 select 1); + _tick = diag_tickTime; + rmx_var_msgQueue deleteAt 0; + _uniqueID = + switch (count _ctrlArr) do { + case 0: + { + _c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC]; + _ctrlArr = [[_c, _msg]]; + [_c, _msg] call _fnc_animFirst; + }; + case 1: + { + _c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC]; + _ctrlArr set [count _ctrlArr, [_c, _msg]]; + [_c, _msg] call _fnc_animFirst; + + [_ctrlArr select 0 select 0, 0.5, 0.035, _c2pos] call _fnc_animShiftCtrl; + }; + case 2: + { + _c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC]; + _ctrlArr set [count _ctrlArr, [_c, _msg]]; + [_c, _msg] call _fnc_animFirst; + + [_ctrlArr select 1 select 0, 0.5, 0.035, _c2pos] call _fnc_animShiftCtrl; + [_ctrlArr select 0 select 0, 0.75, 0.03, _c3pos] call _fnc_animShiftCtrl; + }; + case 3: + { + _oldCtrl = (_ctrlArr select 0 select 0); + [_oldCtrl] call epoch_getIDC; + ctrlDelete _oldCtrl; + _ctrlArr deleteAt 0; + + _c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC]; + _ctrlArr pushBack [_c, _msg]; + [_c, _msg] call _fnc_animFirst; + + [_ctrlArr select 1 select 0, 0.5, 0.035, _c2pos] call _fnc_animShiftCtrl; + [_ctrlArr select 0 select 0, 0.75, 0.03, _c3pos] call _fnc_animShiftCtrl; + }; + }; + }; + }; + + //End anim + { + (_x select 0) ctrlSetFade 1; + (_x select 0) ctrlSetPosition [safeZoneX, ((_yPos + _ySize * (_forEachIndex + 1)) * GUI_GRID_H + GUI_GRID_Y)]; + (_x select 0) ctrlCommit (0.4 - ((_foreachIndex + 1) / 10)); + } forEach _ctrlArr; + + uisleep 0.50; + + { + ctrlDelete (_x select 0); + } forEach _ctrlArr; + + rmx_var_msgQueue = nil; +}; + +true diff --git a/Sources/epoch_code/gui/scripts/trashcan/Epoch_dynamicTextold.sqf b/Sources/epoch_code/gui/scripts/messaging/Epoch_message_old1.sqf similarity index 99% rename from Sources/epoch_code/gui/scripts/trashcan/Epoch_dynamicTextold.sqf rename to Sources/epoch_code/gui/scripts/messaging/Epoch_message_old1.sqf index 1c5f0579..6e6cdfe2 100644 --- a/Sources/epoch_code/gui/scripts/trashcan/Epoch_dynamicTextold.sqf +++ b/Sources/epoch_code/gui/scripts/messaging/Epoch_message_old1.sqf @@ -13,7 +13,7 @@ https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/scripts/Epoch_dynamicText.sqf Usage: - "TEST" call Epoch_dynamicText + "TEST" call Epoch_message_old1 */ #include "\A3\ui_f\hpp\defineCommonGrids.inc" private ["_y","_cnt","_ctrl","_alreadyEnabled","_input","_scale","_width","_height","_centerX","_centerY","_display","_ctrlGroup","_controls","_ctrlText","_add"]; diff --git a/Sources/epoch_code/gui/scripts/Epoch_dynamicText.sqf b/Sources/epoch_code/gui/scripts/messaging/Epoch_message_old2.sqf similarity index 96% rename from Sources/epoch_code/gui/scripts/Epoch_dynamicText.sqf rename to Sources/epoch_code/gui/scripts/messaging/Epoch_message_old2.sqf index 0b16a089..042782f9 100644 --- a/Sources/epoch_code/gui/scripts/Epoch_dynamicText.sqf +++ b/Sources/epoch_code/gui/scripts/messaging/Epoch_message_old2.sqf @@ -11,7 +11,7 @@ https://github.com/EpochModTeam/Epoch/tree/master/Sources/epoch_code/gui/scripts/Epoch_dynamicText.sqf Usage: - "TEST" call Epoch_dynamicText + "TEST" call Epoch_message_old2 */ #include "\A3\ui_f\hpp\defineCommonGrids.inc" @@ -75,7 +75,7 @@ rmx_var_dtMessageArr pushBack [_in, _timer]; _cnt = 0; { - _ct = if (_x in [65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]) then {0.8} else {0.3}; + _ct = if (_x in [65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90]) then {1} else {0.5}; _cnt = _cnt +_ct; } count (toArray str _in); diff --git a/Sources/epoch_config/Configs/CfgClientFunctions.hpp b/Sources/epoch_config/Configs/CfgClientFunctions.hpp index a6e29672..2cf51c1c 100644 --- a/Sources/epoch_config/Configs/CfgClientFunctions.hpp +++ b/Sources/epoch_config/Configs/CfgClientFunctions.hpp @@ -153,6 +153,11 @@ class CfgClientFunctions class initUI {}; class refeshUI {}; }; + class messaging { + class message {}; + class message_old1 {}; + class message_old2 {}; + }; class looting { class spawnLoot {}; }; @@ -168,7 +173,6 @@ class CfgClientFunctions class getIDC {}; class guiObjHP {}; class secureStorageHandler {}; - class dynamicText {}; class genderSelection {}; class getColorScheme {}; }; diff --git a/Sources/epoch_config/Configs/CfgMissions/CfgmissionDelivery.hpp b/Sources/epoch_config/Configs/CfgMissions/CfgmissionDelivery.hpp index c73f3d91..a07b383e 100644 --- a/Sources/epoch_config/Configs/CfgMissions/CfgmissionDelivery.hpp +++ b/Sources/epoch_config/Configs/CfgMissions/CfgmissionDelivery.hpp @@ -78,7 +78,7 @@ class doDelivery{ callEventCondition1 = "(axeDocDeliveryStart + 480 < diag_tickTime) && ((player nearentities [[""C_Man_1""],500]) apply {_x getVariable [""AI_SLOT"",-1]} isEqualTo (uiNameSpace getVariable [""axeStartTraders"",[]]))"; callEventCondition2 = ""; callEventCondition3 = ""; - callEventCALL1 = "[""Hey, what are you doing here ? Get on with your task !"", 5] call Epoch_dynamicText"; + callEventCALL1 = "[""Hey, what are you doing here ? Get on with your task !"", 5] call Epoch_message"; callEventFSM1 = ""; callEventSQF1 = ""; callEventTask1 = ""; diff --git a/Sources/epoch_config/Configs/CfgMissions/CfgmissionMilitary.hpp b/Sources/epoch_config/Configs/CfgMissions/CfgmissionMilitary.hpp index 00265166..ea5471dc 100644 --- a/Sources/epoch_config/Configs/CfgMissions/CfgmissionMilitary.hpp +++ b/Sources/epoch_config/Configs/CfgMissions/CfgmissionMilitary.hpp @@ -197,7 +197,7 @@ class milFindCrashSite{ callEventCondition1 = "count (units group player select {_x distance milCrashPos < 800}) > 0"; callEventCondition2 = "count (units group player select {_x distance milCrashPos < 480}) > 0 && random 100 < 12"; callEventCondition3 = ""; - callEventCALL1 = "_diag = format [""Great work the UAV has spotted %1 nearly on-site."",name ((units group player select {_x distance milCrashPos < 800}) select 0)];[format [""%1"",_diag], 5] call Epoch_dynamicText;"; + callEventCALL1 = "_diag = format [""Great work the UAV has spotted %1 nearly on-site."",name ((units group player select {_x distance milCrashPos < 800}) select 0)];[_diag, 5] call Epoch_message;"; callEventFSM1 = ""; callEventSQF1 = ""; callEventTask1 = "";