From 49d00661082b4cde267d301f1414453bdcdea876 Mon Sep 17 00:00:00 2001 From: freem Date: Thu, 4 Sep 2014 20:41:14 -0500 Subject: [PATCH 1/2] header text shows over the underline; header shadow text shows under it. --- .../ScreenWithMenuElements header/default.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Themes/default/Graphics/ScreenWithMenuElements header/default.lua b/Themes/default/Graphics/ScreenWithMenuElements header/default.lua index 54ace1f6ce..73675ace04 100644 --- a/Themes/default/Graphics/ScreenWithMenuElements header/default.lua +++ b/Themes/default/Graphics/ScreenWithMenuElements header/default.lua @@ -25,10 +25,10 @@ t[#t+1] = LoadActor("Header") .. { }; t[#t+1] = LoadFont("Common Bold") .. { - Name="HeaderText"; + Name="HeaderShadow"; Text=Screen.String("HeaderText"); - InitCommand=cmd(x,-SCREEN_CENTER_X+24;y,26;zoom,1;horizalign,left;shadowlength,0;maxwidth,200); - OnCommand=cmd(visible,IsVisible();skewx,-0.125;diffuse,color("#ffd400");shadowlength,2;shadowcolor,BoostColor(color("#ffd40077"),0.25)); + InitCommand=cmd(x,-SCREEN_CENTER_X+26;y,28;zoom,1;horizalign,left;maxwidth,200); + OnCommand=cmd(visible,IsVisible();skewx,-0.125;diffuse,BoostColor(color("#ffd40077"),0.375);); UpdateScreenHeaderMessageCommand=function(self,param) self:settext(param.Header); end; @@ -40,6 +40,16 @@ t[#t+1] = Def.Quad { OnCommand=cmd(visible,IsVisible();diffuse,color("#ffd400");shadowlength,1;linear,0.25;zoomtowidth,192;faderight,0.5); }; +t[#t+1] = LoadFont("Common Bold") .. { + Name="HeaderText"; + Text=Screen.String("HeaderText"); + InitCommand=cmd(x,-SCREEN_CENTER_X+24;y,26;zoom,1;horizalign,left;shadowlength,0;maxwidth,200); + OnCommand=cmd(visible,IsVisible();skewx,-0.125;diffuse,color("#ffd400");); + UpdateScreenHeaderMessageCommand=function(self,param) + self:settext(param.Header); + end; +}; + t.BeginCommand=function(self) self:SetUpdateFunction( Update ); end From 8e9ec1053d3a7f50c69ff892fb067a2524e2135a Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Thu, 4 Sep 2014 21:18:24 -0600 Subject: [PATCH 2/2] Fixed CanGoLeft logic in SMC. --- src/ScreenMapControllers.cpp | 32 +++++++++++++++++++------------- src/ScreenMapControllers.h | 2 ++ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/ScreenMapControllers.cpp b/src/ScreenMapControllers.cpp index 71979a02fb..3f58579e0a 100644 --- a/src/ScreenMapControllers.cpp +++ b/src/ScreenMapControllers.cpp @@ -429,34 +429,29 @@ bool ScreenMapControllers::Input( const InputEventPlus &input ) } break; case KEY_LEFT: // Move the selection left, wrapping up. - if(CursorOnAction()) + if(!CursorCanGoLeft()) { break; } - if( m_CurSlot == 0 && m_CurController == 0 ) - { - break; // can't go left any more - } BeforeChangeFocus(); - m_CurSlot--; - if( m_CurSlot < 0 ) + if(m_CurSlot == 0) { m_CurSlot = NUM_CHANGABLE_SLOTS-1; - m_CurController--; + --m_CurController; + } + else + { + --m_CurSlot; } AfterChangeFocus(); m_soundChange.Play(); bHandled = true; break; case KEY_RIGHT: // Move the selection right, wrapping down. - if(CursorOnAction()) + if(!CursorCanGoRight()) { break; } - if( m_CurSlot == NUM_CHANGABLE_SLOTS-1 && m_CurController == NUM_GameController-1 ) - { - break; // can't go right any more - } BeforeChangeFocus(); m_CurSlot++; if( m_CurSlot > NUM_CHANGABLE_SLOTS-1 ) @@ -625,6 +620,17 @@ bool ScreenMapControllers::CursorCanGoDown() return m_CurButton < m_KeysToMap.size() + m_Actions.size(); } +bool ScreenMapControllers::CursorCanGoLeft() +{ + return !CursorOnAction() && (m_CurSlot > 0 || m_CurController > 0); +} + +bool ScreenMapControllers::CursorCanGoRight() +{ + return !CursorOnAction() && (m_CurSlot < NUM_CHANGABLE_SLOTS-1 || + m_CurController < NUM_GameController-1); +} + int ScreenMapControllers::CurKeyIndex() { // The header row is at 0, so subtract 1 from m_CurButton. diff --git a/src/ScreenMapControllers.h b/src/ScreenMapControllers.h index 0cfe096352..92ca5bff71 100644 --- a/src/ScreenMapControllers.h +++ b/src/ScreenMapControllers.h @@ -34,6 +34,8 @@ private: bool CursorOnKey(); bool CursorCanGoUp(); bool CursorCanGoDown(); + bool CursorCanGoLeft(); + bool CursorCanGoRight(); int CurKeyIndex(); int CurActionIndex(); void SetCursorFromSetListCurrent();