-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76523bb
commit 7425467
Showing
18 changed files
with
265 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PREP(displayMessage); | ||
PREP(initListbox); | ||
PREP(isAdminOrZeus); | ||
PREP(onRecipientChanged); | ||
PREP(receiveMessage); | ||
PREP(sendMessage); | ||
PREP(setSendButtonPosition); | ||
PREP(setTitle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "script_component.hpp" | ||
|
||
ADDON = false; | ||
|
||
PREP_RECOMPILE_START; | ||
#include "XEH_PREP.hpp" | ||
PREP_RECOMPILE_END; | ||
|
||
ADDON = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "script_component.hpp" | ||
|
||
#include "XEH_PREP.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
74 changes: 37 additions & 37 deletions
74
...nMessages/functions/fn_displayMessage.sqf → ...Messages/functions/fnc_displayMessage.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
#include "script_component.hpp" | ||
#include "..\gui\defines.hpp" | ||
|
||
params [["_info",""],["_message",""]]; | ||
|
||
// chat is disabled by grad_minui >> display message in custom rscTitle | ||
if ( | ||
!isNil "grad_minui_fnc_setting" && | ||
{ | ||
(!visibleMap && !(["chat_enabled"] call grad_minui_fnc_setting)) || | ||
(visibleMap && !(["chat_enabled_map"] call grad_minui_fnc_setting)) | ||
} | ||
) then { | ||
|
||
QGVAR(customChatLayer) cutRsc [QGVAR(rscCustomChat),"PLAIN",-1,true]; | ||
private _customChatTitleDisplay = uiNamespace getVariable [QGVAR(rscCustomChat),displayNull]; | ||
private _ctrlText = _customChatTitleDisplay displayCtrl GA_ADMINMESSAGES_IDC_CUSTOMCHATTEXT; | ||
|
||
_ctrlText ctrlSetStructuredText parseText format ["<t color='#E51919'>%1</t> %2",format [localize "STR_grad_ADMINMESSAGES_CHANNEL",_info],_message]; | ||
|
||
private _textHeight = ctrlTextHeight _ctrlText; | ||
/* private _textWidth = ctrlTextWidth _ctrlText; */ | ||
|
||
(ctrlPosition _ctrlText) params ["_origX","_origY","_origW"]; | ||
|
||
_ctrlText ctrlSetPosition [_origX,_origY - _textHeight,_origW,_textHeight]; | ||
_ctrlText ctrlCommit 0; | ||
|
||
}; | ||
|
||
|
||
// add message to chat either way >> user can check chat history on map, if enabled | ||
GVAR(channel) radioChannelAdd [player]; | ||
GVAR(channel) radioChannelSetCallsign format [localize "STR_grad_ADMINMESSAGES_CHANNEL",_info]; | ||
|
||
player customChat [GVAR(channel), _message]; | ||
GVAR(channel) radioChannelRemove [player]; | ||
#include "script_component.hpp" | ||
#include "..\gui\defines.hpp" | ||
|
||
params [["_info",""],["_message",""]]; | ||
|
||
// chat is disabled by grad_minui >> display message in custom rscTitle | ||
if ( | ||
!isNil "grad_minui_fnc_setting" && | ||
{ | ||
(!visibleMap && !(["chat_enabled"] call grad_minui_fnc_setting)) || | ||
(visibleMap && !(["chat_enabled_map"] call grad_minui_fnc_setting)) | ||
} | ||
) then { | ||
|
||
QGVAR(customChatLayer) cutRsc [QGVAR(rscCustomChat),"PLAIN",-1,true]; | ||
private _customChatTitleDisplay = uiNamespace getVariable [QGVAR(rscCustomChat),displayNull]; | ||
private _ctrlText = _customChatTitleDisplay displayCtrl GA_ADMINMESSAGES_IDC_CUSTOMCHATTEXT; | ||
|
||
_ctrlText ctrlSetStructuredText parseText format ["<t color='#E51919'>%1</t> %2",format [localize "STR_grad_ADMINMESSAGES_CHANNEL",_info],_message]; | ||
|
||
private _textHeight = ctrlTextHeight _ctrlText; | ||
/* private _textWidth = ctrlTextWidth _ctrlText; */ | ||
|
||
(ctrlPosition _ctrlText) params ["_origX","_origY","_origW"]; | ||
|
||
_ctrlText ctrlSetPosition [_origX,_origY - _textHeight,_origW,_textHeight]; | ||
_ctrlText ctrlCommit 0; | ||
|
||
}; | ||
|
||
|
||
// add message to chat either way >> user can check chat history on map, if enabled | ||
GVAR(channel) radioChannelAdd [player]; | ||
GVAR(channel) radioChannelSetCallsign format [localize "STR_grad_ADMINMESSAGES_CHANNEL",_info]; | ||
|
||
player customChat [GVAR(channel), _message]; | ||
GVAR(channel) radioChannelRemove [player]; |
148 changes: 75 additions & 73 deletions
148
...dminMessages/functions/fn_initListbox.sqf → ...minMessages/functions/fnc_initListbox.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,75 @@ | ||
#include "script_component.hpp" | ||
|
||
params [["_ctrl",controlNull]]; | ||
|
||
if !([] call grad_adminMessages_fnc_isAdminOrZeus) exitWith {_ctrl ctrlShow false}; | ||
|
||
private _fnc_getHeadlineText = { | ||
params ["_locStr"]; | ||
private _text = localize _locStr; | ||
_text = _text + " ======================================================================================="; | ||
_text = [_text,0,30] call BIS_fnc_trimString; | ||
_text | ||
}; | ||
|
||
private _fnc_addEntry = { | ||
params ["_text","_data"]; | ||
private _index = _ctrl lbAdd _text; | ||
_ctrl lbSetData [_index,if !(_data isEqualType "") then {str _data} else {_data}]; | ||
_index | ||
}; | ||
|
||
private _fnc_addHeadline = { | ||
params ["_locStr"]; | ||
private _index = [[_locStr] call _fnc_getHeadlineText,-1] call _fnc_addEntry; | ||
_ctrl lbSetColor [_index,[0.7,0.7,0.7,1]]; | ||
}; | ||
|
||
|
||
//LATEST CONVERSATIONS ========================================================= | ||
if (!isNil "grad_adminMessages_latestConvos" && {count grad_adminMessages_latestConvos > 0}) then { | ||
["STR_grad_ADMINMESSAGES_LATESTCONVOS"] call _fnc_addHeadline; | ||
{ | ||
_x call _fnc_addEntry; | ||
false | ||
} count grad_adminMessages_latestConvos; | ||
["",-1] call _fnc_addEntry; | ||
}; | ||
|
||
|
||
//BY SIDE ====================================================================== | ||
["STR_grad_ADMINMESSAGES_BYCATEGORY"] call _fnc_addHeadline; | ||
[localize "STR_grad_ADMINMESSAGES_EVERYONE",-2] call _fnc_addEntry; | ||
[localize "STR_grad_ADMINMESSAGES_OTHERADMINS",-3] call _fnc_addEntry; | ||
["BLUFOR",-4] call _fnc_addEntry; | ||
["OPFOR",-5] call _fnc_addEntry; | ||
["INDEPENDENT",-6] call _fnc_addEntry; | ||
["CIVILIAN",-7] call _fnc_addEntry; | ||
["",-1] call _fnc_addEntry; | ||
|
||
|
||
//LIST OF PLAYERS ============================================================== | ||
["STR_grad_ADMINMESSAGES_BYPLAYER"] call _fnc_addHeadline; | ||
private _playerData = []; | ||
{ | ||
_playerData pushBack [toUpper ([_x,true] call BIS_fnc_getName),getPlayerUID _x]; | ||
false | ||
} count ([] call CBA_fnc_players); | ||
_playerData sort false; | ||
|
||
{ | ||
_x call _fnc_addEntry; | ||
false | ||
} count _playerData; | ||
|
||
|
||
//SET CURSEL =================================================================== | ||
if (lbCurSel _ctrl < 0 || lbCurSel _ctrl >= lbSize _ctrl) then { | ||
_ctrl lbSetCurSel 1; | ||
} else { | ||
if (call compile (_ctrl lbData (lbCursel _ctrl)) < 0) then { | ||
_ctrl lbSetCurSel 1; | ||
}; | ||
}; | ||
#include "script_component.hpp" | ||
|
||
params [["_ctrl", controlNull]]; | ||
|
||
uiNamespace setVariable [QGVAR(sendBoxListboxCtrl), _ctrl]; | ||
|
||
if !([] call FUNC(isAdminOrZeus)) exitWith {_ctrl ctrlShow false}; | ||
|
||
private _fnc_getHeadlineText = { | ||
params ["_locStr"]; | ||
private _text = localize _locStr; | ||
_text = _text + " ======================================================================================="; | ||
_text = [_text,0,30] call BIS_fnc_trimString; | ||
_text | ||
}; | ||
|
||
private _fnc_addEntry = { | ||
params ["_text","_data"]; | ||
private _index = _ctrl lbAdd _text; | ||
_ctrl lbSetData [_index,if !(_data isEqualType "") then {str _data} else {_data}]; | ||
_index | ||
}; | ||
|
||
private _fnc_addHeadline = { | ||
params ["_locStr"]; | ||
private _index = [[_locStr] call _fnc_getHeadlineText,-1] call _fnc_addEntry; | ||
_ctrl lbSetColor [_index,[0.7,0.7,0.7,1]]; | ||
}; | ||
|
||
|
||
//LATEST CONVERSATIONS ========================================================= | ||
if (!isNil QGVAR(latestConvos) && {count GVAR(latestConvos) > 0}) then { | ||
["STR_grad_ADMINMESSAGES_LATESTCONVOS"] call _fnc_addHeadline; | ||
{ | ||
_x call _fnc_addEntry; | ||
false | ||
} count GVAR(latestConvos); | ||
["",-1] call _fnc_addEntry; | ||
}; | ||
|
||
|
||
//BY SIDE ====================================================================== | ||
["STR_grad_ADMINMESSAGES_BYCATEGORY"] call _fnc_addHeadline; | ||
[localize "STR_grad_ADMINMESSAGES_EVERYONE",-2] call _fnc_addEntry; | ||
[localize "STR_grad_ADMINMESSAGES_OTHERADMINS",-3] call _fnc_addEntry; | ||
["BLUFOR",-4] call _fnc_addEntry; | ||
["OPFOR",-5] call _fnc_addEntry; | ||
["INDEPENDENT",-6] call _fnc_addEntry; | ||
["CIVILIAN",-7] call _fnc_addEntry; | ||
["",-1] call _fnc_addEntry; | ||
|
||
|
||
//LIST OF PLAYERS ============================================================== | ||
["STR_grad_ADMINMESSAGES_BYPLAYER"] call _fnc_addHeadline; | ||
private _playerData = []; | ||
{ | ||
_playerData pushBack [toUpper ([_x,true] call BIS_fnc_getName),getPlayerUID _x]; | ||
false | ||
} count ([] call CBA_fnc_players); | ||
_playerData sort false; | ||
|
||
{ | ||
_x call _fnc_addEntry; | ||
false | ||
} count _playerData; | ||
|
||
|
||
//SET CURSEL =================================================================== | ||
if (lbCurSel _ctrl < 0 || lbCurSel _ctrl >= lbSize _ctrl) then { | ||
_ctrl lbSetCurSel 1; | ||
} else { | ||
if (call compile (_ctrl lbData (lbCursel _ctrl)) < 0) then { | ||
_ctrl lbSetCurSel 1; | ||
}; | ||
}; |
8 changes: 4 additions & 4 deletions
8
...inMessages/functions/fn_isAdminOrZeus.sqf → ...nMessages/functions/fnc_isAdminOrZeus.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "script_component.hpp" | ||
|
||
serverCommandAvailable "#kick" || | ||
!isNull (getAssignedCuratorlogic player) | ||
#include "script_component.hpp" | ||
|
||
serverCommandAvailable "#kick" || | ||
!isNull (getAssignedCuratorlogic player) |
30 changes: 15 additions & 15 deletions
30
...sages/functions/fn_onRecipientChanged.sqf → ...ages/functions/fnc_onRecipientChanged.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#include "script_component.hpp" | ||
|
||
params [["_ctrl",controlNull],["_selID",-1]]; | ||
|
||
private _data = call compile (_ctrl lbData _selID); | ||
|
||
private _sendButton = uiNamespace getVariable ["grad_adminMessages_sendBoxButtonCtrl",controlNull]; | ||
|
||
if (!(_data isEqualType 0) || {_data == -1}) then { | ||
_sendButton ctrlEnable false; | ||
_sendButton ctrlSetText (localize "STR_grad_ADMINMESSAGES_SELECTVALIDRECIP"); | ||
} else { | ||
_sendButton ctrlEnable true; | ||
_sendButton ctrlSetText format [(localize "STR_grad_ADMINMESSAGES_SENDTO"),_ctrl lbText _selID]; | ||
}; | ||
#include "script_component.hpp" | ||
|
||
params [["_ctrl", controlNull],["_selID", -1]]; | ||
|
||
private _data = call compile (_ctrl lbData _selID); | ||
|
||
private _sendButton = uiNamespace getVariable [QGVAR(sendBoxButtonCtrl), controlNull]; | ||
|
||
if (!(_data isEqualType 0) || {_data == -1}) then { | ||
_sendButton ctrlEnable false; | ||
_sendButton ctrlSetText (localize "STR_grad_ADMINMESSAGES_SELECTVALIDRECIP"); | ||
} else { | ||
_sendButton ctrlEnable true; | ||
_sendButton ctrlSetText format [(localize "STR_grad_ADMINMESSAGES_SENDTO"), _ctrl lbText _selID]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "script_component.hpp" | ||
|
||
params ["_sender", "_UID", "_message", ["_receiveCondition",{[] call FUNC(isAdminOrZeus)}], ["_receiveConditionParams",[]]]; | ||
|
||
if !(hasInterface) exitWith {}; | ||
if !(_receiveConditionParams call _receiveCondition) exitWith {}; | ||
if (profileName == _sender) exitWith {}; | ||
|
||
if (isNil QGVAR(latestConvos)) then {GVAR(latestConvos) = []}; | ||
if (GVAR(latestConvos) find [toUpper _sender,_UID] < 0) then { | ||
reverse GVAR(latestConvos); | ||
GVAR(latestConvos) pushBack [toUpper _sender,_UID]; | ||
reverse GVAR(latestConvos); | ||
}; | ||
if (count GVAR(latestConvos) > 5) then {GVAR(latestConvos) resize 5}; | ||
|
||
[_sender,_message] call FUNC(displayMessage); | ||
|
||
playSound "3DEN_notificationWarning"; |
Oops, something went wrong.