Module for setting

This commit is contained in:
PabstMirror 2015-06-09 00:00:00 -05:00
parent 9d914d655a
commit 7d08469df9
12 changed files with 77 additions and 26 deletions

View File

@ -1,18 +1,16 @@
class ACE_Settings {
class GVAR(canFingerEachOther) {
typeName = "BOOL";
value = 1;
};
class GVAR(maxRange) {
typeName = "SCALAR";
value = 4;
typeName = "SCALAR";
displayName = CSTRING(maxRange_displayName);
description = CSTRING(maxRange_description);
};
class GVAR(indicatorForSelf) {
value = 1;
typeName = "BOOL";
isClientSettable = 1;
displayName = CSTRING(indicatorForSelf_name);
description = CSTRING(indicatorForSelf_description);
isClientSettable = 1;
typeName = "BOOL";
value = 1;
};
class GVAR(indicatorColor) {
value[] = {0.83, 0.68, 0.21, 0.75};

View File

@ -0,0 +1,20 @@
class CfgVehicles {
class ACE_Module;
class GVAR(moduleSettings): ACE_Module {
scope = 2;
category = "ACE";
displayName = CSTRING(moduleSettings_displayName);
icon = QUOTE(PATHTOF(UI\Icon_Module_finger_ca.paa));
function = QFUNC(moduleSettings);
isGlobal = 0;
author = ECSTRING(common,ACETeam);
class Arguments {
class maxRange {
displayName = CSTRING(maxRange_displayName);
description = CSTRING(maxRange_description);
typeName = "NUMBER";
defaultValue = 4;
};
};
};
};

View File

@ -1,7 +1,5 @@
#include "script_component.hpp"
[QGVAR(fingered), {_this call FUNC(incomingFinger)}] call EFUNC(common,addEventHandler);
if (!hasInterface) exitWith {};
GVAR(lastFPTime) = -1;
@ -9,9 +7,11 @@ GVAR(fingersHash) = HASH_CREATE;
GVAR(pfeh_id) = -1;
["SettingsInitialized", {
//If not enabled, dont't bother adding keybind
if (!GVAR(canFingerEachOther)) exitWith {};
//If not enabled, dont't bother adding keybind or eventhandler
if (GVAR(maxRange) <= 0) exitWith {};
[QGVAR(fingered), {_this call FUNC(incomingFinger)}] call EFUNC(common,addEventHandler);
["ACE3 Common",
QGVAR(finger),
[(localize LSTRING(keyComb)), (localize LSTRING(keyComb_description))],

View File

@ -4,6 +4,7 @@ ADDON = false;
PREP(incomingFinger);
PREP(keyPress);
PREP(moduleSettings);
PREP(perFrameEH);
ADDON = true;

View File

@ -1,18 +1,18 @@
#include "script_component.hpp"
#define RECOMPILE 0
class CfgPatches {
class ace_finger {
units[]={};
weapons[]={};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[]= {"Drill"};
class ADDON {
units[] = {QGVAR(moduleSettings)};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"Drill"};
authorUrl = "https://github.com/TheDrill/";
VERSION_CONFIG;
};
};
#include "ACE_Settings.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"

View File

@ -1,5 +1,5 @@
/*
* Author: TheDrill
* Author: TheDrill, PabstMirror
* On keypress, point and send position to nearby players
*
* Arguments:

View File

@ -0,0 +1,20 @@
/*
* Author: PabstMirror
* Module for fingering settings
*
* Arguments:
* 0: The module logic <OBJECT>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_logic);
if !(isServer) exitWith {};
[_logic, QGVAR(maxRange), "maxRange"] call EFUNC(common,readSettingFromModule);

View File

@ -40,7 +40,7 @@ _iconSize = BASE_SIZE * _fovCorrection;
_drawColor set [3, ((_drawColor select 3) * (_timeLeftToShow / 0.5))];
};
drawIcon3D [FP_ICON, _drawColor, _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "PuristaMedium"];
drawIcon3D [QUOTE(PATHTOF(UI\fp_icon.paa)), _drawColor, _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "PuristaMedium"];
};
} forEach (GVAR(fingersHash) select 0);

View File

@ -1,5 +1,5 @@
#define COMPONENT finger
#include "\z\ace\Addons\main\script_mod.hpp"
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_FINGER
#define DEBUG_MODE_FULL
@ -9,10 +9,9 @@
#define DEBUG_SETTINGS DEBUG_SETTINGS_FINGER
#endif
#include "\z\ace\Addons\main\script_macros.hpp"
#include "\z\ace\addons\main\script_macros.hpp"
#define BASE_SIZE 44
#define FP_ICON "\z\ace\addons\finger\img\fp_icon.paa"
#define FP_TIMEOUT 2
#define FP_ACTION_TIMEOUT 1

View File

@ -22,7 +22,20 @@
<Russian>Действие "показать пальцем на"</Russian>
</Key>
<Key ID="STR_ACE_finger_keyComb_description">
<English>Shows a virtual marker of where you are pointing to nearby units.</English>
<English>Points, and shows a virtual marker of where you are looking to nearby units.</English>
</Key>
<Key ID="STR_ACE_finger_moduleSettings_displayName">
<English>Finger Settings</English>
</Key>
<Key ID="STR_ACE_finger_maxRange_displayName">
<English>Finger Max Range</English>
</Key>
<Key ID="STR_ACE_finger_maxRange_description">
<English>How far away players can finger each other. Set to 0 to disable fingering. [default: 4]</English>
</Key>
<Key ID="STR_ACE_finger_indicatorColor_name">
<English>Finger indicator</English>
<Russian>Пальце-индикатор</Russian>
</Key>
</Package>
</Project>

Binary file not shown.