Skip to content

Commit

Permalink
KOTOR: Remove a call to show from createItem in WidgetListbox
Browse files Browse the repository at this point in the history
Some Jade Empire and KotOR GUI implementations depended on that
behavior. Show widget from addWidget for those instead.
  • Loading branch information
vkremianskii authored and DrMcCoy committed May 11, 2018
1 parent cdec18f commit bcc936a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/engines/jade/gui/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ MainMenu::MainMenu(Module &module, ::Engines::Console *console) : ::Engines::Kot
*/
getListBox("ListBoxButtons")->setFill("");

addWidget(getListBox("ListBoxButtons")->createItem("NEW_GAME"));
addWidget(getListBox("ListBoxButtons")->createItem("LOAD_GAME"));
addWidget(getListBox("ListBoxButtons")->createItem("MINIGAMES"));
addWidget(getListBox("ListBoxButtons")->createItem("OPTIONS"));
addWidget(getListBox("ListBoxButtons")->createItem("CREDITS"));
addWidget(getListBox("ListBoxButtons")->createItem("EXIT"));
addWidget(getListBox("ListBoxButtons")->createItem("NEW_GAME"), true);
addWidget(getListBox("ListBoxButtons")->createItem("LOAD_GAME"), true);
addWidget(getListBox("ListBoxButtons")->createItem("MINIGAMES"), true);
addWidget(getListBox("ListBoxButtons")->createItem("OPTIONS"), true);
addWidget(getListBox("ListBoxButtons")->createItem("CREDITS"), true);
addWidget(getListBox("ListBoxButtons")->createItem("EXIT"), true);

getButton("NEW_GAME")->setText(TalkMan.getString(111));
getButton("LOAD_GAME")->setText(TalkMan.getString(112));
Expand Down
12 changes: 6 additions & 6 deletions src/engines/jade/gui/main/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ OptionsMenu::OptionsMenu(Console *console) : GUI(console) {

Engines::KotOR::WidgetListBox *optionsListBox = getListBox("OptionsListBox");

addWidget(optionsListBox->createItem("AUDIO_SETTINGS"));
addWidget(optionsListBox->createItem("GRAPHIC_SETTINGS"));
addWidget(optionsListBox->createItem("DIFFICULTY"));
addWidget(optionsListBox->createItem("GAME_INFO"));
addWidget(optionsListBox->createItem("CONTROLS"));
addWidget(optionsListBox->createItem("CREDITS"));
addWidget(optionsListBox->createItem("AUDIO_SETTINGS"), true);
addWidget(optionsListBox->createItem("GRAPHIC_SETTINGS"), true);
addWidget(optionsListBox->createItem("DIFFICULTY"), true);
addWidget(optionsListBox->createItem("GAME_INFO"), true);
addWidget(optionsListBox->createItem("CONTROLS"), true);
addWidget(optionsListBox->createItem("CREDITS"), true);

_audioOptionsButton = getButton("AUDIO_SETTINGS");
_videoOptionsButton = getButton("GRAPHIC_SETTINGS");
Expand Down
2 changes: 1 addition & 1 deletion src/engines/kotor/gui/dialogs/confirm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ConfirmDialog::ConfirmDialog(Console *console) : GUI(console), _accepted(false)
guiPanel->setPosition(-guiPanel->getWidth()/2, -guiPanel->getHeight()/2, 0);

_label = getListBox("LB_MESSAGE")->createItem("LBL_MESSAGE");
addWidget(_label);
addWidget(_label, true);
}

void ConfirmDialog::setText(const Common::UString &text) {
Expand Down
1 change: 0 additions & 1 deletion src/engines/kotor/gui/widgets/listbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ KotORWidget *WidgetListBox::createItem(Common::UString name) {
y = y - _itemCount * (item->getHeight() + _padding) + getHeight() - item->getHeight();

item->setPosition(x, y, z);
item->show();

_itemCount += 1;

Expand Down

0 comments on commit bcc936a

Please sign in to comment.