Started command system
This commit is contained in:
@@ -195,6 +195,7 @@ class Life_Client_Core {
|
||||
class inventoryOpened {};
|
||||
class isUIDActive {};
|
||||
class keyHandler {};
|
||||
class commandHandler {};
|
||||
class loadDeadGear {};
|
||||
class loadGear {};
|
||||
class nearATM {};
|
||||
|
||||
@@ -10,7 +10,6 @@ private ["_value","_action"];
|
||||
if (FETCH_CONST(life_adminlevel) < 2) exitWith {closeDialog 0; hint localize "STR_ANOTF_ErrorLevel";};
|
||||
_value = parseNumber(ctrlText 9922);
|
||||
if (_value < 0) exitWith {};
|
||||
if (_value > 999999) exitWith {hint localize "STR_ANOTF_Fail"};
|
||||
|
||||
_action = [
|
||||
format [localize "STR_ANOTF_CompWarn",[_value] call life_fnc_numberText],
|
||||
|
||||
24
Altis_Life.Altis/core/functions/fn_commandHandler.sqf
Normal file
24
Altis_Life.Altis/core/functions/fn_commandHandler.sqf
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
// Messy and mostly stolen code
|
||||
systemChat "Chat Key pressed";
|
||||
|
||||
// If the key pressed in the chat bar was not enter, move on
|
||||
if ((_this select 1) != 28) exitWith {false};
|
||||
systemChat "Enter Pressed";
|
||||
|
||||
private _chatmsg = ctrlText (finddisplay 24 displayctrl 101);
|
||||
|
||||
if ("/" != (_chatmsg select [0,1])) exitWith { };
|
||||
systemChat _chatmsg;
|
||||
|
||||
(finddisplay 24 displayctrl 101) ctrlSetText "";
|
||||
// closeDialog 0;
|
||||
// (findDisplay 24) closeDisplay 1;
|
||||
|
||||
private _command = (_chatmsg splitString "/");
|
||||
private _args = (_command splitString " ");
|
||||
|
||||
systemChat _command select 0;
|
||||
hint format ["%1", _args];
|
||||
|
||||
(findDisplay 24) displayRemoveEventHandler ["KeyDown", chatCommandEventH];
|
||||
@@ -54,6 +54,21 @@ if (life_container_active) then {
|
||||
true;
|
||||
};
|
||||
|
||||
// Chat commands
|
||||
if (inputAction "Chat" > 0) then
|
||||
{
|
||||
systemChat "Chat Opened";
|
||||
|
||||
chatCommandSpawn = [] spawn
|
||||
{
|
||||
systemChat "Spawned event handler";
|
||||
|
||||
waitUntil {shownChat};
|
||||
waitUntil {!isNull (finddisplay 24 displayctrl 101)};
|
||||
chatCommandEventH = (findDisplay 24) displayAddEventHandler["KeyDown","_this call life_fnc_commandHandler"];
|
||||
};
|
||||
};
|
||||
|
||||
switch (_code) do {
|
||||
// -- Disable commander/tactical view
|
||||
if (LIFE_SETTINGS(getNumber,"disableCommanderView") isEqualTo 1) then {
|
||||
|
||||
Reference in New Issue
Block a user