-
Notifications
You must be signed in to change notification settings - Fork 137
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
Update pipboy.cc with full pagination #464
base: main
Are you sure you want to change the base?
Conversation
Adds pagination to Automaps sub-location (elevation) pages to prevent overflow over the map display. Prevents duplicate entries in main Automaps page list (Fallout Sonora) fixes alexbatalov#461
removed the elimination of duplicated names as there could be a better solution, and it overlaps with other features
Full implementation of pagination for the pipboy. Status, Data, and Automaps, and their subpages can now paginate when entries exceed a range which fits in the page. The 'Video Archives' page was not given pagination, as it seem unlikely it would be needed, and there currently is a limit to number of videos.
Small fix to add correct number of buttons when moving between automap pages.
src/pipboy.cc
Outdated
|
||
// 0x664508 | ||
int gPipboyTab; | ||
|
||
// 0x66450C | ||
int _actcnt; | ||
|
||
int _loccnt; |
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.
Would be nice to have readable names for any newly introduced symbols.
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.
I was trying to follow existing naming conventions.
src/pipboy.cc
Outdated
pipboyDrawText(text2, PIPBOY_TEXT_ALIGNMENT_RIGHT_COLUMN_CENTER, _colorTable[992]); | ||
if ((gPipboyMouseX > 459 && a1 != 1027) || a1 == 1026) { | ||
if (gPipboyHolodiskLastPage <= _view_page) { | ||
if (a1 != 1026) { |
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.
Would be nice to deobfuscate/decypher variable names for any code that's being rewritten.
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.
I'm not really sure what you mean.
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.
I mean you keep using a1
name for the variable. Since the code is being rewritten, might as well name it properly.
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.
Ah, okay. Clear now.
I guess I was just trying to be the least disruptive I could. I am not a coder, and this is the first C++ I have ever coded, and the first PRs I have done, so renaming a bunch of stuff seemed presumptive.
src/pipboy.cc
Outdated
const int maxEntriesPerPage = PIPBOY_STATUS_QUESTLIST_LINES; | ||
|
||
int index = 0; | ||
int v13 = 0; |
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.
See above about deobfuscation. Looking at the diff it's hard to tell which code is new and which was just moved around, so it ended up in the diff. So I would treat any code in the diff as new code with some quality standards.
Trying to do some code improvements here, but ran into a bug/issue that bothers me. Original code does a brief 'highlight' of selected buttons (locations, quests, holodisks etc) before switching to the relevant page. However, Fallout 2 CE seems to load those pages so fast, or in a way, that prevents the highlight from being seen. My code ran a little roughshod over this original feature, as I was not seeing it working. But now I realize that it is supposed to work. So I need to restore the code, and then figure out how to get it working. Here is an example:
|
- improved various variable names - fixed small bug that allowed clicking through quests to quest locations list - consolidated all bottom page navigation to handlePipboyPageNavigation() navigation can be seen/tested by lowering these contstants: // constants for setting lines per page in pagination functions const int PIPBOY_STATUS_QUEST_LINES = 19; const int PIPBOY_STATUS_HOLODISK_LINES = 19; const int PIPBOY_AUTOMAP_LINES = 19; const int PIPBOY_AUTOMAP_SUB_LINES = 5; const int PIPBOY_STATUS_QUESTLIST_LINES = 12;
Adds full pagination to Status, Data and Automaps main and sub pages to prevent overflow.
fixes #461 and makes #465 #466 redundant