Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gunbag - Move gunbag type from inheritance to config property #7022

Merged
merged 4 commits into from
Jun 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addons/gunbag/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class CfgVehicles {
hiddenSelectionsTextures[] = {QPATHTOF(data\gunbag_co.paa)};
maximumLoad = 80;
mass = 11;
ADDON = 1;
};

class GVAR(Tan): ADDON {
Expand Down
2 changes: 1 addition & 1 deletion addons/gunbag/functions/fnc_calculateMass.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "script_component.hpp"
/*
* Author: Ir0n1E
* Calculate mass of weapon an items.
* Calculate mass of weapon and items.
*
* Arguments:
* 0: Weapon <STRING>
Expand Down
2 changes: 1 addition & 1 deletion addons/gunbag/functions/fnc_canInteract.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "script_component.hpp"
/*
* Author: Ir0n1E
* Check if client able to interact with gunbag.
* Check if client is able to interact with gunbag.
*
* Arguments:
* 0: Unit <OBJECT>
Expand Down
4 changes: 2 additions & 2 deletions addons/gunbag/functions/fnc_hasGunbag.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "script_component.hpp"
/*
* Author: Ir0n1E
* Switches gunbag full/empty for mass calculation.
* Check if unit has a gunbag.
*
* Arguments:
* 0: Unit <OBJECT>
Expand All @@ -17,4 +17,4 @@

params ["_unit"];

(backpackContainer _unit) isKindOf QUOTE(ADDON)
getNumber (configFile >> "CfgVehicles" >> (backpack _unit) >> QUOTE(ADDON)) == 1
39 changes: 39 additions & 0 deletions docs/wiki/framework/gunbag-framework.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
layout: wiki
title: Gunbag Framework
description: Explains how to set up gunbags
group: framework
parent: wiki
order: 7
mod: ace
version:
major: 3
minor: 13
patch: 0
---

## 1. Overview

ACE Gunbag provides a framework that allows users to enable putting a gun inside a backpack.


## 2. Config Values

The `ace_gunbag` config entry needs to be set to `1` to enable a backpack to be a gunbag.

```cpp
class Bag_Base;
class ace_gunbag: Bag_Base {
author = "Ir0n1E";
scope = 2;
displayName = CSTRING(Displayname);
model = QPATHTOF(data\ace_gunbag.p3d);
picture = QPATHTOF(ui\gunbag_ca.paa);
icon = QPATHTOF(ui\gunbag_icon_ca.paa);
hiddenSelections[] = {"Camo", "insignia"};
hiddenSelectionsTextures[] = {QPATHTOF(data\gunbag_co.paa)};
maximumLoad = 80;
mass = 11;
ace_gunbag = 1;
};
```