Skip to content

Commit

Permalink
KOTOR: Add colors to left/right buttons and set highlight to static
Browse files Browse the repository at this point in the history
  • Loading branch information
fdde authored and DrMcCoy committed Oct 29, 2017
1 parent 84a4ce4 commit 75c923a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/engines/kotor/gui/options/gameplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ OptionsGameplayMenu::OptionsGameplayMenu(::Engines::Console *console) : GUI(cons

//Hardcoded, the gui file returns 1.0, 1.0, 1.0, 1.0
getButton("BTN_DIFFLEFT", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getButton("BTN_DIFFLEFT", true)->setStaticHighlight();
getButton("BTN_DIFFRIGHT", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getButton("BTN_DIFFRIGHT", true)->setStaticHighlight();
getCheckBox("CB_LEVELUP", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getCheckBox("CB_INVERTCAM", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getCheckBox("CB_AUTOSAVE", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
Expand Down
13 changes: 13 additions & 0 deletions src/engines/kotor/gui/options/graphicsadv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include "src/engines/kotor/gui/options/graphicsadv.h"

#include "src/engines/kotor/gui/widgets/button.h"
#include "src/engines/kotor/gui/widgets/checkbox.h"

namespace Engines {
Expand All @@ -38,6 +39,18 @@ OptionsGraphicsAdvancedMenu::OptionsGraphicsAdvancedMenu(::Engines::Console *con
load("optgraphicsadv");

//Hardcoded, the gui file returns incorrect values
getButton("BTN_TEXQUALLEFT", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getButton("BTN_TEXQUALLEFT", true)->setStaticHighlight();
getButton("BTN_TEXQUALRIGHT", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getButton("BTN_TEXQUALRIGHT", true)->setStaticHighlight();
getButton("BTN_ANTIALIASLEFT", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getButton("BTN_ANTIALIASLEFT", true)->setStaticHighlight();
getButton("BTN_ANTIALIASRIGHT", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getButton("BTN_ANTIALIASRIGHT", true)->setStaticHighlight();
getButton("BTN_ANISOTROPYLEFT", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getButton("BTN_ANISOTROPYLEFT", true)->setStaticHighlight();
getButton("BTN_ANISOTROPYRIGHT", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getButton("BTN_ANISOTROPYRIGHT", true)->setStaticHighlight();
getCheckBox("CB_FRAMEBUFF", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getCheckBox("CB_VSYNC", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getCheckBox("CB_SOFTSHADOWS", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
Expand Down
5 changes: 5 additions & 0 deletions src/engines/kotor/gui/options/soundadv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include "src/engines/kotor/gui/options/soundadv.h"

#include "src/engines/kotor/gui/widgets/button.h"
#include "src/engines/kotor/gui/widgets/checkbox.h"

namespace Engines {
Expand All @@ -38,6 +39,10 @@ OptionsSoundAdvancedMenu::OptionsSoundAdvancedMenu(::Engines::Console *console)
load("optsoundadv");

//Hardcoded, the gui file returns incorrect values
getButton("BTN_EAXLEFT", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getButton("BTN_EAXLEFT", true)->setStaticHighlight();
getButton("BTN_EAXRIGHT", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
getButton("BTN_EAXRIGHT", true)->setStaticHighlight();
getCheckBox("CB_FORCESOFTWARE", true)->setColor(0.0f, 0.658824f, 0.980392f, 1.0f);
}

Expand Down
4 changes: 4 additions & 0 deletions src/engines/kotor/gui/widgets/button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ void WidgetButton::setPermanentHighlight(bool permanentHighlight) {
}
}

void WidgetButton::setStaticHighlight() {
getQuadHighlightableComponent()->setHighlightLowerBound(1, 1, 0, 1);
}

void WidgetButton::setDisableHighlight(bool disableHighlight) {
_disableHighlight = disableHighlight;

Expand Down
1 change: 1 addition & 0 deletions src/engines/kotor/gui/widgets/button.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class WidgetButton : public KotORWidget {
~WidgetButton();

void setPermanentHighlight(bool);
void setStaticHighlight();
void setDisableHighlight(bool);
void setDisableHoverSound(bool);

Expand Down

0 comments on commit 75c923a

Please sign in to comment.