Added Stop Course to pause menu. Hide foreground during pause menu. Changed GiveUpStartText, GiveUpBackText, and SkipSongText to tell the player to double tap for the menu.

This commit is contained in:
Kyzentun Keeslala
2016-01-12 17:37:00 -07:00
parent 0de66f6e1a
commit a3f5682ce2
5 changed files with 39 additions and 11 deletions
+25 -3
View File
@@ -1,7 +1,9 @@
gameplay_pause_count= 0 gameplay_pause_count= 0
course_stopped_by_pause_menu= false
local pause_buttons= {Start= true, Select= true, Back= true} local pause_buttons= {Start= true, Select= true, Back= true}
local pause_double_tap_time= .5 local pause_double_tap_time= 1
local tap_debounce_time= .1
local pause_press_times= {} local pause_press_times= {}
local screen_gameplay= false local screen_gameplay= false
local menu_items= {[PLAYER_1]= {}, [PLAYER_2]= {}} local menu_items= {[PLAYER_1]= {}, [PLAYER_2]= {}}
@@ -16,6 +18,7 @@ if GAMESTATE:IsCourseMode() then
"continue_playing", "continue_playing",
"skip_song", "skip_song",
"forfeit_course", "forfeit_course",
"end_course",
} }
end end
local menu_spacing= 32 local menu_spacing= 32
@@ -95,6 +98,8 @@ local function close_menu(pn)
end end
end end
if not stay_paused then if not stay_paused then
local fg= screen_gameplay:GetChild("SongForeground")
if fg then fg:visible(old_fg_visible) end
screen_gameplay:PauseGame(false) screen_gameplay:PauseGame(false)
end end
end end
@@ -115,6 +120,10 @@ local choice_actions= {
forfeit_course= function(pn) forfeit_course= function(pn)
backout(SelectMusicOrCourse()) backout(SelectMusicOrCourse())
end, end,
end_course= function(pn)
course_stopped_by_pause_menu= true
screen_gameplay:PostScreenMessage("SM_NotesEnded", 0)
end,
} }
local menu_actions= { local menu_actions= {
@@ -166,16 +175,29 @@ local function input(event)
end end
end end
else else
button= event.button
if event.type ~= "InputEventType_FirstPress" then return end if event.type ~= "InputEventType_FirstPress" then return end
if pause_buttons[button] then if pause_buttons[button] then
if pause_press_times[pn] and if GAMESTATE:GetCoinMode() == "CoinMode_Pay" then return end
GetTimeSinceStart() - pause_press_times[pn] <= pause_double_tap_time then if pause_press_times[pn] then
local time_since_press= GetTimeSinceStart() - pause_press_times[pn]
if time_since_press > tap_debounce_time then
if time_since_press <= pause_double_tap_time then
gameplay_pause_count= gameplay_pause_count + 1 gameplay_pause_count= gameplay_pause_count + 1
screen_gameplay:PauseGame(true) screen_gameplay:PauseGame(true)
local fg= screen_gameplay:GetChild("SongForeground")
if fg then
old_fg_visible= fg:GetVisible()
fg:visible(false)
end
show_menu(pn) show_menu(pn)
else else
pause_press_times[pn]= GetTimeSinceStart() pause_press_times[pn]= GetTimeSinceStart()
end end
end
else
pause_press_times[pn]= GetTimeSinceStart()
end
else else
pause_press_times[pn]= nil pause_press_times[pn]= nil
end end
+5
View File
@@ -83,10 +83,15 @@ Disqualified=Score will be disqualified!
HelpText= HelpText=
[ScreenGameplay] [ScreenGameplay]
GiveUpAbortedText=
GiveUpStartText=Double tap &START; to access menu
GiveUpBackText=Double tap &BACK; to access menu
SkipSongText=Double tap &SELECT; to access menu
HelpText= HelpText=
[PauseMenu] [PauseMenu]
continue_playing=Continue Playing continue_playing=Continue Playing
end_course=End Course
forfeit_course=Forfeit Course forfeit_course=Forfeit Course
forfeit_song=Forfeit Song forfeit_song=Forfeit Song
pause_count=Pause Count pause_count=Pause Count
+4
View File
@@ -43,3 +43,7 @@ function thified_curstage_index(on_eval)
return ToEnumShortString(cur_stage) return ToEnumShortString(cur_stage)
end end
end end
function check_stop_course_early()
return course_stopped_by_pause_menu
end
+1 -4
View File
@@ -1610,11 +1610,8 @@ ActiveAttackListP2OffCommand=
# #
# Disable the normal start and select button actions to enable a custom pause # Disable the normal start and select button actions to enable a custom pause
# menu # menu
GivingUpGoesToPrevScreen=false
UnpauseWithStart=false UnpauseWithStart=false
StartGivesUp=false StopCourseEarly=check_stop_course_early()
BackGivesUp=false
SelectSkipsSong=false
[ScreenGameplayShared] [ScreenGameplayShared]
+1 -1
View File
@@ -1859,7 +1859,7 @@ void ScreenSelectMusic::AfterMusicChange()
case SampleMusicPreviewMode_LastSong: // fall through case SampleMusicPreviewMode_LastSong: // fall through
// play the sample music // play the sample music
m_sSampleMusicToPlay = pSong->GetPreviewMusicPath(); m_sSampleMusicToPlay = pSong->GetPreviewMusicPath();
if(ActorUtil::GetFileType(m_sSampleMusicToPlay) != FT_Sound) if(!m_sSampleMusicToPlay.empty() && ActorUtil::GetFileType(m_sSampleMusicToPlay) != FT_Sound)
{ {
LuaHelpers::ReportScriptErrorFmt("Music file %s for song is not a sound file, ignoring.", m_sSampleMusicToPlay.c_str()); LuaHelpers::ReportScriptErrorFmt("Music file %s for song is not a sound file, ignoring.", m_sSampleMusicToPlay.c_str());
m_sSampleMusicToPlay= ""; m_sSampleMusicToPlay= "";