-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Map editor reuses the files widget for load/save #13173
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
Map editor reuses the files widget for load/save #13173
Conversation
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.
Honestly there's so much change that for this one I'm basically blind approving and trusting your judgement and prior history of good changes
I can't find anything obviously wrong
if (it < 0) existingSavesTable.rows - 1 | ||
else if (it >= existingSavesTable.rows) 0 | ||
else it | ||
private fun getButtonAt(y: Float): FileHandleButton { |
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.
This function is unclear to me
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.
PageUp / PageDown keys go by virtual screen coordinates, unlike Up/Down/Home/End. Since in Map Load the actual buttons are NOT linearly distributed, I go and find the closest button to a "one screen up from current" coordinate. The function existed before, only limited to a rigid one-file - one-cell and all cells same height structure. That meant it's not as simple as asking Gdx what's there, because you would have to treat the decoration rows too, and the complexity wouldn't have been better. That it's a binary search is just my mean-ness.
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.
Yeah! I was so confident I had prepared the load/save stuff well enough to make this a simple plug-it-it, and then it worked perfectly except sometimes it crashed on navigating... Dim light bulb igniting, and bang some approaches were ditched and rewritten differently. |
... plus a few other things, see commit names.
User-visible:
And the surprise: