Skip to content

Commit

Permalink
fix ManageProfiles scroller for 4:3 displays
Browse files Browse the repository at this point in the history
  • Loading branch information
quietly-turning committed May 24, 2019
1 parent 156e55c commit c13e3d3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
26 changes: 12 additions & 14 deletions BGAnimations/ScreenMiniMenuContext underlay.lua
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
-- this is only used for the Screen that manages local profiles so far

local NumRows
local num_rows
local row_height = 28

local t = Def.ActorFrame {
InitCommand=cmd(xy,_screen.cx-_screen.w/6, -16; queuecommand, "Capture"),
return Def.ActorFrame {
InitCommand=cmd(xy,_screen.cx-WideScale(146, 143), -16; queuecommand, "Capture"),
CaptureCommand=function(self)
-- how many rows do we need to accommodate?
NumRows = #SCREENMAN:GetTopScreen():GetChild("Container"):GetChild("")
-- If there are more than 10 rows, they collapse into a scroller anyway,
-- so limit it to 10 if so.
if NumRows > 10 then NumRows = 10 end
num_rows = #SCREENMAN:GetTopScreen():GetChild("Container"):GetChild("")
-- If there are more than 10 rows, they collapse via scroller anyway
-- so don't accommodate the decorative border for more than 10
num_rows = math.min(10, num_rows)
self:queuecommand("Size")
end,


-- white border
-- decorative border
Def.Quad{
SizeCommand=cmd(zoomto, 240, 28*NumRows)
SizeCommand=cmd(zoomto, 240, row_height*num_rows)
},

LoadFont("_miso")..{
InitCommand=cmd(xy,-80, -118; halign,0; diffuse, Color.Black ),
InitCommand=cmd(xy,-99, -118; halign,0; diffuse, Color.Black ),
BeginCommand=function(self)
local profile = GAMESTATE:GetEditLocalProfile()
if profile then
self:settext(profile:GetDisplayName())
end
end
}
}

return t
}
2 changes: 1 addition & 1 deletion BGAnimations/ScreenSelectProfile overlay/PlayerFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ return Def.ActorFrame{
Name="DataFrame",
InitCommand=function(self) self:xy(62,1) end,

-- semi-transparent Quad to the right of this colored frame to contain player mods
-- semi-transparent Quad to the right of this colored frame to present profile stats and mods
Def.Quad {
InitCommand=function(self) self:valign(0):diffuse({0,0,0,0}):zoomto(112,220):y(-111) end,
OnCommand=function(self) self:sleep(0.3):linear(0.1):diffusealpha(0.5) end,
Expand Down
13 changes: 7 additions & 6 deletions metrics.ini
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ NextScreen=Branch.AllowScreenSelectColor()
# function that locks input for 1 second
ScreenOnCommand=

RepeatRate=20
CodeNames="Select"
CodeSelect=GAMESTATE:GetCurrentGame():GetName()=="pump" and "DownLeft-DownRight" or (PREFSMAN:GetPreference("ThreeKeyNavigation") and "MenuLeft-MenuRight" or "Select")

Expand Down Expand Up @@ -1187,7 +1188,7 @@ ItemOnCommand=x,10;halign,0
ColorDisabled=PlayerColor(PLAYER_1)


# For ScreenManageProfile
# the "overlay" that appears in ScreenOptionsManageProfiles while editing an existing local profile
[ScreenMiniMenuContext]
Class="ScreenMiniMenu"
Fallback="ScreenOptionsSimple"
Expand All @@ -1196,7 +1197,7 @@ TimerSeconds=-1
ShowHelp=false
OptionRowNormalMetricsGroup="OptionRowMiniMenuContext"

ContainerOnCommand=zoom,1;accelerate,0.3;diffusealpha,1;
ContainerOnCommand=x,WideScale(-40,0);accelerate,0.3;diffusealpha,1;
LineHighlightOnCommand=visible,false
HeaderOnCommand=visible,false
FooterOnCommand=visible,false
Expand All @@ -1207,14 +1208,14 @@ ShowExitRow=false
AllowRepeatingChangeValueInput=true

[OptionRowMiniMenuContext]
TitleX=_screen.cx - _screen.w/3.5;
TitleOnCommand=zoom,0.8; halign,0; NoStroke;
TitleX=_screen.cx - WideScale(214, 250);
TitleOnCommand=zoom,0.8; halign,0;
TitleGainFocusCommand=diffuse,PlayerColor(PLAYER_1)
TitleLoseFocusCommand=diffuse,color("#FFFFFF")
TitleDisabledCommand=diffuse,color("#DDDDDD")

FrameX=_screen.cx - _screen.w/5 + WideScale(21.5,28.5);
FrameOnCommand=diffusealpha,0.95; zoomx, 1.175
FrameX=_screen.cx - WideScale(106,143);
FrameOnCommand=diffusealpha,0.95; zoomx, 1.17
FrameGainFocusCommand=diffuse,color("#293238"); diffusealpha,0.95;
FrameLoseFocusCommand=diffuse,color("#071016"); diffusealpha,0.95;
FrameDisabledCommand=diffuse,color("#040404"); diffusealpha,0.95;
Expand Down

0 comments on commit c13e3d3

Please sign in to comment.