Add more functions headers, continue code review

This commit is contained in:
Josuan Albin
2017-11-05 15:39:27 +01:00
parent bf944f3cb3
commit a3b3d263c1
29 changed files with 219 additions and 45 deletions

View File

@ -1,6 +1,6 @@
/*
* Author: Dedmen
* Add a listbox row
* Add a listbox row.
*
* Arguments:
* 0: Config category <STRING> (must be "CfgWeapons", "CfgVehicles", "CfgMagazines", "CfgVoice")

View File

@ -1,6 +1,6 @@
/*
* Author: Alganthe, Dedmen
* Add virtual items to the provided target
* Add virtual items to the provided target.
*
* Arguments:
* 0: Target <OBJECT>

View File

@ -1,9 +1,9 @@
/*
* Author: Alganthe
* Add or remove item(s) when the + or - button is pressed in the right panel
* Add or remove item(s) when the + or - button is pressed in the right panel.
*
* Arguments:
* 0: Display <DISPLAY>
* 0: Arsenal display <DISPLAY>
* 1: Add or remove <SCALAR> (-1: remove, 1: Add)
*
* Return Value:

View File

@ -1,9 +1,9 @@
/*
* Author: Alganthe
* Clear container
* Clear the current container.
*
* Arguments:
* 0: Display <DISPLAY>
* 0: Arsenal display <DISPLAY>
*
* Return Value:
* None

View File

@ -1,9 +1,9 @@
/*
* Author: Alganthe
* Export current loadout / default loadouts list to clipboard
* Export current loadout / default loadouts list to clipboard.
*
* Arguments:
* 0: Display <DISPLAY>
* 0: Arsenal display <DISPLAY>
*
* Return Value:
* None
@ -17,7 +17,7 @@ params ["_display"];
if (GVAR(shiftState)) then {
if (isNil QGVAR(defaultLoadoutsList) || {GVAR(defaultLoadoutsList) isEqualTo []}) exitWIth {
[_display, "Default loadouts list is empty"] call FUNC(message);
[_display, "Default loadouts list is empty"] call FUNC(message); //TBL
};
private _listLength = count GVAR(defaultLoadoutsList);
@ -40,12 +40,12 @@ if (GVAR(shiftState)) then {
"ace_clipboard" callExtension "--COMPLETE--";
[_display, "Default loadouts list exported to clipboard"] call FUNC(message);
[_display, "Default loadouts list exported to clipboard"] call FUNC(message); //TBL
} else {
private _export = str getUnitLoadout GVAR(center);
"ace_clipboard" callExtension (_export + ";");
"ace_clipboard" callExtension "--COMPLETE--";
[_display, "Current loadout exported to clipboard"] call FUNC(message);
[_display, "Current loadout exported to clipboard"] call FUNC(message); //TBL
};

View File

@ -1,9 +1,9 @@
/*
* Author: Alganthe
* Hide arsenal's interface
* Hide / show arsenal interface.
*
* Arguments:
* 0: Display <DISPLAY>
* 0: Arsenal display <DISPLAY>
*
* Return Value:
* None

View File

@ -1,9 +1,9 @@
/*
* Author: Alganthe
* Import loadout / default loadouts list from clipboard
* Import loadout / default loadouts list from clipboard.
*
* Arguments:
* 0: Display <DISPLAY>
* 0: Arsenal display <DISPLAY>
*
* Return Value:
* None

View File

@ -1,3 +1,16 @@
/*
* Author: Alganthe
* Delete / unshare loadout currently selected.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Button control <CONTROL>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"

View File

@ -1,3 +1,16 @@
/*
* Author: Alganthe
* Load selected loadout.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Button control <CONTROL>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"

View File

@ -1,9 +1,9 @@
/*
* Author: Alganthe
* Rename selected loadout
* Rename selected loadout.
*
* Arguments:
* 0: Display <DISPLAY>
* 0: Arsenal display <DISPLAY>
* 1: Button control <CONTROL>
*
* Return Value:
@ -18,7 +18,6 @@ params ["_display", "_control"];
if !(ctrlEnabled _control) exitWith {};
private _data = [profileNamespace getVariable [QGVAR(saved_loadouts), []], GVAR(defaultLoadoutsList)] select (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts);
private _contentPanelCtrl = _display displayCtrl IDC_contentPanel;

View File

@ -1,3 +1,16 @@
/*
* Author: Alganthe
* Save selected loadout.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Button control <CONTROL>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"

View File

@ -1,3 +1,16 @@
/*
* Author: Alganthe
* Share selected loadout.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Button control <CONTROL>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"

View File

@ -1,3 +1,17 @@
/*
* Author: Alganthe
* Clear the provided searchbar.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Searchbar control <CONTROL>
* 2: Right button state <BOOL>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"
@ -11,4 +25,4 @@ if (ctrlIDC _control == IDC_leftSearchbar) then {
[_display, _display displayCtrl GVAR(currentLeftPanel)] call FUNC(fillLeftPanel);
} else {
[_display, _display displayCtrl GVAR(currentRightPanel)] call FUNC(fillRightPanel);
};
};

View File

@ -1,6 +1,6 @@
/*
* Author: Alganthe
* FIll arsenal's left panel
* Fill left panel.
*
* Arguments:
* 0: Arsenal display <DISPLAY>

View File

@ -1,3 +1,16 @@
/*
* Author: Alganthe
* Fill loadouts list.
*
* Arguments:
* 0: Loadouts display <DISPLAY>
* 1: Tab control <CONTROL>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"

View File

@ -1,6 +1,6 @@
/*
* Author: Alganthe, Dedmen
* FIll arsenal's left panel
* Author: Alganthe
* Fill right panel.
*
* Arguments:
* 0: Arsenal display <DISPLAY>

View File

@ -1,3 +1,19 @@
/*
* Author: Alganthe
* Update the camera position and pitch/bank.
*
* Arguments:
* 0: Not used
* 1: Arguments <ARRAY>
* 1.1: Mouse area control <CONTROL>
* 1.2: Mouse X position <SCALAR>
* 1.3: Mouse Y position <SCALAR>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"
@ -53,4 +69,4 @@ if (count _RMB > 0) then {
if (!alive (GVAR(center)) || isnull GVAR(center)) then {
(ctrlParent _control) closeDisplay 2;
};
};

View File

@ -1,3 +1,16 @@
/*
* Author: Alganthe
* Handle the mouse wheel.
*
* Arguments:
* 0: Not used
* 1: Mousewheel Z position <SCALAR>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"
@ -9,4 +22,4 @@ private _distanceMin = _distanceMax * 0.15;
private _distance = GVAR(cameraPosition) select 0;
_distance = (_distance - (_zPos / 10)) max _distanceMin min _distanceMax;
GVAR(cameraPosition) set [0, _distance];
GVAR(cameraPosition) set [0, _distance];

View File

@ -1,3 +1,16 @@
/*
* Author: Alganthe
* Handles keyboard inputs inside the searchbars text boxes.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Searchbar control <CONTROL>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"

View File

@ -1,11 +1,11 @@
/*
* Author: Alganthe
* Initialize a box / object for ACE3 arsenal.
* Initialize a box / object for arsenal.
*
* Arguments:
* 0: Target <OBJECT>
* 1: Items <BOOL> or <ARRAY>
* 2: Global <BOOL>
* 2: Initialize globally <BOOL>
*
* Return Value:
* None

View File

@ -1,3 +1,18 @@
/*
* Author: Alganthe
* Update arsenal's info box.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Current panel control <CONTROL>
* 2: Current panel selection <SCALAR>
* 3: Item config entry <CONFIG>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"
@ -56,4 +71,3 @@ if (isClass _itemCfg) then {
_ctrlInfo ctrlSetFade 1;
_ctrlInfo ctrlCommit FADE_DELAY;
};

View File

@ -1,3 +1,16 @@
/*
* Author: Alganthe
* Handles tab changing for the loadouts display.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Tab control <CONTROL>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"

View File

@ -1,9 +1,22 @@
/*
* Author: Alganthe
* Displays messages in arsenal.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Message <STRING>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"
params ["_display", "_message"];
private _messageBoxCtrl = _display displayctrl IDC_message;
private _messageBoxCtrl = _display displayCtrl IDC_message;
private _handle = _messageBoxCtrl getVariable QGVAR(messageBoxHandle);
if !(isNil "_handle") then {
@ -22,20 +35,20 @@ _handle = [_display, _messageBoxCtrl, time + 5, _message, FADE_DELAY] spawn {
};
case (round (_timer - time) == 5): {
_control ctrlsettext _message;
_control ctrlsetfade 1;
_control ctrlcommit 0;
_control ctrlSetText _message;
_control ctrlSetFade 1;
_control ctrlCommit 0;
_control ctrlsetfade 0;
_control ctrlcommit _delay;
_control ctrlSetFade 0;
_control ctrlCommit _delay;
};
};
uiSleep 1;
};
_control ctrlsetfade 1;
_control ctrlcommit _delay;
_control ctrlSetFade 1;
_control ctrlCommit _delay;
terminate _thisScript;
};
_messageBoxCtrl setVariable [QGVAR(messageBoxHandle), _handle];

View File

@ -1,6 +1,6 @@
/*
* Author: Alganthe
* onUnLoad EH for ACE3's arsenal
* onUnLoad EH for arsenal.
*
* Arguments:
* None

View File

@ -1,11 +1,11 @@
/*
* Author: Alganthe
* onLoad EH for ACE3's arsenal
* onLoad EH for arsenal.
*
* Arguments:
* 0: Ignored
* 1: Arguments <ARRAY>
* 1.1: Display <DISPLAY>
* 1.1: Arsenal display <DISPLAY>
*
* Return Value:
* None

View File

@ -1,3 +1,19 @@
/*
* Author: Alganthe
* Handles keyboard inputs in arsenal.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Key being pressed <SCALAR>
* 2: Shift state <BOOL>
* 3: Ctrl state <BOOL>
* 4: Alt state <BOOL>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"
#include "\A3\ui_f\hpp\defineDIKCodes.inc"

View File

@ -1,8 +1,9 @@
/*
* Author: Alganthe
* onUnLoad EH for ACE3's arsenal loadouts display
* onUnLoad EH for arsenal loadouts display.
*
* Arguments:
* None
*
* Return Value:
* None
@ -12,9 +13,6 @@
#include "script_component.hpp"
#include "..\defines.hpp"
params ["", "_args"];
_args params ["_display"];
GVAR(currentLoadoutsTab) = nil;
private _arsenalDisplay = findDisplay IDD_ace_arsenal;

View File

@ -1,11 +1,11 @@
/*
* Author: Alganthe
* onLoad EH for ACE3's arsenal loadouts display
* onLoad EH for arsenal loadouts display.
*
* Arguments:
* 0: Ignored
* 1: Arguments <ARRAY>
* 1.1: Display <DISPLAY>
* 1.1: Loadouts display <DISPLAY>
*
* Return Value:
* None

View File

@ -1,7 +1,7 @@
/*
* Author: Karel Moricky, modified by Alganthe
* Update camera position
* Modernized a bit, modified vars to fit arsenal rewrite
* Modernized a bit, modified vars to fit arsenal rewrite.
*
* Arguments:
* None