mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Settings / Module
This commit is contained in:
parent
e6c7758d3f
commit
dab4822876
@ -15,7 +15,7 @@ class CfgPatches {
|
||||
#include "RscDisplayInventory.hpp"
|
||||
|
||||
class ACE_Settings {
|
||||
class GVAR(inventoryDisplaySize) {
|
||||
class GVAR(useMils) {
|
||||
value = 0;
|
||||
typeName = "SCALAR";
|
||||
isClientSetable = 1;
|
||||
|
@ -18,4 +18,30 @@ class CfgVehicles {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Logic;
|
||||
class Module_F: Logic {
|
||||
class ModuleDescription {};
|
||||
};
|
||||
class GVAR(module): Module_F {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
category = "ACE";
|
||||
displayName = "MK6 Settings";
|
||||
function = QFUNC(moduleInit);
|
||||
scope = 2;
|
||||
isGlobal = 0;
|
||||
// icon = QUOTE(PATHTOF(UI\Icon_.paa));
|
||||
functionPriority = 0;
|
||||
class Arguments {
|
||||
class noComputer {
|
||||
displayName = "No Computer";
|
||||
description = "Removes Computer and Rangefinder";
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
};
|
||||
class ModuleDescription: ModuleDescription {
|
||||
description = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -4,6 +4,7 @@ ADDON = false;
|
||||
|
||||
PREP(handleFired);
|
||||
PREP(handlePlayerVehicleChanged);
|
||||
PREP(moduleInit);
|
||||
PREP(turretDisplayLoaded);
|
||||
|
||||
ADDON = true;
|
||||
|
@ -17,3 +17,22 @@ class CfgPatches {
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
#include "RscInGameUI.hpp"
|
||||
|
||||
class ACE_Settings {
|
||||
class GVAR(useMils) {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
isClientSetable = 1;
|
||||
displayName = "$STR_ACE_mk6mortar_useMils";
|
||||
};
|
||||
// class GVAR(airResistance) {
|
||||
// value = 0;
|
||||
// typeName = "BOOL";
|
||||
// isClientSetable = 0;
|
||||
// };
|
||||
class GVAR(noComputer) {
|
||||
value = 0;
|
||||
typeName = "BOOL";
|
||||
isClientSetable = 0;
|
||||
};
|
||||
};
|
||||
|
@ -27,24 +27,21 @@ if (!(_newVehicle isKindOf "Mortar_01_base_F")) exitWith {};
|
||||
_display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull];
|
||||
if (isNull _display) exitWith {systemChat "null";};
|
||||
|
||||
_hideRangefinder = false;
|
||||
|
||||
_elevDeg = parseNumber ctrlText (_display displayCtrl 175);
|
||||
if (true) then {
|
||||
if (GVAR(useMils)) then {
|
||||
(_display displayCtrl 80175) ctrlSetText str round (_elevDeg * 6400 / 360);
|
||||
hintSilent str (_elevDeg * 6400 / 360);
|
||||
} else {
|
||||
(_display displayCtrl 80175) ctrlSetText str _elevDeg;
|
||||
};
|
||||
|
||||
if (_hideRangefinder) then {
|
||||
if (GVAR(noComputer)) then {
|
||||
(_display displayCtrl 80176) ctrlSetText "";
|
||||
} else {
|
||||
_elevDeg = parseNumber ctrlText (_display displayCtrl 176);
|
||||
if (_elevDeg <= 0) then {
|
||||
(_display displayCtrl 80176) ctrlSetText (ctrlText (_display displayCtrl 176));
|
||||
} else {
|
||||
if (true) then {
|
||||
if (GVAR(useMils)) then {
|
||||
(_display displayCtrl 80176) ctrlSetText str round (_elevDeg * 6400 / 360);
|
||||
} else {
|
||||
(_display displayCtrl 80176) ctrlSetText str _elevDeg;
|
||||
|
25
addons/mk6mortar/functions/fnc_moduleInit.sqf
Normal file
25
addons/mk6mortar/functions/fnc_moduleInit.sqf
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
*
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The Module Logic Object <OBJECT>
|
||||
* 1: synced objects <ARRAY>
|
||||
* 2: Activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_logic,_syncedUnits,_activated);
|
||||
|
||||
if (!_activated) exitWith {WARNING("Module - placed but not active");};
|
||||
if (!isServer) exitWith {};
|
||||
|
||||
[_logic, QGVAR(noComputer), "noComputer"] call EFUNC(common,readSettingFromModule);
|
@ -33,8 +33,6 @@ disableSerialization;
|
||||
_display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull];
|
||||
if (isNull _display) exitWith {};
|
||||
|
||||
_hideRangefinder = true;
|
||||
|
||||
_fnc_hideControl = {
|
||||
PARAMS_2(_path,_hideCtrl);
|
||||
_idc = getNumber (_path >> "IDC");
|
||||
@ -55,8 +53,9 @@ _fnc_hideControl = {
|
||||
};
|
||||
|
||||
{
|
||||
[_x, _hideRangefinder] call _fnc_hideControl;
|
||||
[_x, GVAR(noComputer)] call _fnc_hideControl;
|
||||
} forEach [CTRL_CA_HEADING, CTRL_CA_OPTICSPITCH, CTRL_CA_OPTICSZOOM, CTRL_CA_SOLUTION_TEXT, CTRL_CA_DISTANCE_TEXT, CTRL_CA_DISTANCE, CTRL_CA_TIME_TEXT, CTRL_CA_TIME, CTRL_CA_ELEV_NEED_TEXT, CTRL_CA_RANGEELEMENTS_GROUP];
|
||||
|
||||
//Always hide these, handled by the mil convertions in handlePlayerVehChanged
|
||||
[CTRL_CA_ELEV, true] call _fnc_hideControl;
|
||||
[CTRL_CA_ELEV_NEED, true] call _fnc_hideControl;
|
||||
|
@ -1,6 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Edited with tabler - 2015-01-31 -->
|
||||
<!-- Edited with tabler - 2015-04-05 -->
|
||||
<Project name="ACE">
|
||||
<Package name="mk6mortar">
|
||||
<Key ID="STR_ACE_mk6mortar_useMils">
|
||||
<English>Mk6 Mortar: Show Angle in MILS</English>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user