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:
@@ -1,7 +1,9 @@
|
||||
gameplay_pause_count= 0
|
||||
course_stopped_by_pause_menu= false
|
||||
|
||||
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 screen_gameplay= false
|
||||
local menu_items= {[PLAYER_1]= {}, [PLAYER_2]= {}}
|
||||
@@ -16,6 +18,7 @@ if GAMESTATE:IsCourseMode() then
|
||||
"continue_playing",
|
||||
"skip_song",
|
||||
"forfeit_course",
|
||||
"end_course",
|
||||
}
|
||||
end
|
||||
local menu_spacing= 32
|
||||
@@ -95,6 +98,8 @@ local function close_menu(pn)
|
||||
end
|
||||
end
|
||||
if not stay_paused then
|
||||
local fg= screen_gameplay:GetChild("SongForeground")
|
||||
if fg then fg:visible(old_fg_visible) end
|
||||
screen_gameplay:PauseGame(false)
|
||||
end
|
||||
end
|
||||
@@ -115,6 +120,10 @@ local choice_actions= {
|
||||
forfeit_course= function(pn)
|
||||
backout(SelectMusicOrCourse())
|
||||
end,
|
||||
end_course= function(pn)
|
||||
course_stopped_by_pause_menu= true
|
||||
screen_gameplay:PostScreenMessage("SM_NotesEnded", 0)
|
||||
end,
|
||||
}
|
||||
|
||||
local menu_actions= {
|
||||
@@ -166,13 +175,26 @@ local function input(event)
|
||||
end
|
||||
end
|
||||
else
|
||||
button= event.button
|
||||
if event.type ~= "InputEventType_FirstPress" then return end
|
||||
if pause_buttons[button] then
|
||||
if pause_press_times[pn] and
|
||||
GetTimeSinceStart() - pause_press_times[pn] <= pause_double_tap_time then
|
||||
gameplay_pause_count= gameplay_pause_count + 1
|
||||
screen_gameplay:PauseGame(true)
|
||||
show_menu(pn)
|
||||
if GAMESTATE:GetCoinMode() == "CoinMode_Pay" then return end
|
||||
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
|
||||
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)
|
||||
else
|
||||
pause_press_times[pn]= GetTimeSinceStart()
|
||||
end
|
||||
end
|
||||
else
|
||||
pause_press_times[pn]= GetTimeSinceStart()
|
||||
end
|
||||
|
||||
@@ -83,10 +83,15 @@ Disqualified=Score will be disqualified!
|
||||
HelpText=
|
||||
|
||||
[ScreenGameplay]
|
||||
GiveUpAbortedText=
|
||||
GiveUpStartText=Double tap &START; to access menu
|
||||
GiveUpBackText=Double tap &BACK; to access menu
|
||||
SkipSongText=Double tap &SELECT; to access menu
|
||||
HelpText=
|
||||
|
||||
[PauseMenu]
|
||||
continue_playing=Continue Playing
|
||||
end_course=End Course
|
||||
forfeit_course=Forfeit Course
|
||||
forfeit_song=Forfeit Song
|
||||
pause_count=Pause Count
|
||||
|
||||
@@ -43,3 +43,7 @@ function thified_curstage_index(on_eval)
|
||||
return ToEnumShortString(cur_stage)
|
||||
end
|
||||
end
|
||||
|
||||
function check_stop_course_early()
|
||||
return course_stopped_by_pause_menu
|
||||
end
|
||||
|
||||
@@ -1610,11 +1610,8 @@ ActiveAttackListP2OffCommand=
|
||||
#
|
||||
# Disable the normal start and select button actions to enable a custom pause
|
||||
# menu
|
||||
GivingUpGoesToPrevScreen=false
|
||||
UnpauseWithStart=false
|
||||
StartGivesUp=false
|
||||
BackGivesUp=false
|
||||
SelectSkipsSong=false
|
||||
StopCourseEarly=check_stop_course_early()
|
||||
|
||||
[ScreenGameplayShared]
|
||||
|
||||
|
||||
@@ -1859,7 +1859,7 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
case SampleMusicPreviewMode_LastSong: // fall through
|
||||
// play the sample music
|
||||
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());
|
||||
m_sSampleMusicToPlay= "";
|
||||
|
||||
Reference in New Issue
Block a user