Code Cleanup WeaponSelect

This commit is contained in:
commy2 2015-09-27 08:51:42 +02:00
parent f77242fce3
commit a078d73230
5 changed files with 14 additions and 13 deletions

View File

@ -375,8 +375,8 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
// @todo still needed? // @todo still needed?
[QGVAR(StateArrested), false, true, QUOTE(ADDON)] call FUNC(defineVariable); [QGVAR(StateArrested), false, true, QUOTE(ADDON)] call FUNC(defineVariable);
["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler); ["displayTextStructured", {_this call FUNC(displayTextStructured)}] call FUNC(addEventhandler);
["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler); ["displayTextPicture", {_this call FUNC(displayTextPicture)}] call FUNC(addEventhandler);
["medical_onUnconscious", { ["medical_onUnconscious", {
params ["_unit", "_isUnconscious"]; params ["_unit", "_isUnconscious"];

View File

@ -1,3 +1,4 @@
class ACE_Settings { class ACE_Settings {
class GVAR(DisplayText) { class GVAR(DisplayText) {
typeName = "BOOL"; typeName = "BOOL";

View File

@ -13,8 +13,8 @@ class Extended_PostInit_EventHandlers {
class Extended_FiredBIS_EventHandlers { class Extended_FiredBIS_EventHandlers {
class CAManBase { class CAManBase {
class GVAR(ThrowGrenade) { class GVAR(throwGrenade) {
clientFiredBIS = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(throwGrenade)};); clientFiredBIS = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(throwGrenade)});
}; };
}; };
}; };

View File

@ -3,7 +3,7 @@
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};
// Add keybinds // add keybinds
["ACE3 Weapons", QGVAR(SelectPistolNew), localize LSTRING(SelectPistol), ["ACE3 Weapons", QGVAR(SelectPistolNew), localize LSTRING(SelectPistol),
{ {
// Conditions: canInteract // Conditions: canInteract

View File

@ -1,10 +1,10 @@
/* /*
* Author: esteldunedain * Author: esteldunedain, commy2
* Display a grenade type and quantity. * Display a grenade type and quantity.
* *
* Arguments: * Arguments:
* 0: magazine class <STRING> * 0: grenade magazine class <STRING>
* 1: number of magazines <NUMBER> * 1: number of grenades <NUMBER>
* *
* Return Value: * Return Value:
* None * None
@ -18,14 +18,14 @@
if !(GVAR(DisplayText)) exitwith {}; if !(GVAR(DisplayText)) exitwith {};
params ["_magazine", "_numberofGrenades"];
private ["_color", "_name", "_text", "_picture"]; private ["_color", "_name", "_text", "_picture"];
params ["_magazine", "_numberofMagazines"]; _color = [[1, 0, 0], [1, 1, 1]] select (_numberofGrenades > 0);
_color = [[1, 0, 0], [1, 1, 1]] select (_numberofMagazines > 0);
_name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort"); _name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort");
_text = [format["%1 x%2", _name, _numberofMagazines], _color] call EFUNC(common,stringToColoredText); _text = [format ["%1 x%2", _name, _numberofGrenades], _color] call EFUNC(common,stringToColoredText);
_picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); _picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture");
[_text, _picture] call EFUNC(common,displayTextPicture); ["displayTextPicture", [_text, _picture]] call EFUNC(common,localEvent);