mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 13:26:39 +03:00
Update snap and vector build
Mady by @Victor-the-Cleaner
This commit is contained in:
@@ -1,255 +1,260 @@
|
||||
/*-----------------------------------*/
|
||||
// by Raymix //
|
||||
// July 10 2014 //
|
||||
/*--------------------------------*/
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Author: Raymix
|
||||
// Date: July 10 2014
|
||||
//
|
||||
// Updated by Victor the Cleaner
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fnc_snapActionCleanup = {
|
||||
private ["_s1","_s2","_s3","_cnt","_object","_classname","_objectHelper","_points"];
|
||||
local _s1 = _this select 0;
|
||||
local _s2 = _this select 1;
|
||||
local _s3 = _this select 2;
|
||||
local _object = _this select 3;
|
||||
local _classname = _this select 4;
|
||||
local _objectHelper = _this select 5;
|
||||
local _points = _this select 6;
|
||||
|
||||
_s1 = _this select 0;
|
||||
_s2 = _this select 1;
|
||||
_s3 = _this select 2;
|
||||
_object = _this select 3;
|
||||
_classname = _this select 4;
|
||||
_objectHelper = _this select 5;
|
||||
_points = _this select 6;
|
||||
local _WHT = "<t color='#ffffff'>";
|
||||
local _GRN = "<t color='#20E020'>";
|
||||
local _RED = "<t color='#ff0000'>";
|
||||
local _TB3 = " ";
|
||||
local _END = "</t>";
|
||||
local _txt = "";
|
||||
|
||||
player removeAction s_player_toggleSnap;
|
||||
s_player_toggleSnap = -1;
|
||||
|
||||
player removeAction s_player_toggleSnapSelect;
|
||||
s_player_toggleSnapSelect = -1;
|
||||
|
||||
if (count s_player_toggleSnapSelectPoint != 0) then {
|
||||
{
|
||||
player removeAction _x;
|
||||
} count s_player_toggleSnapSelectPoint;
|
||||
{player removeAction _x;} count s_player_toggleSnapSelectPoint;
|
||||
s_player_toggleSnapSelectPoint = [];
|
||||
snapActions = -1;
|
||||
|
||||
s_player_toggleSnapSelectPoint = [];
|
||||
snapActions = -1;
|
||||
};
|
||||
if (_s1 > 0) then {
|
||||
s_player_toggleSnap = player addaction [format["<t color=""#ffffff"">" + "Snap: %1" +"</t>",snapActionState],"\z\addons\dayz_code\actions\snap_build.sqf",[snapActionState,_object,_classname,_objectHelper,0],10,false,true];
|
||||
local _menuState = snapActionState;
|
||||
if (snapActionState == "Selected") then {_menuState = localize "STR_EPOCH_ACTION_SNAP_ON";};
|
||||
|
||||
_txt = format[_WHT + "Snap: %1" + _END, _menuState];
|
||||
s_player_toggleSnap = player addAction [_txt, "\z\addons\dayz_code\actions\snap_build.sqf", [_menuState, _object, _classname, _objectHelper, 0], 10, false, true];
|
||||
};
|
||||
if (_s2 > 0) then {
|
||||
s_player_toggleSnapSelect = player addaction [format["<t color=""#ffffff"">" + localize "STR_EPOCH_ACTION_SNAP_POINT" + " %1" +"</t>",snapActionStateSelect],"\z\addons\dayz_code\actions\snap_build.sqf",[snapActionStateSelect,_object,_classname,_objectHelper,0],9,false,true];
|
||||
local _COL = _GRN; // Auto
|
||||
if (snapActionState == "Selected") then {_COL = _WHT;}; // manual
|
||||
|
||||
_txt = format[_WHT + localize "STR_EPOCH_ACTION_SNAP_POINT" + _COL + " %1" + _END, snapActionStateSelect];
|
||||
s_player_toggleSnapSelect = player addAction [_txt, "\z\addons\dayz_code\actions\snap_build.sqf", [snapActionStateSelect, _object, _classname, _objectHelper, 0], 9, false, true];
|
||||
};
|
||||
if (_s3 > 0) then {
|
||||
s_player_toggleSnapSelectPoint = [];
|
||||
_cnt = 0;
|
||||
{
|
||||
snapActions = player addaction [format["<t color=""#ffffff"">" + " %1. " + localize "STR_EPOCH_ACTION_SNAP_SELECT" + " %2" + "</t>",_cnt+1,_x select 3],"\z\addons\dayz_code\actions\snap_build.sqf",["Selected",_object,_classname,_objectHelper,_cnt],8,false,false];
|
||||
s_player_toggleSnapSelectPoint set [count s_player_toggleSnapSelectPoint,snapActions];
|
||||
_cnt = _cnt + 1;
|
||||
} count _points;
|
||||
local _COL = _WHT;
|
||||
if (_forEachIndex == DZE_SnapSelIdx) then {_COL = _GRN;};
|
||||
|
||||
_txt = format[_TB3 + _COL + "%1. " + localize "STR_EPOCH_ACTION_SNAP_SELECT" + " %2" + _END, _forEachIndex + 1, _x select 3];
|
||||
snapActions = player addAction [_txt, "\z\addons\dayz_code\actions\snap_build.sqf", ["Selected", _object, _classname, _objectHelper, _forEachIndex], 8, false, false];
|
||||
|
||||
s_player_toggleSnapSelectPoint set [count s_player_toggleSnapSelectPoint, snapActions];
|
||||
} forEach _points;
|
||||
};
|
||||
};
|
||||
|
||||
fnc_initSnapPoints = {
|
||||
private ["_objectSnapGizmo","_object","_points"];
|
||||
|
||||
_object = _this select 0;
|
||||
_points = _this select 1;
|
||||
local _object = _this select 0;
|
||||
local _points = _this select 1;
|
||||
|
||||
snapGizmos = [];
|
||||
{
|
||||
_objectSnapGizmo = "Sign_sphere10cm_EP1" createVehicle [0,0,0];
|
||||
_objectSnapGizmo setobjecttexture [0,"#(argb,8,8,3)color(0.04,0.84,0.92,0.3,ca)"];
|
||||
_objectSnapGizmo attachTo [_object,[_x select 0,_x select 1,_x select 2]];
|
||||
snapGizmos set [count snapGizmos,_objectSnapGizmo];
|
||||
local _objectSnapGizmo = DZE_SNAP_HELPER_CLASS createVehicleLocal [0,0,0];
|
||||
_objectSnapGizmo setObjectTexture DZE_SNAP_POINT_RESET; // green
|
||||
_x resize 3; // remove text element
|
||||
_objectSnapGizmo attachTo [_object, _x];
|
||||
snapGizmos set [count snapGizmos, _objectSnapGizmo];
|
||||
} count _points;
|
||||
};
|
||||
|
||||
fnc_initSnapPointsNearby = {
|
||||
private ["_pos","_findWhitelisted","_pointsNearby","_nearbyObject","_objectSnapGizmo","_posNearby","_object","_whitelist","_radius"];
|
||||
local _object = _this select 0;
|
||||
local _findObjects = nearestObjects [_object, [], DZE_snapRadius] - [_object];
|
||||
|
||||
_object = _this select 0;
|
||||
_whitelist = _this select 1;
|
||||
_radius = _this select 2;
|
||||
|
||||
_pos = [_object] call FNC_GetPos;
|
||||
_findWhitelisted = [];
|
||||
_pointsNearby = [];
|
||||
_findWhitelisted = nearestObjects [_pos,_whitelist,(_radius + DZE_snapExtraRange)]-[_object];
|
||||
{deleteVehicle _x;} count snapGizmosNearby; // clean up previous radius
|
||||
snapGizmosNearby = [];
|
||||
{
|
||||
_nearbyObject = _x;
|
||||
_pointsNearby = getArray (configFile >> "SnapBuilding" >> (typeOf _x) >> "points");
|
||||
local _nearbyObject = _x;
|
||||
local _typeOf = typeOf _x;
|
||||
|
||||
local _pointsNearby = getArray (configFile >> "SnapBuilding" >> _typeOf >> "points");
|
||||
local _displayName = getText (configFile >> "CfgVehicles" >> _typeOf >> "displayName");
|
||||
{
|
||||
_objectSnapGizmo = "Sign_sphere10cm_EP1" createVehicle [0,0,0];
|
||||
_objectSnapGizmo setobjecttexture [0,"#(argb,8,8,3)color(0.04,0.84,0.92,0.3,ca)"];
|
||||
local _objectSnapGizmo = DZE_SNAP_HELPER_CLASS createVehicleLocal [0,0,0];
|
||||
_objectSnapGizmo setObjectTexture DZE_SNAP_POINT_RESET; // green
|
||||
_objectSnapGizmo setDir (_nearbyObject getVariable["memDir",0]);
|
||||
_posNearby = _nearbyObject modelToWorld [_x select 0,_x select 1,_x select 2];
|
||||
if (surfaceIsWater _posNearby) then {
|
||||
_objectSnapGizmo setPosASL [(_posNearby) select 0,(_posNearby) select 1,(getPosASL _nearbyObject select 2) + (_x select 2)];
|
||||
} else {
|
||||
_objectSnapGizmo setPosATL _posNearby;
|
||||
};
|
||||
snapGizmosNearby set [count snapGizmosNearby,_objectSnapGizmo];
|
||||
_objectSnapGizmo setVariable ["snappoint", [_displayName, _x select 3], false]; // store object and snapping point display names
|
||||
|
||||
_x resize 3; // remove text element
|
||||
_objectSnapGizmo attachTo [_nearbyObject, _x];
|
||||
|
||||
snapGizmosNearby set [count snapGizmosNearby, _objectSnapGizmo]; // rebuild helper list
|
||||
} count _pointsNearby;
|
||||
} forEach _findWhitelisted;
|
||||
} forEach _findObjects;
|
||||
};
|
||||
|
||||
fnc_initSnapPointsCleanup = {
|
||||
{detach _x; deleteVehicle _x;} count snapGizmos;
|
||||
{deleteVehicle _x;} count snapGizmos;
|
||||
snapGizmos = [];
|
||||
{detach _x; deleteVehicle _x;} count snapGizmosNearby;
|
||||
|
||||
{deleteVehicle _x;} count snapGizmosNearby;
|
||||
snapGizmosNearby = [];
|
||||
|
||||
snapActionState = localize "STR_EPOCH_ACTION_SNAP_OFF";
|
||||
};
|
||||
|
||||
fnc_snapDistanceCheck = {
|
||||
private ["_distClosestPointFound","_distCheck","_distClosest","_testXPos","_distClosestPointFoundPos","_distClosestPointFoundDir","_distClosestAttached","_distCheckAttached","_distClosestAttachedFoundPos","_onWater","_objectHelper","_object"];
|
||||
local _object = _this select 0;
|
||||
local _objectHelper = _this select 1;
|
||||
|
||||
_object = _this select 0;
|
||||
_objectHelper = _this select 1;
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// _snapObject function
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
while {snapActionState != localize "STR_EPOCH_ACTION_SNAP_OFF"} do {
|
||||
_distClosestPointFound = objNull;
|
||||
_distCheck = 0;
|
||||
_distClosest = 10;
|
||||
_testXPos = [];
|
||||
_distClosestPointFoundPos =[];
|
||||
_distClosestPointFoundDir = 0;
|
||||
_snapObject = {
|
||||
_objectHelper setPosASL (getPosASL _closestNearCurr); // snap object
|
||||
|
||||
{
|
||||
if (_x !=_distClosestPointFound) then {_x setobjecttexture [0,"#(argb,8,8,3)color(0.04,0.84,0.92,0.3,ca)"];};
|
||||
_testXPos = [_x] call FNC_GetPos;
|
||||
_distCheck = _objectHelper distance _testXPos;
|
||||
if (_distCheck < _distClosest) then {
|
||||
_distClosest = _distCheck;
|
||||
_distClosestPointFound setobjecttexture [0,"#(argb,8,8,3)color(0.04,0.84,0.92,0.3,ca)"];
|
||||
_distClosestPointFound = _x;
|
||||
_distClosestPointFound setobjecttexture [0,"#(argb,8,8,3)color(0,0.92,0.06,1,ca)"];
|
||||
DZE_memDir = getDir _closestNearCurr;
|
||||
[_objectHelper, [DZE_memForBack, DZE_memLeftRight, DZE_memDir]] call fnc_SetPitchBankYaw;
|
||||
|
||||
waitUntil {uiSleep 0.1; !helperDetach};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// _uiSnapText function
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
_uiSnapText = {
|
||||
if (!DZE_uiSnapText) exitWith {};
|
||||
|
||||
local _pos = worldToScreen (_closestNearCurr modelToWorld [0,0,0]);
|
||||
|
||||
if (count _pos == 0) exitWith {}; // object may be off screen
|
||||
|
||||
local _screenX = (_pos select 0) - 0.5; // center to snap point
|
||||
local _screenY = (_pos select 1) - 0.06 * safeZoneH; // 6% of screen height
|
||||
|
||||
local _format = "<t align='Center' size='0.4' font='Zeppelin33' shadow='2' color=";
|
||||
local _WHT = _format + "'#E0E0E0'>";
|
||||
local _GRN = _format + "'#20E020'>";
|
||||
local _END = "</t>";
|
||||
local _NL = _END + "<br/>";
|
||||
local _txt = _WHT + "%1" + _NL + _WHT + (localize "STR_EPOCH_BUILD_UI_SNAP") + ": " + _GRN + "%2" + _END;
|
||||
|
||||
local _var = _closestNearCurr getVariable ["snappoint", ["",""]];
|
||||
|
||||
local _nearName = _var select 0;
|
||||
local _snapName = _var select 1;
|
||||
|
||||
if (_nearName == "") exitWith {};
|
||||
|
||||
local _txt = format[_txt, _nearName, _snapName];
|
||||
[_txt, _screenX, _screenY, 0.1, 0, 0, 18] spawn BIS_fnc_dynamicText;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
local _OFF = localize "STR_EPOCH_ACTION_SNAP_OFF";
|
||||
local _MANUAL = localize "STR_EPOCH_ACTION_SNAP_POINT_MANUAL";
|
||||
|
||||
local _closestHeldPrev = objNull;
|
||||
local _closestNearPrev = objNull;
|
||||
|
||||
while {snapActionState != _OFF} do {
|
||||
|
||||
local _closestHeldCurr = objNull;
|
||||
local _closestNearCurr = objNull;
|
||||
local _closestDistance = DZE_snapDistance;
|
||||
|
||||
if (snapActionStateSelect == _MANUAL) then {
|
||||
|
||||
if (DZR_snapRefresh) exitWith {}; // currently refreshing
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Manual Snap
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
{ // scan all nearby points
|
||||
local _distance = _objectHelper distance _x; // compare to current selected
|
||||
|
||||
if (_distance < _closestDistance) then { // found a closer match
|
||||
_closestDistance = _distance;
|
||||
_closestNearCurr = _x; // update current
|
||||
};
|
||||
} count snapGizmosNearby;
|
||||
} forEach snapGizmosNearby;
|
||||
|
||||
if ((isNull _closestNearCurr) || {_closestNearCurr != _closestNearPrev}) then {
|
||||
_closestNearPrev setObjectTexture DZE_SNAP_POINT_RESET; // near OFF
|
||||
};
|
||||
if (!isNull _closestNearCurr) then {
|
||||
_closestNearCurr setObjectTexture DZE_SNAP_POINT_FOUND; // near ON
|
||||
_closestNearPrev = _closestNearCurr;
|
||||
|
||||
call _uiSnapText; // display text
|
||||
|
||||
if (!isNull _distClosestPointFound) then {
|
||||
if (snapActionStateSelect == localize "STR_EPOCH_ACTION_SNAP_POINT_MANUAL") then {
|
||||
if (helperDetach) then {
|
||||
_onWater = surfaceIsWater position _distClosestPointFound;
|
||||
_distClosestPointFoundDir = getDir _distClosestPointFound;
|
||||
if (_onWater) then {
|
||||
_distClosestPointFoundPos = getPosASL _distClosestPointFound;
|
||||
_objectHelper setPosASL _distClosestPointFoundPos;
|
||||
} else {
|
||||
_distClosestPointFoundPos = getPosATL _distClosestPointFound;
|
||||
_objectHelper setPosATL _distClosestPointFoundPos;
|
||||
};
|
||||
//_objectHelper setDir _distClosestPointFoundDir;
|
||||
DZE_memDir = _distClosestPointFoundDir;
|
||||
[_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYaw;
|
||||
waitUntil {uiSleep 0.1; !helperDetach};
|
||||
call _snapObject; // snap object
|
||||
};
|
||||
} else {
|
||||
_distClosestAttached = objNull;
|
||||
_distCheckAttached = 0;
|
||||
_distClosest = 10;
|
||||
_distClosestAttachedFoundPos = [];
|
||||
};
|
||||
} else {
|
||||
|
||||
if (DZR_snapRefresh) exitWith {}; // currently refreshing
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Auto Snap
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
local _nearCurr = _x; // scan all nearby points
|
||||
{
|
||||
if (_x !=_distClosestAttached) then {_x setobjecttexture [0,"#(argb,8,8,3)color(0.04,0.84,0.92,0.3,ca)"];};
|
||||
_testXPos = [_x] call FNC_GetPos;
|
||||
_distCheckAttached = _distClosestPointFound distance _testXPos;
|
||||
if (_distCheckAttached < _distClosest) then {
|
||||
_distClosest = _distCheckAttached;
|
||||
_distClosestAttached setobjecttexture [0,"#(argb,8,8,3)color(0.04,0.84,0.92,0.3,ca)"];
|
||||
_distClosestAttached = _x;
|
||||
_distClosestAttached setobjecttexture [0,"#(argb,8,8,3)color(0,0.92,0.06,1,ca)"];
|
||||
};
|
||||
local _distance = _nearCurr distance _x; // compare to all points of held object
|
||||
|
||||
if (_distance < _closestDistance) then { // found a closer match
|
||||
_closestDistance = _distance;
|
||||
_closestHeldCurr = _x; // update current
|
||||
_closestNearCurr = _nearCurr; // paired points
|
||||
};
|
||||
} count snapGizmos;
|
||||
} forEach snapGizmosNearby;
|
||||
|
||||
if ((isNull _closestHeldCurr) || {_closestHeldCurr != _closestHeldPrev}) then {
|
||||
_closestHeldPrev setObjectTexture DZE_SNAP_POINT_RESET; // held OFF
|
||||
};
|
||||
if ((isNull _closestNearCurr) || {_closestNearCurr != _closestNearPrev}) then {
|
||||
_closestNearPrev setObjectTexture DZE_SNAP_POINT_RESET; // near OFF
|
||||
};
|
||||
if (!isNull _closestNearCurr) then {
|
||||
_closestHeldCurr setObjectTexture DZE_SNAP_POINT_FOUND; // held ON
|
||||
_closestHeldPrev = _closestHeldCurr;
|
||||
|
||||
_closestNearCurr setObjectTexture DZE_SNAP_POINT_FOUND; // near ON
|
||||
_closestNearPrev = _closestNearCurr;
|
||||
|
||||
call _uiSnapText; // display text
|
||||
|
||||
if (helperDetach) then {
|
||||
_distClosestPointFoundDir = getDir _distClosestPointFound;
|
||||
_onWater = surfaceIsWater position _distClosestPointFound;
|
||||
if (_onWater) then {
|
||||
_distClosestPointFoundPos = getPosASL _distClosestPointFound;
|
||||
_distClosestAttachedFoundPos = getPosASL _distClosestAttached;
|
||||
detach _object;
|
||||
_objectHelper setPosASL _distClosestAttachedFoundPos;
|
||||
_object attachTo [_objectHelper];
|
||||
_objectHelper setPosASL _distClosestPointFoundPos;
|
||||
} else {
|
||||
_distClosestPointFoundPos = getPosATL _distClosestPointFound;
|
||||
_distClosestAttachedFoundPos = getPosATL _distClosestAttached;
|
||||
detach _object;
|
||||
_objectHelper setPosATL _distClosestAttachedFoundPos;
|
||||
_object attachTo [_objectHelper];
|
||||
_objectHelper setPosATL _distClosestPointFoundPos;
|
||||
};
|
||||
//_objectHelper setDir _distClosestPointFoundDir;
|
||||
DZE_memDir = _distClosestPointFoundDir;
|
||||
[_objectHelper,[DZE_memForBack,DZE_memLeftRight,DZE_memDir]] call fnc_SetPitchBankYaw;
|
||||
waitUntil {uiSleep 0.1; !helperDetach};
|
||||
detach _object;
|
||||
_objectHelper setPosASL (getPosASL _closestHeldCurr); // select snapping point on held object
|
||||
_object attachTo [_objectHelper];
|
||||
|
||||
call _snapObject; // snap object
|
||||
};
|
||||
};
|
||||
};
|
||||
uiSleep 0.1;
|
||||
};
|
||||
};
|
||||
|
||||
fnc_initSnapTutorial = {
|
||||
/*
|
||||
Shows help dialog for player ONCE per log in, explaining controls.
|
||||
Add snapTutorial = false; to your init.sqf to disable this tutorial completely.
|
||||
You can also add this bool to the end of this function to only show tutorial once per player login (not recommended)
|
||||
*/
|
||||
private ["_bldTxtSwitch","_bldTxtEnable","_bldTxtClrO","_bldTxtClrW","_bldTxtClrR","_bldTxtClrG","_bldTxtSz","_bldTxtSzT","_bldTxtShdw","_bldTxtAlgnL","_bldTxtUndrln","_bldTxtBold","_bldTxtFinal","_bldTxtStringTitle","_bldTxtStringSD","_bldTxtStringSE","_bldTxtStringSA","_bldTxtStringSM","_bldTxtStringPG","_bldTxtStringAPG","_bldTxtStringCPG","_bldTxtStringQE","_bldTxtStringQEF","_bldTxtStringFD","_bldTxtStringFS"];
|
||||
|
||||
if (isNil "snapTutorial") then {
|
||||
_bldTxtSwitch = _this select 0;
|
||||
_bldTxtEnable = _this select 1;
|
||||
_bldTxtClrO = "color='#ff8800'"; //orange
|
||||
_bldTxtClrW = "color='#ffffff'"; //white
|
||||
_bldTxtClrR = "color='#fd0a05'"; //red
|
||||
_bldTxtClrG = "color='#11ef00'"; //green
|
||||
_bldTxtSz = "size='0.76'"; //Title font size
|
||||
_bldTxtSzT = "size='0.4'"; //Text font size
|
||||
_bldTxtShdw = "shadow='1'"; //Font shadow
|
||||
_bldTxtAlgnL = "align='left'"; //Text align left
|
||||
_bldTxtUndrln = "underline='true'";
|
||||
_bldTxtBold = "font='Zeppelin33'"; //Bold text
|
||||
_bldTxtFinal = "";
|
||||
|
||||
//Delete on init
|
||||
17 cutRsc ["Default", "PLAIN"];
|
||||
uiSleep 0.1;
|
||||
|
||||
//Init Tutorial text
|
||||
if (_bldTxtEnable) then {
|
||||
_bldTxtStringTitle = format ["<t %1%2%3%4%6>Epoch<t %5%7> Snap Building</t></t><br />",_bldTxtClrW,_bldTxtSz,_bldTxtShdw,_bldTxtAlgnL,_bldTxtClrO,_bldTxtUndrln,_bldTxtBold];
|
||||
_bldTxtStringSD = format["<t %1%4%5%6>[Snap]<t %2> %7</t> <t %3>%8</t></t><br /><br />",_bldTxtClrO,_bldTxtClrR,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL,localize "STR_EPOCH_SNAP_TUTORIAL_DISABLE",localize "STR_EPOCH_SNAP_TUTORIAL_DISABLE_MSG"];
|
||||
_bldTxtStringSE = format["<t %1%4%5%6>[Snap]<t %2> %7</t> <t %3>%8</t></t><br /><br />",_bldTxtClrO,_bldTxtClrG,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL,localize "STR_EPOCH_SNAP_TUTORIAL_ENABLE",localize "STR_EPOCH_SNAP_TUTORIAL_ENABLE_MSG"];
|
||||
_bldTxtStringSA = format["<t %1%3%4%5>[Auto]<t %2>: %6</t></t><br /><br />",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL,localize "STR_EPOCH_SNAP_TUTORIAL_AUTO_DETECT"];
|
||||
_bldTxtStringSM = format["<t %1%3%4%5>[%6]<t %2>: %7</t></t><br /><br />",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL,localize "STR_EPOCH_ACTION_SNAP_POINT_MANUAL",localize "STR_EPOCH_SNAP_TUTORIAL_MANUAL_DETECT"];
|
||||
_bldTxtStringPG = format["<t %1%3%4%5>%6<t %2>: %7</t></t><br />",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL,localize "STR_EPOCH_SNAP_TUTORIAL_PGUPPGDOWN",localize "STR_EPOCH_SNAP_TUTORIAL_PGUPPGDOWN_MSG"];
|
||||
_bldTxtStringAPG = format["<t %1%3%4%5>%6<t %2>: %7</t></t><br />",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL,localize "STR_EPOCH_SNAP_TUTORIAL_ALT_PGUPPGDOWN",localize "STR_EPOCH_SNAP_TUTORIAL_ALT_PGUPPGDOWN_MSG"];
|
||||
_bldTxtStringCPG = format["<t %1%3%4%5>%6<t %2>: %7</t></t><br />",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL,localize "STR_EPOCH_SNAP_TUTORIAL_CTRL_PGUPPGDOWN",localize "STR_EPOCH_SNAP_TUTORIAL_CTRL_PGUPPGDOWN_MSG"];
|
||||
_bldTxtStringQE = format["<t %1%3%4%5>[Q / E]<t %2>: %6</t></t><br />",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL,localize "STR_EPOCH_SNAP_TUTORIAL_ROTATE180_MSG"];
|
||||
_bldTxtStringQEF = format["<t %1%3%4%5>[Q / E]<t %2>: %6</t></t><br /><br />",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL,localize "STR_EPOCH_SNAP_TUTORIAL_ROTATE45_MSG"];
|
||||
_bldTxtStringFD = format["<t %1%3%4%5>[F]<t %2>: %6</t></t><br />",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL,localize "STR_EPOCH_SNAP_TUTORIAL_F_DROP_MSG"];
|
||||
_bldTxtStringFS = format["<t %1%3%4%5>[F]<t %2>: %6</t></t><br />",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL,localize "STR_EPOCH_SNAP_TUTORIAL_F_SNAP_MSG"];
|
||||
switch (_bldTxtSwitch) do {
|
||||
case "init": {
|
||||
_bldTxtFinal = _bldTxtStringTitle + _bldTxtStringSD + _bldTxtStringPG + _bldTxtStringAPG + _bldTxtStringCPG + _bldTxtStringQE + _bldTxtStringQEF + _bldTxtStringFD;
|
||||
};
|
||||
case "OnAuto": {
|
||||
_bldTxtFinal = _bldTxtStringTitle + _bldTxtStringSE + _bldTxtStringSA + _bldTxtStringPG + _bldTxtStringAPG + _bldTxtStringCPG + _bldTxtStringQE + _bldTxtStringQEF + _bldTxtStringFS;
|
||||
};
|
||||
case "manual": {
|
||||
_bldTxtFinal = _bldTxtStringTitle + _bldTxtStringSE + _bldTxtStringSM + _bldTxtStringPG + _bldTxtStringAPG + _bldTxtStringCPG + _bldTxtStringQE + _bldTxtStringQEF + _bldTxtStringFS;
|
||||
};
|
||||
};
|
||||
|
||||
[
|
||||
_bldTxtFinal, //structured text
|
||||
0.73 * safezoneW + safezoneX, //number - x
|
||||
0.65 * safezoneH + safezoneY, //number - y
|
||||
30, //number - duration
|
||||
1, // number - fade in time
|
||||
0, // number - delta y
|
||||
17 //number - layer ID
|
||||
] spawn bis_fnc_dynamicText;
|
||||
};
|
||||
|
||||
uiSleep 0.02;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user