Skip to content

Commit

Permalink
bigger showChoice - workaround to cover all choices
Browse files Browse the repository at this point in the history
for some reason the code couldn't cover all the choice options, so I hacked some additonal fixes
  • Loading branch information
jetrotal committed Jul 13, 2024
1 parent 0fffd3b commit 1278bab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ bool Game_Interpreter::ExecuteCommand(lcf::rpg::EventCommand const& com) {
return CommandManiacControlStrings(com);
case Cmd::Maniac_CallCommand:
return CommandManiacCallCommand(com);
case 3029:
case static_cast<Game_Interpreter::Cmd>(3029):
return CommandManiacControlMessage(com);
default:
return true;
Expand Down Expand Up @@ -1126,6 +1126,8 @@ bool Game_Interpreter::CommandShowChoices(lcf::rpg::EventCommand const& com) { /

// Choices setup
std::vector<std::string> choices = GetChoices(Game_Message::GetMaxLine());
choices.push_back(""); //workaround to make last choice selectable when 5 or more lines.

pm.SetChoiceCancelType(com.parameters[0]);
SetupChoices(choices, com.indent, pm);

Expand Down
9 changes: 6 additions & 3 deletions src/game_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,11 @@ Game_Message::ParseParamResult Game_Message::ParseActor(const char* iter, const
}

int Game_Message::GetMaxLine() {
int output = 0;
if (window->GetHeight() == MESSAGE_BOX_HEIGHT)
return 4;
// return window->GetMaxLinesPerPage();
return (window->GetHeight() - 16 ) / 16;
output = 4;
else
output = (window->GetHeight() - 16 ) / 16;

return output + 1; //workaround to make last choice selectable when 4 lines.
}

0 comments on commit 1278bab

Please sign in to comment.