Improve HeartEntry screen
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
|
local cursor_width_padding = 16
|
||||||
|
local cursor_spacing_value = 30
|
||||||
|
|
||||||
local heart_xs= {
|
local heart_xs= {
|
||||||
[PLAYER_1]= SCREEN_WIDTH * .25,
|
[PLAYER_1]= SCREEN_CENTER_X * 0.625,
|
||||||
[PLAYER_2]= SCREEN_WIDTH * .75,
|
[PLAYER_2]= SCREEN_CENTER_X * 1.375,
|
||||||
}
|
}
|
||||||
|
|
||||||
local heart_entries= {}
|
local heart_entries= {}
|
||||||
@@ -9,11 +12,67 @@ for i, pn in ipairs(GAMESTATE:GetEnabledPlayers()) do
|
|||||||
if profile and profile:GetIgnoreStepCountCalories() then
|
if profile and profile:GetIgnoreStepCountCalories() then
|
||||||
heart_entries[pn]= new_numpad_entry{
|
heart_entries[pn]= new_numpad_entry{
|
||||||
Name= pn .. "_heart_entry",
|
Name= pn .. "_heart_entry",
|
||||||
InitCommand= cmd(xy, heart_xs[pn], SCREEN_CENTER_Y),
|
InitCommand= cmd(xy, heart_xs[pn], SCREEN_CENTER_Y+48),
|
||||||
|
value_pos = { 0, -64 },
|
||||||
value_color= PlayerColor(pn),
|
value_color= PlayerColor(pn),
|
||||||
|
value = LoadFont("Common Large") .. {
|
||||||
|
InitCommand=cmd(xy,0,-62),
|
||||||
|
OnCommand=cmd(zoom,0.75;diffuse,PlayerColor(pn);strokecolor,ColorDarkTone(PlayerColor(pn)));
|
||||||
|
SetCommand=function(self, param)
|
||||||
|
self:settext(param[1])
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
button = LoadFont("Common Normal") ..{
|
||||||
|
InitCommand=cmd(shadowlength,1),
|
||||||
|
SetCommand=function(self, param)
|
||||||
|
self:settext(param[1])
|
||||||
|
end,
|
||||||
|
OnCommand=cmd(diffuse,color("0.8,0.8,0.8,1");zoom,0.875),
|
||||||
|
GainFocusCommand=cmd(finishtweening;decelerate,0.125;zoom,1;diffuse,Color.White),
|
||||||
|
LoseFocusCommand=cmd(finishtweening;smooth,0.1;zoom,0.875;diffuse,color("0.8,0.8,0.8,1"))
|
||||||
|
},
|
||||||
|
button_positions = {{-cursor_spacing_value, -cursor_spacing_value}, {0, -cursor_spacing_value}, {cursor_spacing_value, -cursor_spacing_value},
|
||||||
|
{-cursor_spacing_value, 0}, {0, 0}, {cursor_spacing_value, 0},
|
||||||
|
{-cursor_spacing_value, cursor_spacing_value}, {0, cursor_spacing_value}, {cursor_spacing_value, cursor_spacing_value},
|
||||||
|
{-cursor_spacing_value, cursor_spacing_value*2}, {0, cursor_spacing_value*2}, {cursor_spacing_value, cursor_spacing_value*2}},
|
||||||
|
cursor = Def.ActorFrame {
|
||||||
|
-- Move whole container
|
||||||
|
MoveCommand=function(self, param)
|
||||||
|
self:stoptweening()
|
||||||
|
self:decelerate(0.15)
|
||||||
|
self:xy(param[1], param[2])
|
||||||
|
if param[3] then
|
||||||
|
self:z(param[3])
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
--
|
||||||
|
LoadActor( THEME:GetPathG("_frame", "1D"),
|
||||||
|
{ 2/18, 14/18, 2/18 },
|
||||||
|
LoadActor(THEME:GetPathB("_frame", "cursors/rounded fill"))
|
||||||
|
) .. {
|
||||||
|
OnCommand=cmd(diffuse,PlayerDarkColor(pn)),
|
||||||
|
FitCommand=function(self, param)
|
||||||
|
self:playcommand("SetSize",{ Width=param:GetWidth()+cursor_width_padding, tween=cmd(decelerate,0.125)})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
LoadActor( THEME:GetPathG("_frame", "1D"),
|
||||||
|
{ 2/18, 14/18, 2/18 },
|
||||||
|
LoadActor(THEME:GetPathB("_frame", "cursors/rounded gloss"))
|
||||||
|
) .. {
|
||||||
|
OnCommand=cmd(diffuse,PlayerColor(pn)),
|
||||||
|
FitCommand=function(self, param)
|
||||||
|
self:playcommand("SetSize",{ Width=param:GetWidth()+cursor_width_padding, tween=cmd(decelerate,0.125)})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
},
|
||||||
cursor_draw= "first",
|
cursor_draw= "first",
|
||||||
cursor_color= PlayerDarkColor(pn),
|
cursor_color= PlayerDarkColor(pn),
|
||||||
prompt_text= THEME:GetString("ScreenHeartEntry", "Heart Rate"),
|
prompt = LoadFont("Common Bold") .. {
|
||||||
|
Name="prompt",
|
||||||
|
Text=THEME:GetString("ScreenHeartEntry", "Heart Rate"),
|
||||||
|
InitCommand=cmd(xy,0,-96);
|
||||||
|
OnCommand=cmd(shadowlength,1;skewx,-0.125;diffusebottomedge,color("#DDDDDD");strokecolor,Color.Outline);
|
||||||
|
},
|
||||||
max_value= 300,
|
max_value= 300,
|
||||||
auto_done_value= 100,
|
auto_done_value= 100,
|
||||||
}
|
}
|
||||||
@@ -57,6 +116,7 @@ local function timer_update(self)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local args= {
|
local args= {
|
||||||
|
--
|
||||||
Def.ActorFrame{
|
Def.ActorFrame{
|
||||||
Name= "timer",
|
Name= "timer",
|
||||||
InitCommand= function(self)
|
InitCommand= function(self)
|
||||||
@@ -69,23 +129,45 @@ local args= {
|
|||||||
end,
|
end,
|
||||||
Def.BitmapText{
|
Def.BitmapText{
|
||||||
Name= "timer_text", Font= "Common Normal", Text= "00.0",
|
Name= "timer_text", Font= "Common Normal", Text= "00.0",
|
||||||
InitCommand= cmd(xy, SCREEN_CENTER_X, SCREEN_CENTER_Y; diffuse, Color.White)
|
InitCommand= cmd(xy, SCREEN_CENTER_X, SCREEN_CENTER_Y-80; diffuse, Color.White),
|
||||||
|
OnCommand= cmd(strokecolor,Color.Outline),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Def.BitmapText{
|
Def.Quad {
|
||||||
Name= "explanation", Font= "Common Normal",
|
InitCommand=cmd(xy, SCREEN_CENTER_X+1, SCREEN_CENTER_Y-100+1;zoomto,2,2);
|
||||||
Text= THEME:GetString("ScreenHeartEntry", "Enter Heart Rate"),
|
OnCommand=cmd(diffuse,Color.Black;diffusealpha,0.5;linear,0.25;zoomtowidth,420;fadeleft,0.25;faderight,0.25);
|
||||||
InitCommand= cmd(xy, SCREEN_CENTER_X, SCREEN_CENTER_Y-120; diffuse, Color.White)},
|
};
|
||||||
|
Def.Quad {
|
||||||
|
InitCommand=cmd(xy, SCREEN_CENTER_X, SCREEN_CENTER_Y-100;zoomto,2,2);
|
||||||
|
OnCommand=cmd(diffuse,color("#ffd400");shadowcolor,BoostColor(color("#ffd40077"),0.25);linear,0.25;zoomtowidth,420;fadeleft,0.25;faderight,0.25);
|
||||||
|
};
|
||||||
|
Def.BitmapText {
|
||||||
|
Name= "explanation", Font= "Common Large",
|
||||||
|
Text= string.upper(THEME:GetString("ScreenHeartEntry", "Enter Heart Rate")),
|
||||||
|
InitCommand= cmd(xy, SCREEN_CENTER_X, SCREEN_CENTER_Y-128; diffuse, Color.White),
|
||||||
|
OnCommand=cmd(skewx,-0.125;diffuse,color("#ffd400");strokecolor,ColorDarkTone(color("#ffd400")))}
|
||||||
|
,
|
||||||
|
|
||||||
Def.BitmapText{
|
Def.BitmapText{
|
||||||
Name= "song_len_label", Font= "Common Normal",
|
Name= "song_len_label", Font= "Common Normal",
|
||||||
Text= THEME:GetString("ScreenHeartEntry", "Song Length"),
|
Text= THEME:GetString("ScreenHeartEntry", "Song Length"),
|
||||||
InitCommand= cmd(xy, SCREEN_CENTER_X, SCREEN_CENTER_Y-72; diffuse, Color.White)},
|
InitCommand= cmd(xy, SCREEN_CENTER_X, SCREEN_CENTER_Y+192-32; diffuse, Color.White),
|
||||||
|
OnCommand= cmd(shadowlength,1)},
|
||||||
Def.BitmapText{
|
Def.BitmapText{
|
||||||
Name= "song_len", Font= "Common Normal",
|
Name= "song_len", Font= "Common Normal",
|
||||||
Text= SecondsToMMSS(GAMESTATE:GetLastGameplayDuration()),
|
Text= SecondsToMMSS(GAMESTATE:GetLastGameplayDuration()),
|
||||||
InitCommand= cmd(xy, SCREEN_CENTER_X, SCREEN_CENTER_Y-48; diffuse, Color.White)},
|
InitCommand= cmd(xy, SCREEN_CENTER_X, SCREEN_CENTER_Y+192-8; diffuse, Color.White),
|
||||||
|
OnCommand= cmd(shadowlength,1;zoom,0.75),
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for pn in ivalues(GAMESTATE:GetEnabledPlayers()) do
|
||||||
|
args[#args+1] = LoadActor(THEME:GetPathB("_frame","3x3"),"rounded black", 128, 192) .. {
|
||||||
|
InitCommand=cmd(x,heart_xs[pn];y,SCREEN_CENTER_Y+28),
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
for pn, entry in pairs(heart_entries) do
|
for pn, entry in pairs(heart_entries) do
|
||||||
args[#args+1]= entry:create_actors()
|
args[#args+1]= entry:create_actors()
|
||||||
end
|
end
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 420 B |
Binary file not shown.
|
After Width: | Height: | Size: 333 B |
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
@@ -36,8 +36,8 @@ t[#t+1] = LoadFont("Common Bold") .. {
|
|||||||
|
|
||||||
t[#t+1] = Def.Quad {
|
t[#t+1] = Def.Quad {
|
||||||
Name="Underline";
|
Name="Underline";
|
||||||
InitCommand=cmd(x,-SCREEN_CENTER_X+24;y,36;horizalign,left);
|
InitCommand=cmd(x,-SCREEN_CENTER_X+24-4;y,36;horizalign,left);
|
||||||
OnCommand=cmd(diffuse,color("#ffd400");shadowlength,2;shadowcolor,BoostColor(color("#ffd40077"),0.25);linear,0.25;zoomtowidth,192;faderight,0.5);
|
OnCommand=cmd(diffuse,color("#ffd400");shadowlength,2;shadowcolor,BoostColor(color("#ffd40077"),0.25);linear,0.25;zoomtowidth,192;fadeleft,8/192;faderight,0.5);
|
||||||
};
|
};
|
||||||
|
|
||||||
t[#t+1] = LoadFont("Common Bold") .. {
|
t[#t+1] = LoadFont("Common Bold") .. {
|
||||||
|
|||||||
Reference in New Issue
Block a user