port reload

This commit is contained in:
commy2 2015-01-16 02:25:41 +01:00
parent addc7feb40
commit 18c9c589c8
11 changed files with 100 additions and 80 deletions

View File

@ -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;
};
};
};*/
};
};

View File

@ -0,0 +1 @@
z\ace\addons\reload

View File

@ -0,0 +1,8 @@
class CfgActions {
class LoadMagazine;
class LoadEmptyMagazine : LoadMagazine {
showWindow = 0;
textDefault = "";
};
};

View 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)};);
};
};
};

View 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;
};
};
};*/
};
};

View File

@ -0,0 +1,3 @@
#include "script_component.hpp"
PREP(checkAmmo);

30
addons/reload/config.cpp Normal file
View 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"

View File

@ -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);
};

View File

@ -0,0 +1 @@
#include "\z\ace\addons\reload\script_component.hpp"

View 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"

View File

@ -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>