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

Add "More info in file select" enhancement #3053

Merged
merged 17 commits into from Aug 16, 2023

Conversation

Pepe20129
Copy link
Contributor

Adds the "More info in file select" enhancement which shows the items that you've obtained similarly to how n64 randomizer does it.

Here is a 100% vanilla save file:
image

Here is a new vanilla save file:
Screenshot_3

Here is a new randomizer save file:
Screenshot_2

This doesn't apply when copying or erasing save files:
image

This PR also changes the spoiler log seed hash icons to only appear on quest selection and the file hash icons to appear at the top when a randomizer save file is selected.

@PurpleHato
Copy link
Contributor

PurpleHato commented Jul 1, 2023

Visually, I have a tiny nitpick for the double defence going vertically instead of horizontally, which makes them overlapping the FILE title holder
If you're worrying about the centering of it, you probably can do a very simple conditional to move them accordingly if being double defence or not

@Pepe20129
Copy link
Contributor Author

The reason it goes vertically instead of horizontally is that the numbers of the counter are tied to the icon, so if I shifted it horizontally the numbers would follow one heart instead of being in the middle of them. Also the positions of icons are constant in the current system so that's another reason why I chose to have them vertically (the top one appears or disappears and the bottom one is always there).

@PurpleHato
Copy link
Contributor

The reason it goes vertically instead of horizontally is that the numbers of the counter are tied to the icon, so if I shifted it horizontally the numbers would follow one heart instead of being in the middle of them. Also the positions of icons are constant in the current system so that's another reason why I chose to have them vertically (the top one appears or disappears and the bottom one is always there).

I see, I wonder if it would be possible to create a "dummy" icon that would be hidden and the size of the double defence one which will be used for the number tracking and basically overlay itself at the center of your hearts display?

I'm just throwing some idea on top of my head right now

@Pepe20129
Copy link
Contributor Author

The only way that'd work would be with 4 icons; the dummy one, the normal hearts one and one for each of the double defense hearts.

I could move the double defense icon slightly down so it doesn't overlay the FILE box as much.

Copy link
Contributor

@Archez Archez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the implementation looks clean and the patterns used are easy to follow. Left some minor comments and suggestions below.

@@ -956,6 +956,8 @@ void DrawEnhancementsMenu() {
"This might affect other decal effects\n");
UIWidgets::PaddedEnhancementSliderInt("Text Spacing: %d", "##TEXTSPACING", "gTextSpacing", 4, 6, "", 6, true, true, true);
UIWidgets::Tooltip("Space between text characters (useful for HD font textures)");
UIWidgets::PaddedEnhancementCheckbox("More info in file select", "gFileSelectMoreInfo", true, false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should move to the Gameplay submenu instead. Although it renders icons, it doesn't really feel like a graphics option.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though I'm still not a fan of it's current location, the randomizer enhancements submenu is probably better for this. It should also be enabled by default similar to the other randomizer enhancements

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a randomizer enhancemet specifically, it works with vanilla and mq save files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The feature is not limited to randomizer saves, so that may be confusing. Unless we would rather it be forced on for rando saves, and instead the toggle is only used for vanilla/mq saves?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like that would also be weird

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice, I guess I hadn't considered it being useful outside of rando. disregard my comment then. Default on for rando would be nice to be consistent with zootr

Copy link
Contributor

@garrettjoecox garrettjoecox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is very clean great work!

Only minor feedback I have is we can probably remove the != 0; and == 0 for ints that are effectively bools, especially when the function name makes the return type obvious (HasItem and ShouldRenderItem)

@inspectredc
Copy link
Contributor

Code is very clean great work!

Only minor feedback I have is we can probably remove the != 0; and == 0 for ints that are effectively bools, especially when the function name makes the return type obvious (HasItem and ShouldRenderItem)

I believe they did that because the return type is a different size to the evaluated return statement. I think it would be better to either shift the bits right rather than the flag to the left to effectively make it a bool or just leave it as is since the item tracker apparently does this anyway.

@Pepe20129
Copy link
Contributor Author

Only minor feedback I have is we can probably remove the != 0; and == 0 for ints that are effectively bools, especially when the function name makes the return type obvious (HasItem and ShouldRenderItem)

The reason some of these were added was because when checking for certain values, like quest items with an index over 7, the value would be truncated and would return 0 even if you had the item.

@garrettjoecox
Copy link
Contributor

The reason some of these were added was because when checking for certain values, like quest items with an index over 7, the value would be truncated and would return 0 even if you had the item.

In this case that makes sense:

return (Save_GetSaveMetaInfo(fileIndex)->questItems & (1 << (item - 0x66))) != 0;

But not so much in these cases

HasItem(fileIndex, ITEM_MASK_GORON) == 0
ShouldRenderItem(fileIndex, data->item) != 0
CVarGetInteger("gFileSelectMoreInfo", 0) == 0

@Pepe20129
Copy link
Contributor Author

Removed the unneeded checks

@Malkierian
Copy link
Contributor

Just a thought, have you considered checking if this works with texture packs? We do still have the bugged song display in the item tracker when high-res textures are used, and figured either that would also apply here and should be looked into, or this already accounts for it and the process could be applied to the item tracker.

@Pepe20129
Copy link
Contributor Author

I have not checked it with texture packs, I assume it's also broken. I did notice that the textures that are broken on the check tracker are the ones in ia8 format, so it's probably a bug in the decoding of ia8 textures or packs saving them in the wrong format (rgba instead of ia).

@Malkierian
Copy link
Contributor

OK, so Archez actually just mentioned he figured out the song icons thing, so you shouldn't have to worry.

@garrettjoecox
Copy link
Contributor

Marking this as merge ready, will let it simmer for a bit longer before merging

Copy link
Contributor

@Archez Archez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Only recommendation I have based on earlier conversation is maybe we can change this from a toggle to a dropdown similar to "Allow cursor over empty slots on pause screen", where there is a Never, Only for Rando Saves and Always option.
But that doesn't need to block this PR as is, and can happen in a follow up PR if others agree.

@Pepe20129
Copy link
Contributor Author

Pepe20129 commented Aug 11, 2023

I don't see why someone would want this but only for rando save files, that said, I can add it if others want it

@briaguya-ai
Copy link
Contributor

are the screenshots up to date? the first one has a double heart thing going on
image

@Pepe20129
Copy link
Contributor Author

yes, having two hearts represents double defense, in n64 rando they're next to each other horizontally instead of vertically, the problem was explained before:

The reason it goes vertically instead of horizontally is that the numbers of the counter are tied to the icon, so if I shifted it horizontally the numbers would follow one heart instead of being in the middle of them. Also the positions of icons are constant in the current system so that's another reason why I chose to have them vertically (the top one appears or disappears and the bottom one is always there).

Copy link
Contributor

@briaguya-ai briaguya-ai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'm not the biggest fan of the stacked hearts for double defense, but that definitely shouldn't block merging. One little nit about abbreviated macro names but that also shouldn't block merging.

Comment on lines +63 to +67
#define INV_IC_POS(x, y) {0x4E + ICON_SIZE * x, 0x00 + ICON_SIZE * y}
#define EQP_IC_POS(x, y) {0x7E + ICON_SIZE * x, 0x2A + ICON_SIZE * y}
#define SNG_IC_POS(x, y) {0x49 + SONG_WIDTH * x, 0x45 + SONG_HEIGHT * y}
#define UPG_IC_POS(x, y) {0x5A + ICON_SIZE * x, 0x2A + ICON_SIZE * y}
#define STN_IC_POS(i) {0x29 + ICON_SIZE * i, 0x31}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it'd be nice to have these named without abbreviations

https://www.youtube.com/watch?v=-J3wNP6u5YU&t=68s

@Pepe20129
Copy link
Contributor Author

Pepe20129 commented Aug 11, 2023

I do plan on doing a follow up pr once #3062, #3082 & #3099 are merged to add support for them, I can change the macro names and try to improve the double defense icon in that pr.

@garrettjoecox garrettjoecox merged commit 8872a59 into HarbourMasters:develop Aug 16, 2023
1 check passed
@Pepe20129 Pepe20129 deleted the more_file_select_info branch August 16, 2023 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants