-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add QOL improvement for the ACE Arsenal loadouts screen (#5973)
* Add search bar in loadouts screen * Add onKeyDown support for the loadouts display * Add ctrl+key support to both editbox in the loadouts screen * Fix syntax error
- Loading branch information
1 parent
65fe101
commit 1b33212
Showing
8 changed files
with
210 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Author: Alganthe | ||
* Handles keyboard inputs inside the searchbars text boxes. | ||
* | ||
* Arguments: | ||
* 0: Loadouts display <DISPLAY> | ||
* 1: Searchbar control <CONTROL> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
#include "..\defines.hpp" | ||
|
||
params ["_display", "_control"]; | ||
|
||
private _textString = ctrlText _control; | ||
|
||
private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; | ||
|
||
if !(GVAR(lastSearchTextLoadouts) isEqualTo "" || {(_textString find GVAR(lastSearchTextLoadouts)) == 0}) then {//don't refill if there is no need | ||
[_display, _display displayCtrl GVAR(currentLoadoutsTab)] call FUNC(fillLoadoutsList); | ||
}; | ||
|
||
GVAR(lastSearchTextLoadouts) = _textString; | ||
if (count _textString == 0) exitWith {}; | ||
|
||
private _contentPanelCtrl = _display displayCtrl IDC_contentPanel; | ||
|
||
private _itemsToGo = (lnbSize _contentPanelCtrl) select 0; | ||
private _lbIndex = 0; | ||
while {_itemsToGo > 0} do { | ||
private _currentData = _contentPanelCtrl lnbText [_lbIndex, 1]; | ||
private _currentClassname = _contentPanelCtrl lnbData [_lbIndex, 0]; | ||
|
||
if ((_currentData isEqualTo "") || {(((toUpper _currentData) find (toUpper _textString)) == -1) && {((toUpper _currentClassname) find (toUpper _textString)) == -1}}) then { | ||
_contentPanelCtrl lnbDeleteRow _lbIndex; | ||
} else { | ||
_lbIndex = _lbIndex + 1; | ||
}; | ||
_itemsToGo = _itemsToGo - 1; | ||
}; | ||
_contentPanelCtrl lnbSetCurSelRow -1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters