Skip to content

Commit

Permalink
CommandStringPicMenu - support font resize
Browse files Browse the repository at this point in the history
  • Loading branch information
jetrotal committed Jul 22, 2024
1 parent 2a5e12a commit 616128d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5327,8 +5327,17 @@ bool Game_Interpreter::CommandStringPicMenu(const lcf::rpg::EventCommand& com) {

window->SetItemMax(max_item);
//window->SetColumnMax(2);
window->SetMenuItemHeight(data.texts[0].font_size + 4); // TODO: item area with bigger font-sizes could look better...
window->SetMenuItemLineSpacing(data.texts[0].line_spacing);
if (data.texts.empty()) {
Output::Warning("String Picture Menu - String Picture {} is not valid", strpic_index);
return true;
}

int item_height = data.texts[0].font_size + 4;
int item_spacing = data.texts[0].line_spacing;

window->SetMenuItemHeight(item_height);
window->SetMenuItemLineSpacing(item_spacing);

if (window->GetIndex() == -1) window->SetIndex(0);

window->SetActive(true);
Expand All @@ -5340,6 +5349,7 @@ bool Game_Interpreter::CommandStringPicMenu(const lcf::rpg::EventCommand& com) {
game_system->SetSystemGraphic(strpic_system.name, strpic_system.stretch, strpic_system.font);
window->Update();
game_system->SetSystemGraphic(current_system.name, current_system.stretch, current_system.font);

window->SetStretch(strpic_system.stretch);
return HandleMenuSelection();
}
Expand Down

0 comments on commit 616128d

Please sign in to comment.