mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
add color support to epoch message @SPKcoding
This commit is contained in:
parent
e379038ab4
commit
be52b911f2
@ -12,26 +12,35 @@
|
|||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
"TEST" call Epoch_message
|
"TEST" call Epoch_message
|
||||||
|
|
||||||
TODO: Add colors
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "\A3\ui_f\hpp\defineCommonGrids.inc"
|
#include "\A3\ui_f\hpp\defineCommonGrids.inc"
|
||||||
_msg = param [0, "No input"];
|
_msg = param [0, "No input"];
|
||||||
_time = param [1, 2];
|
_time = param [1, 2];
|
||||||
|
_customCol = param[2,[]];
|
||||||
|
private["_bgCol","_txtCol"];
|
||||||
|
if(_customCol isEqualTo [])then{
|
||||||
|
_config = 'CfgEpochClient' call EPOCH_returnConfig;
|
||||||
|
_bgCol = getArray(_config >> "epochMessageBackgroundCol");
|
||||||
|
_txtCol = getArray(_config >> "epochMessageTextCol");
|
||||||
|
if !(_bgCol isEqualTypeAll 0)then{_bgCol = [0,0,0,0.2]};
|
||||||
|
if !(_txtCol isEqualTypeAll 0)then{_txtCol = [1,1,1,0.95]};
|
||||||
|
}else{
|
||||||
|
_bgCol = if((_customCol select 0)isEqualTypeAll 0)then[{_customCol select 0},{_bgCol = [0,0,0,0.2]}];
|
||||||
|
_txtCol = if((_customCol select 1)isEqualTypeAll 0)then[{_customCol select 1},{_txtCol = [1,1,1,0.95]}];
|
||||||
|
};
|
||||||
|
|
||||||
_msg = str (parseText str _msg); //Parses and converts text back to small string
|
_msg = str (parseText str _msg); //Parses and converts text back to small string
|
||||||
|
|
||||||
if !(isNil "rmx_var_msgQueue") exitWith { rmx_var_msgQueue pushBack [_msg, _time];};
|
if !(isNil "rmx_var_msgQueue") exitWith {rmx_var_msgQueue pushBack [_msg, _time, [_bgCol,_txtCol]]};
|
||||||
|
|
||||||
rmx_var_msgQueue = [[_msg, _time]];
|
rmx_var_msgQueue = [[_msg, _time, [_bgCol,_txtCol]]];
|
||||||
|
|
||||||
[] spawn {
|
[] spawn {
|
||||||
private ["_c1pos","_c2pos","_c3pos","_clr","_dsp"];
|
private ["_c1pos","_c2pos","_c3pos","_clr","_dsp"];
|
||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
|
|
||||||
_dsp = findDisplay 46;
|
_dsp = findDisplay 46;
|
||||||
|
|
||||||
_yPos = 15;
|
_yPos = 15;
|
||||||
_ySize = 2;
|
_ySize = 2;
|
||||||
_c1StartPos = [safeZoneX,((_yPos - _ySize) * GUI_GRID_H + GUI_GRID_Y),safeZoneW, _ySize * GUI_GRID_H];
|
_c1StartPos = [safeZoneX,((_yPos - _ySize) * GUI_GRID_H + GUI_GRID_Y),safeZoneW, _ySize * GUI_GRID_H];
|
||||||
@ -39,20 +48,20 @@ rmx_var_msgQueue = [[_msg, _time]];
|
|||||||
_c2pos = [safeZoneX,((_yPos + _ySize) * 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];
|
_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
|
//Start anim
|
||||||
_msg = "";
|
_msg = "";
|
||||||
_time = (rmx_var_msgQueue select 0 select 1);
|
_time = (rmx_var_msgQueue select 0 select 1);
|
||||||
|
_col = (rmx_var_msgQueue select 0)select 2;
|
||||||
|
|
||||||
_fnc_animFirst = {
|
_fnc_animFirst = {
|
||||||
private "_ctrl";
|
private "_ctrl";
|
||||||
|
|
||||||
_ctrl = param [0];
|
_ctrl = param [0];
|
||||||
_msg = param [1];
|
_msg = param [1];
|
||||||
_ctrl ctrlSetBackgroundColor [_clr select 0, _clr select 1, _clr select 2, 0.2];
|
_col = param [2];
|
||||||
|
|
||||||
|
_ctrl ctrlSetBackgroundColor (_col select 0);
|
||||||
_ctrl ctrlSetText _msg;
|
_ctrl ctrlSetText _msg;
|
||||||
|
_ctrl ctrlSetTextColor (_col select 1);
|
||||||
|
|
||||||
_ctrl ctrlSetPosition _c1StartPos;
|
_ctrl ctrlSetPosition _c1StartPos;
|
||||||
_ctrl ctrlSetFade 1;
|
_ctrl ctrlSetFade 1;
|
||||||
@ -76,28 +85,30 @@ rmx_var_msgQueue = [[_msg, _time]];
|
|||||||
_ctrl ctrlCommit 0.3;
|
_ctrl ctrlCommit 0.3;
|
||||||
};
|
};
|
||||||
|
|
||||||
_tick = diag_tickTime; _ctrlArr = [];
|
_tick = diag_tickTime;
|
||||||
|
_ctrlArr = [];
|
||||||
while {(diag_tickTime - _tick) < _time} do {
|
while {(diag_tickTime - _tick) < _time} do {
|
||||||
|
|
||||||
if !(rmx_var_msgQueue isEqualTo []) then {
|
if !(rmx_var_msgQueue isEqualTo []) then {
|
||||||
|
|
||||||
_msg = (rmx_var_msgQueue select 0 select 0);
|
_msg = (rmx_var_msgQueue select 0 select 0);
|
||||||
_time = (rmx_var_msgQueue select 0 select 1);
|
_time = (rmx_var_msgQueue select 0 select 1);
|
||||||
|
_col = (rmx_var_msgQueue select 0)select 2;
|
||||||
_tick = diag_tickTime;
|
_tick = diag_tickTime;
|
||||||
rmx_var_msgQueue deleteAt 0;
|
rmx_var_msgQueue deleteAt 0;
|
||||||
_uniqueID =
|
//_uniqueID =
|
||||||
switch (count _ctrlArr) do {
|
switch (count _ctrlArr) do {
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
_c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC];
|
_c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC];
|
||||||
_ctrlArr = [[_c, _msg]];
|
_ctrlArr = [[_c, _msg]];
|
||||||
[_c, _msg] call _fnc_animFirst;
|
[_c, _msg, _col] call _fnc_animFirst;
|
||||||
};
|
};
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
_c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC];
|
_c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC];
|
||||||
_ctrlArr set [count _ctrlArr, [_c, _msg]];
|
_ctrlArr set [count _ctrlArr, [_c, _msg]];
|
||||||
[_c, _msg] call _fnc_animFirst;
|
[_c, _msg, _col] call _fnc_animFirst;
|
||||||
|
|
||||||
[_ctrlArr select 0 select 0, 0.5, 0.035, _c2pos] call _fnc_animShiftCtrl;
|
[_ctrlArr select 0 select 0, 0.5, 0.035, _c2pos] call _fnc_animShiftCtrl;
|
||||||
};
|
};
|
||||||
@ -105,7 +116,7 @@ rmx_var_msgQueue = [[_msg, _time]];
|
|||||||
{
|
{
|
||||||
_c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC];
|
_c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC];
|
||||||
_ctrlArr set [count _ctrlArr, [_c, _msg]];
|
_ctrlArr set [count _ctrlArr, [_c, _msg]];
|
||||||
[_c, _msg] call _fnc_animFirst;
|
[_c, _msg, _col] call _fnc_animFirst;
|
||||||
|
|
||||||
[_ctrlArr select 1 select 0, 0.5, 0.035, _c2pos] call _fnc_animShiftCtrl;
|
[_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;
|
[_ctrlArr select 0 select 0, 0.75, 0.03, _c3pos] call _fnc_animShiftCtrl;
|
||||||
@ -119,7 +130,7 @@ rmx_var_msgQueue = [[_msg, _time]];
|
|||||||
|
|
||||||
_c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC];
|
_c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC];
|
||||||
_ctrlArr pushBack [_c, _msg];
|
_ctrlArr pushBack [_c, _msg];
|
||||||
[_c, _msg] call _fnc_animFirst;
|
[_c, _msg, _col] call _fnc_animFirst;
|
||||||
|
|
||||||
[_ctrlArr select 1 select 0, 0.5, 0.035, _c2pos] call _fnc_animShiftCtrl;
|
[_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;
|
[_ctrlArr select 0 select 0, 0.75, 0.03, _c3pos] call _fnc_animShiftCtrl;
|
||||||
|
@ -43,6 +43,11 @@ class CfgEpochClient
|
|||||||
maxgates = 5; // Max allowed Gates per Group
|
maxgates = 5; // Max allowed Gates per Group
|
||||||
|
|
||||||
disableRemoteSensors = "true"; // disableRemoteSensors true/false
|
disableRemoteSensors = "true"; // disableRemoteSensors true/false
|
||||||
|
|
||||||
|
epochMessageBackgroundCol[] = {0,0,0,0.2}; //Epoch_message background color (format: {R,G,B,A})
|
||||||
|
epochMessageTextCol[] = {1,1,1,0.95}; //Epoch_message text color (format: {R,G,B,A})
|
||||||
|
//to use different colored messages in scripts, just call it this way: ["the message", 6, [[0,0,0,0.2],[1,1,1,0.95]]] call Epoch_message;
|
||||||
|
|
||||||
EPOCH_news[] = {"Word is that Sappers have a new boss.","Dogs will often lure them monsters away.","My dog was blown up. I miss him.."};
|
EPOCH_news[] = {"Word is that Sappers have a new boss.","Dogs will often lure them monsters away.","My dog was blown up. I miss him.."};
|
||||||
deathMorphClass[] = {"Epoch_Sapper_F","Epoch_SapperG_F","Epoch_SapperB_F","I_UAV_01_F","Epoch_Cloak_F"}; //Random selection of these classes when player morphs after death. Currently available: Epoch_Cloak_F, Epoch_SapperB_F, Epoch_Sapper_F, I_UAV_01_F
|
deathMorphClass[] = {"Epoch_Sapper_F","Epoch_SapperG_F","Epoch_SapperB_F","I_UAV_01_F","Epoch_Cloak_F"}; //Random selection of these classes when player morphs after death. Currently available: Epoch_Cloak_F, Epoch_SapperB_F, Epoch_Sapper_F, I_UAV_01_F
|
||||||
niteLight[] = {1,1.88,22}; //Set ambient lighting at night: {Brightness of light,Height of light}. Default (Low Ambient): {1.88,22} | Twilight: {7.2,88} | Distant: {12.8,142}
|
niteLight[] = {1,1.88,22}; //Set ambient lighting at night: {Brightness of light,Height of light}. Default (Low Ambient): {1.88,22} | Twilight: {7.2,88} | Distant: {12.8,142}
|
||||||
|
Loading…
Reference in New Issue
Block a user