-
Notifications
You must be signed in to change notification settings - Fork 735
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
Arsenal - Favorites System #9307
Merged
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
ff81181
improve page handling
LinkIsGrim 975f2ec
drop MAX_STATS_PER_PAGE for now
LinkIsGrim 1cbdcec
hide stats box when empty
LinkIsGrim 955a40f
improve hiding
LinkIsGrim d824a5a
improve _fnc_hideUnused
LinkIsGrim 7d9c9ba
condition
LinkIsGrim 521d7c6
Merge remote-tracking branch 'upstream' into arsenal-improve-page-han…
LinkIsGrim 033870e
prevent page overflow
LinkIsGrim 7b49f22
Merge branch 'master' of https://github.com/acemod/ACE3 into arsenal-…
LinkIsGrim 4c95f39
favorites var
LinkIsGrim 3b76354
function prep
LinkIsGrim f6daa50
favorites only
LinkIsGrim 7d2a436
improve favorites adding, add include
LinkIsGrim 62ec4c4
fix stupid
LinkIsGrim 64378e3
fix color setting (todo: lnb color)
LinkIsGrim b68824d
add button, finalize
LinkIsGrim 0e6dcb2
setting tooltip
LinkIsGrim b745ac3
stringtable again
LinkIsGrim 064ecdf
fix setting overwrite, improve tooltip
LinkIsGrim c9a9bba
fix losing weapon items
LinkIsGrim a47432e
fix macro
LinkIsGrim fd79ea3
fix setting to intended overwrite
LinkIsGrim 80f4386
remove unnecessary private
LinkIsGrim e5af568
docs
LinkIsGrim 2110643
more docs
LinkIsGrim fe4b0bd
is
LinkIsGrim 103df86
improve button text
LinkIsGrim 2afcfda
docs
LinkIsGrim ffb2b3b
fix tooltip not showing unless menuBar was clicked
LinkIsGrim cbcc6d9
improve weapon accessory lookup
LinkIsGrim ef0fa6d
empty line
LinkIsGrim 62a0b9d
update refresh calls
LinkIsGrim ba7dbdc
fix left panel
LinkIsGrim ea81bda
cleanup currentCargo
LinkIsGrim a04309a
use BI string for favorites
LinkIsGrim ca7af2a
BI strings again
LinkIsGrim 0faa788
no favorites for face/voice/insignia
LinkIsGrim 3386c3f
stringtable again
LinkIsGrim 792598f
Merge remote-tracking branch 'upstream/master' into arsenal-favorites
LinkIsGrim 347c707
add missing setColorRight
LinkIsGrim 3ab3a64
Merge branch 'master' into arsenal-favorites
LinkIsGrim 0038628
Add comment for favorites setup
LinkIsGrim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,32 @@ | ||
#include "script_component.hpp" | ||
#include "..\defines.hpp" | ||
/* | ||
* Author: LinkIsGrim | ||
* Switches the arsenal between displaying all items and favorites | ||
* | ||
* Arguments: | ||
* 0: Arsenal display <DISPLAY> | ||
* 1: Button control <CONTROL> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_display", "_control"]; | ||
|
||
private _firstRun = false; | ||
|
||
if (isNil QGVAR(favoritesOnly)) then { | ||
GVAR(favoritesOnly) = GVAR(defaultToFavorites); | ||
_firstRun = true; | ||
} else { | ||
GVAR(favoritesOnly) = !GVAR(favoritesOnly); | ||
}; | ||
|
||
_control ctrlSetText format ["%1: %2", localize "STR_GEAR_ITEMS", localize (["str_word_all", "STR_3DEN_Favorite_textPlural"] select GVAR(favoritesOnly))]; | ||
|
||
if (_firstRun) exitWith {}; | ||
|
||
[false] call FUNC(refresh); |
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
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,50 @@ | ||
#include "script_component.hpp" | ||
#include "..\defines.hpp" | ||
#include "\a3\ui_f\hpp\defineResincl.inc" | ||
/* | ||
* Author: LinkIsGrim | ||
* Add or remove item(s) to favorites when LShift is pressed | ||
* | ||
* Arguments: | ||
* 0: Left panel control <CONTROL> | ||
* 1: Left panel selection <NUMBER> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Public: No | ||
*/ | ||
params ["_control", "_curSel"]; | ||
|
||
if !(GVAR(shiftState)) exitWith {}; | ||
|
||
if (GVAR(currentLeftPanel) in [IDC_buttonFace, IDC_buttonVoice, IDC_buttonInsigina]) exitWith {}; | ||
|
||
private _isLnB = (ctrlType _control) == CT_LISTNBOX; | ||
|
||
private _favorited = false; | ||
|
||
// Favorites/blacklist will always be lowercase to handle configCase changes | ||
private _item = ""; | ||
if (_isLnB) then { | ||
_item = toLower (_control lnbData [_curSel, 0]); | ||
} else { | ||
_item = toLower (_control lbData _curSel); | ||
}; | ||
|
||
if (_item in GVAR(favorites)) then { | ||
GVAR(favorites) deleteAt _item; | ||
} else { | ||
GVAR(favorites) set [_item, nil]; | ||
_favorited = true; | ||
}; | ||
|
||
private _color = ([[1, 1, 1], GVAR(favoritesColor)] select _favorited) + [1]; | ||
|
||
if (_isLnB) then { | ||
_control lnbSetColor [[_curSel, 1], _color]; | ||
_control lnbSetColorRight [[_curSel, 1], _color]; | ||
} else { | ||
_control lbSetColor [_curSel, _color]; | ||
_control lbSetSelectColor [_curSel, _color]; | ||
}; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since alpha is modified for the right panel (in case the item doesn't fit), I opted for this solution instead, but it's a bit dirty.