mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
port reload
This commit is contained in:
parent
addc7feb40
commit
18c9c589c8
@ -1,73 +0,0 @@
|
||||
class CfgPatches {
|
||||
class AGM_Reload {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = 0.60;
|
||||
requiredAddons[] = {AGM_Core};
|
||||
version = "0.95";
|
||||
versionStr = "0.95";
|
||||
versionAr[] = {0,95,0};
|
||||
author[] = {"commy2", "KoffeinFlummi"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgFunctions {
|
||||
class AGM_Reload {
|
||||
class AGM_Reload {
|
||||
file = "\AGM_Reload\functions";
|
||||
class checkAmmo;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Take_EventHandlers {
|
||||
class CAManBase {
|
||||
class AGM_AmmoIndicatorReload {
|
||||
clientTake = "if (_this select 0 == AGM_player && {(_this select 1) in [uniformContainer (_this select 0), vestContainer (_this select 0), backpackContainer (_this select 0)]} && {_this select 2 == currentMagazine (_this select 0)}) then {[_this select 0, vehicle (_this select 0), true] call AGM_Reload_fnc_checkAmmo};";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class AGM_Core_Default_Keys {
|
||||
class checkAmmo {
|
||||
displayName = "$STR_AGM_Reload_checkAmmo";
|
||||
condition = "[_player] call AGM_Core_fnc_canUseWeapon || {_vehicle isKindOf 'StaticWeapon'}";
|
||||
statement = "[_player, _vehicle, false] call AGM_Reload_fnc_checkAmmo";
|
||||
key = 19;
|
||||
shift = 0;
|
||||
control = 1;
|
||||
alt = 0;
|
||||
};
|
||||
};
|
||||
|
||||
class CfgActions {
|
||||
class LoadMagazine;
|
||||
class LoadEmptyMagazine : LoadMagazine {
|
||||
showWindow = 0;
|
||||
textDefault = "";
|
||||
};
|
||||
};
|
||||
|
||||
class RscControlsGroup;
|
||||
class RscText;
|
||||
class RscInGameUI {
|
||||
class RscUnitInfo {
|
||||
// Soldier only
|
||||
class WeaponInfoControlsGroupLeft: RscControlsGroup {
|
||||
class controls {
|
||||
class CA_AmmoCount: RscText {
|
||||
sizeEx = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
// Vehicles only
|
||||
/*class WeaponInfoControlsGroupRight: RscControlsGroup {
|
||||
class controls {
|
||||
class CA_AmmoCount: RscText {
|
||||
sizeEx = 0;
|
||||
};
|
||||
};
|
||||
};*/
|
||||
};
|
||||
};
|
1
addons/reload/$PBOPREFIX$
Normal file
1
addons/reload/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\reload
|
8
addons/reload/CfgActions.hpp
Normal file
8
addons/reload/CfgActions.hpp
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
class CfgActions {
|
||||
class LoadMagazine;
|
||||
class LoadEmptyMagazine : LoadMagazine {
|
||||
showWindow = 0;
|
||||
textDefault = "";
|
||||
};
|
||||
};
|
14
addons/reload/CfgEventHandlers.hpp
Normal file
14
addons/reload/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Take_EventHandlers {
|
||||
class CAManBase {
|
||||
class ACE_AmmoIndicatorReload {
|
||||
clientTake = QUOTE(if (_this select 0 == ACE_player && {(_this select 1) in [ARR_3(uniformContainer (_this select 0), vestContainer (_this select 0), backpackContainer (_this select 0))]} && {_this select 2 == currentMagazine (_this select 0)}) then {[ARR_3(_this select 0, vehicle (_this select 0), true)] call FUNC(checkAmmo)};);
|
||||
};
|
||||
};
|
||||
};
|
24
addons/reload/RscInGameUI.hpp
Normal file
24
addons/reload/RscInGameUI.hpp
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
class RscControlsGroup;
|
||||
class RscText;
|
||||
|
||||
class RscInGameUI {
|
||||
class RscUnitInfo {
|
||||
// Soldiers
|
||||
class WeaponInfoControlsGroupLeft: RscControlsGroup {
|
||||
class controls {
|
||||
class CA_AmmoCount: RscText {
|
||||
sizeEx = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
// Vehicles
|
||||
/*class WeaponInfoControlsGroupRight: RscControlsGroup {
|
||||
class controls {
|
||||
class CA_AmmoCount: RscText {
|
||||
sizeEx = 0;
|
||||
};
|
||||
};
|
||||
};*/
|
||||
};
|
||||
};
|
3
addons/reload/XEH_preInit.sqf
Normal file
3
addons/reload/XEH_preInit.sqf
Normal file
@ -0,0 +1,3 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
PREP(checkAmmo);
|
30
addons/reload/config.cpp
Normal file
30
addons/reload/config.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"commy2","KoffeinFlummi"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgActions.hpp"
|
||||
|
||||
class ACE_Default_Keys {
|
||||
class checkAmmo {
|
||||
displayName = "$STR_ACE_Reload_checkAmmo";
|
||||
condition = QUOTE([_player] call EFUNC(common,canUseWeapon) || {_vehicle isKindOf 'StaticWeapon'});
|
||||
statement = QUOTE([ARR_3(_player, _vehicle, false)] call FUNC(checkAmmo););
|
||||
key = 19;
|
||||
shift = 0;
|
||||
control = 1;
|
||||
alt = 0;
|
||||
};
|
||||
};
|
||||
|
||||
#include "RscInGameUI.hpp"
|
@ -11,10 +11,10 @@
|
||||
* Return value:
|
||||
* Nothing
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define COUNT_BARS 12
|
||||
|
||||
|
||||
private ["_unit", "_vehicle"];
|
||||
|
||||
_unit = _this select 0;
|
||||
@ -82,7 +82,7 @@ if (_unit != _vehicle && !(_vehicle isKindOf "StaticWeapon")) then {
|
||||
for "_a" from 1 to _count do {
|
||||
_string = _string + "|";
|
||||
};
|
||||
_text = [_string, _color] call AGM_Core_fnc_stringToColoredText;
|
||||
_text = [_string, _color] call EFUNC(common,stringToColoredText);
|
||||
|
||||
_string = "";
|
||||
for "_a" from (_count + 1) to (_maxRounds min COUNT_BARS) do {
|
||||
@ -91,11 +91,11 @@ if (_unit != _vehicle && !(_vehicle isKindOf "StaticWeapon")) then {
|
||||
|
||||
composeText [
|
||||
_text,
|
||||
[_string, [0.5, 0.5, 0.5]] call AGM_Core_fnc_stringToColoredText
|
||||
[_string, [0.5, 0.5, 0.5]] call EFUNC(common,stringToColoredText)
|
||||
]
|
||||
};
|
||||
|
||||
_picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture");
|
||||
|
||||
[_text, _picture] call AGM_Core_fnc_displayTextPicture;
|
||||
[_text, _picture] call EFUNC(common,displayTextPicture);
|
||||
};
|
1
addons/reload/functions/script_component.hpp
Normal file
1
addons/reload/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\reload\script_component.hpp"
|
12
addons/reload/script_component.hpp
Normal file
12
addons/reload/script_component.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#define COMPONENT reload
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_RELOAD
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ENABLED_RELOAD
|
||||
#define DEBUG_SETTINGS DEBUG_ENABLED_RELOAD
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Edited with tabler - 2014-09-09 -->
|
||||
<Project name="AGM">
|
||||
<Project name="ACE">
|
||||
<Package name="Reload">
|
||||
<Key ID="STR_AGM_Reload_checkAmmo">
|
||||
<Key ID="STR_ACE_Reload_checkAmmo">
|
||||
<English>Check Ammo</English>
|
||||
<German>Munition prüfen</German>
|
||||
<Spanish>Verificar munición</Spanish>
|
||||
@ -14,7 +14,7 @@
|
||||
<Portuguese>Conferir munições</Portuguese>
|
||||
<Russian>Kонтроль Боеприпасы</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_Reload_Ammo">
|
||||
<Key ID="STR_ACE_Reload_Ammo">
|
||||
<English>Ammo</English>
|
||||
<German>Munition</German>
|
||||
<Spanish>Munición</Spanish>
|
Loading…
Reference in New Issue
Block a user