From 32218256d7f6be827dcc8d1200de5c2cda305661 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 13 Aug 2013 00:06:48 +0200 Subject: [PATCH] More UI tweaks --- UI/GameScreen.h | 2 +- UI/GameSettingsScreen.h | 6 +++--- UI/MainScreen.cpp | 10 ++++++---- UI/MiscScreens.cpp | 5 +++++ UI/MiscScreens.h | 8 +++++++- native | 2 +- 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/UI/GameScreen.h b/UI/GameScreen.h index e8386138bf..cd0ae57b7b 100644 --- a/UI/GameScreen.h +++ b/UI/GameScreen.h @@ -24,7 +24,7 @@ // set game specific settings, etc. // Uses GameInfoCache heavily to implement the functionality. -class GameScreen : public UIScreen { +class GameScreen : public DialogScreen { public: GameScreen(std::string gamePath) : gamePath_(gamePath) {} diff --git a/UI/GameSettingsScreen.h b/UI/GameSettingsScreen.h index 6d4ca3ba9f..09b345ff62 100644 --- a/UI/GameSettingsScreen.h +++ b/UI/GameSettingsScreen.h @@ -22,7 +22,7 @@ // Per-game settings screen - enables you to configure graphic options, control options, etc // per game. -class GameSettingsScreen : public UIScreenWithBackground { +class GameSettingsScreen : public UIDialogScreenWithBackground { public: GameSettingsScreen(std::string gamePath, std::string gameID = "") : gamePath_(gamePath), gameID_(gameID) {} @@ -48,7 +48,7 @@ private: }; // TODO: Move to its own file. -class GlobalSettingsScreen : public UIScreenWithBackground { +class GlobalSettingsScreen : public UIDialogScreenWithBackground { public: GlobalSettingsScreen() {} @@ -66,7 +66,7 @@ private: bool enableReports_; }; -class DeveloperToolsScreen : public UIScreenWithBackground { +class DeveloperToolsScreen : public UIDialogScreenWithBackground { public: DeveloperToolsScreen() {} diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index c6b0aba134..8105ec2c56 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -63,6 +63,8 @@ public: virtual void Update(const InputState &input_state) { if (down_) holdFrameCount_++; + else + holdFrameCount_ = 0; // Hold button for 1.5 seconds to launch the game directly if (holdFrameCount_ > 90) { UI::EventParams e; @@ -115,14 +117,14 @@ void GameButton::Draw(UIContext &dc) { // Render button int dropsize = 10; if (texture) { + if (txOffset) { + dropsize = 3; + y += txOffset * 2; + } if (HasFocus()) { // dc.Draw()->DrawImage4Grid(I_DROP_SHADOW, x - dropsize, y, x+w + dropsize, y+h+dropsize*1.5, alphaMul(color, 0.5f), 1.0f); // dc.Draw()->Flush(); } else { - if (txOffset) { - dropsize = 3; - y += txOffset * 2; - } dc.Draw()->Flush(); dc.RebindTexture(); dc.Draw()->DrawImage4Grid(I_DROP_SHADOW, x - dropsize, y, x+w + dropsize, y+h+dropsize*1.5, alphaMul(shadowColor, 0.5f), 1.0f); diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 877fc81b41..83824cb45b 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -34,6 +34,11 @@ void UIScreenWithBackground::DrawBackground(UIContext &dc) { dc.Flush(); } +void UIDialogScreenWithBackground::DrawBackground(UIContext &dc) { + ::DrawBackground(1.0f); + dc.Flush(); +} + void PromptScreen::CreateViews() { // Information in the top left. // Back button to the bottom left. diff --git a/UI/MiscScreens.h b/UI/MiscScreens.h index 088d0bc7bf..0b73f55dfb 100644 --- a/UI/MiscScreens.h +++ b/UI/MiscScreens.h @@ -34,8 +34,14 @@ protected: virtual void DrawBackground(UIContext &dc); }; +class UIDialogScreenWithBackground : public DialogScreen { +public: + UIDialogScreenWithBackground() : DialogScreen() {} +protected: + virtual void DrawBackground(UIContext &dc); +}; -class PromptScreen : public UIScreenWithBackground { +class PromptScreen : public UIDialogScreenWithBackground { public: PromptScreen(std::string message, std::string yesButtonText, std::string noButtonText) : message_(message), yesButtonText_(yesButtonText), noButtonText_(noButtonText) { diff --git a/native b/native index 76d0d5ceb3..77fcfd0f20 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 76d0d5ceb38b6c50225a82501e88f96e503b2ee9 +Subproject commit 77fcfd0f2058c1acc91c7a68598df259f6628e2f