-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix page breaks not working properly when any of the 'lang' series of commands are not used #10
base: mod
Are you sure you want to change the base?
Conversation
Only check current_read_language on page wait if current_language_set is set Fixes page breaks not working properly when any of the 'lang' series of commands are not used
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.
If I'm reading the original code correctly, the initial state is the same as if you had run langall
, so while I don't know exactly why that if statement is there, I don't think it's what you want to modify
@@ -432,7 +432,7 @@ int PonscripterLabel::clickNewPage(bool display_char) | |||
{ | |||
const char* c = script_h.getStrBuf(string_buffer_offset); | |||
|
|||
if (current_read_language != -1 && current_read_language != current_language) { |
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 looks like "if current_read_language is not the display language" (AKA "if the script's text is not supposed to be shown")
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.
The initial state is when langall
is set (so current_read_language
would be -1
).
However, when the 'lang' series of commands are never used, current_read_language
would be stuck at -1
, so clickstr_state = CLICK_NEWPAGE;
never gets executed, resulting in the page break glyph not being shown and text continually printing off screen.
This if statement is the correct one to modify.
Maybe the actual issue is that the if statement is inverted from what it should be? If you look at the commit that added it, d43f6e0, you can see |
I have a question about this...in the commit d43f6e0 you posted, and the current version of the code, the ! and # handling has the same condition in the if statement: // Chronotrig, multilang inline command hack, ignore ! and # commands when current language isn't being read
if (current_read_language != -1 && current_read_language != current_language) {
...
//! and # handling goes here>
...
} Say you set the language to English, then I don't remember this being broken in the executable, so I guess I'm misunderstanding something here? Or do |
Never mind, it looks like it's working as intended (I did a quick test and the ! handling works properly) - it's meant to execute on the opposite language, the actual handling for ! and # occurs here: ponscripter-fork/src/PonscripterLabel_text.cpp Lines 617 to 700 in cc7ab36
I think what happens is that code deliberately runs on the opposite language to eat all the tokens before it can get to the "real" |
Just to be clear, I think this is the change tellow is suggesting: 9e72186 - if (current_read_language != -1 && current_read_language != current_language) {
+ if (current_read_language == -1 || current_read_language == current_language) {
clickstr_state = CLICK_NEWPAGE;
} That is, it will trigger if either |
I believe that changing the Because of the multiple layers of control flow occurring, I'm not too sure on a solution without a separate variable that does not break existing behavior… |
What do you expect it to break?
|
Add a flag to be set when any of the 'lang' series of commands are used e.g.
langen
,langjp
,langall
.Only check
current_read_language
on page wait ifcurrent_language_set
is set.Fixes page breaks not working properly when any of the 'lang' series of commands are not used.