From e24216e55b1ef2bb0d94efdcbb480bce589bc094 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 6 Jun 2017 19:50:19 -0700 Subject: [PATCH] UI: Add some missing overrides. --- UI/TouchControlLayoutScreen.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/UI/TouchControlLayoutScreen.cpp b/UI/TouchControlLayoutScreen.cpp index ca99089358..08e1159b04 100644 --- a/UI/TouchControlLayoutScreen.cpp +++ b/UI/TouchControlLayoutScreen.cpp @@ -48,7 +48,7 @@ public: scale_ = theScale_; } - virtual bool IsDown() { + bool IsDown() override { // Don't want the button to enlarge and throw the user's perspective // of button size off whack. return false; @@ -118,7 +118,7 @@ public: squareVisible_ = visible; } - void Draw(UIContext &dc) { + void Draw(UIContext &dc) override { float opacity = g_Config.iTouchButtonOpacity / 100.0f; uint32_t colorBg = colorAlpha(GetButtonColor(), opacity); @@ -151,19 +151,15 @@ public: } }; - void GetContentDimensions(const UIContext &dc, float &w, float &h) const{ + void GetContentDimensions(const UIContext &dc, float &w, float &h) const override { const AtlasImage &image = dc.Draw()->GetAtlas()->images[roundId_]; w = (2 * baseActionButtonSpacing * spacing_) + image.w * scale_; h = (2 * baseActionButtonSpacing * spacing_) + image.h * scale_; } - virtual float GetSpacing() const { return spacing_; } - virtual void SetSpacing(float s) { spacing_ = s; } - - virtual void SavePosition() { - DragDropButton::SavePosition(); - } + float GetSpacing() const override { return spacing_; } + void SetSpacing(float s) override { spacing_ = s; } private: bool circleVisible_, crossVisible_, triangleVisible_, squareVisible_; @@ -180,7 +176,7 @@ public: : DragDropButton(x, y, -1, -1, scale), spacing_(spacing) { } - void Draw(UIContext &dc) { + void Draw(UIContext &dc) override { float opacity = g_Config.iTouchButtonOpacity / 100.0f; uint32_t colorBg = colorAlpha(GetButtonColor(), opacity); @@ -204,14 +200,14 @@ public: } } - void GetContentDimensions(const UIContext &dc, float &w, float &h) const{ + void GetContentDimensions(const UIContext &dc, float &w, float &h) const override { const AtlasImage &image = dc.Draw()->GetAtlas()->images[I_DIR]; w = 2 * D_pad_Radius * spacing_ + image.w * scale_; h = 2 * D_pad_Radius * spacing_ + image.h * scale_; }; - float GetSpacing() const { return spacing_; } - virtual void SetSpacing(float s) { spacing_ = s; } + float GetSpacing() const override { return spacing_; } + void SetSpacing(float s) override { spacing_ = s; } private: float &spacing_;