diff --git a/common/settings.cpp b/common/settings.cpp index bff02b6d..cb32f743 100644 --- a/common/settings.cpp +++ b/common/settings.cpp @@ -36,6 +36,8 @@ SettingsClass::SettingsClass() void SettingsClass::Load(INIClass& ini) { + char buf[128]; + /* ** Mouse settings */ @@ -77,6 +79,15 @@ void SettingsClass::Load(INIClass& ini) if (Video.Boxing || Mouse.RawInput || Mouse.ControllerEnabled) { Video.HardwareCursor = false; } + + ini.Get_String("Video", "ButtonStyle", "Default", buf, sizeof(buf)); + if (!stricmp(buf, "Gold")) { + Video.ButtonStyle = 1; + } else if (!stricmp(buf, "Classic") || !stricmp(buf, "DOS")) { + Video.ButtonStyle = 0; + } else { + Video.ButtonStyle = -1; + } } void SettingsClass::Save(INIClass& ini) @@ -111,4 +122,6 @@ void SettingsClass::Save(INIClass& ini) ** VQA and WSA interpolation mode 0 = scanlines, 1 = vertical doubling, 2 = linear */ ini.Put_Int("Video", "InterpolationMode", Video.InterpolationMode); + + ini.Put_String("Video", "ButtonStyle", Video.ButtonStyle == -1 ? "Default" : (Video.ButtonStyle == 1 ? "Gold" : "Classic")); } diff --git a/common/settings.h b/common/settings.h index cd2b4ea3..304127b5 100644 --- a/common/settings.h +++ b/common/settings.h @@ -33,6 +33,7 @@ class SettingsClass int InterpolationMode; bool HardwareCursor; bool DOSMode; + int ButtonStyle; std::string Scaler; std::string Driver; std::string PixelFormat; diff --git a/tiberiandawn/dialog.cpp b/tiberiandawn/dialog.cpp index f1843961..6754ffe5 100644 --- a/tiberiandawn/dialog.cpp +++ b/tiberiandawn/dialog.cpp @@ -44,6 +44,7 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "function.h" +#include "settings.h" /*********************************************************************************************** * Dialog_Box -- draws a dialog background box * @@ -93,10 +94,8 @@ extern void CC_Texture_Fill(void const* shapefile, int shapenum, int xpos, int y void Draw_Box(int x, int y, int w, int h, BoxStyleEnum up, bool filled) { - static BoxStyleType const ButtonColors[BOXSTYLE_COUNT] = { - + static BoxStyleType const ButtonColorsClassic[BOXSTYLE_COUNT] = { // Filler, Shadow, Hilite, Corner colors - {LTGREY, WHITE, DKGREY, LTGREY}, // 0 Button is down. {LTGREY, DKGREY, WHITE, LTGREY}, // 1 Button is up w/border. {LTBLUE, BLUE, LTCYAN, LTBLUE}, // 2 Raised blue. @@ -105,29 +104,45 @@ void Draw_Box(int x, int y, int w, int h, BoxStyleEnum up, bool filled) {LTGREY, DKGREY, WHITE, LTGREY}, // 5 Button is up w/arrows. {CC_GREEN_BKGD, CC_LIGHT_GREEN, CC_GREEN_SHADOW, CC_GREEN_CORNERS}, // 6 Button is down. {CC_GREEN_BKGD, CC_GREEN_SHADOW, CC_LIGHT_GREEN, CC_GREEN_CORNERS}, // 7 Button is up w/border. - // {CC_GREEN_BKGD, 14, 12, 13}, // 6 Button is down. - // {CC_GREEN_BKGD, 12, 14, 13}, // 7 Button is up w/border. {DKGREY, WHITE, BLACK, DKGREY}, // 8 Button is disabled down. {DKGREY, BLACK, LTGREY, DKGREY}, // 9 Button is disabled up. {BLACK, CC_GREEN_BOX, CC_GREEN_BOX, BLACK}, // 10 List box. {BLACK, CC_GREEN_BOX, CC_GREEN_BOX, BLACK}, // 11 Menu box. - // {BLACK, 14, 14, BLACK}, // 10 List box. - // {BLACK, 14, 14, BLACK}, // 11 Menu box. }; + static BoxStyleType const ButtonColorsGold[BOXSTYLE_COUNT] = { + // Filler, Shadow, Hilite, Corner colors + {LTGREY, WHITE, DKGREY, LTGREY}, // 0 Button is down. + {LTGREY, DKGREY, WHITE, LTGREY}, // 1 Button is up w/border. + {LTBLUE, BLUE, LTCYAN, LTBLUE}, // 2 Raised blue. + {DKGREY, WHITE, BLACK, DKGREY}, // 3 Button is disabled down. + {DKGREY, BLACK, WHITE, LTGREY}, // 4 Button is disabled up. + {LTGREY, DKGREY, WHITE, LTGREY}, // 5 Button is up w/arrows. + {CC_GREEN_BKGD, 14, 12, 13}, // 6 Button is down. + {CC_GREEN_BKGD, 12, 14, 13}, // 7 Button is up w/border. + {DKGREY, WHITE, BLACK, DKGREY}, // 8 Button is disabled down. + {DKGREY, BLACK, LTGREY, DKGREY}, // 9 Button is disabled up. + {BLACK, 14, 14, BLACK}, // 10 List box. + {BLACK, 14, 14, BLACK}, // 11 Menu box. + }; + + bool useGoldStyle; + if (Settings.Video.ButtonStyle == -1) { + useGoldStyle = !Settings.Video.DOSMode; + } else { + useGoldStyle = Settings.Video.ButtonStyle == 1; + } + w--; h--; - BoxStyleType const& style = ButtonColors[up]; + BoxStyleType const& style = useGoldStyle ? ButtonColorsGold[up] : ButtonColorsClassic[up]; if (filled) { - /* - if (style.Filler == CC_GREEN_BKGD) { + if (useGoldStyle && style.Filler == CC_GREEN_BKGD) { CC_Texture_Fill(MFCD::Retrieve("BTEXTURE.SHP"), InMainLoop, x, y, w, h); } else { LogicPage->Fill_Rect(x, y, x + w, y + h, style.Filler); } - */ - LogicPage->Fill_Rect(x, y, x + w, y + h, style.Filler); } switch (up) {