Implemented back button for ScreenOptionsCustomizeProfile.
This commit is contained in:
@@ -134,6 +134,13 @@ local function update_list_cursor()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function exit_screen()
|
||||||
|
local profile_id= GAMESTATE:GetEditLocalProfileID()
|
||||||
|
PROFILEMAN:SaveLocalProfile(profile_id)
|
||||||
|
SCREENMAN:GetTopScreen():StartTransitioningScreen("SM_GoToNextScreen")
|
||||||
|
SOUND:PlayOnce(THEME:GetPathS("Common", "Start"))
|
||||||
|
end
|
||||||
|
|
||||||
local function input(event)
|
local function input(event)
|
||||||
local pn= event.PlayerNumber
|
local pn= event.PlayerNumber
|
||||||
if not pn then return false end
|
if not pn then return false end
|
||||||
@@ -165,11 +172,10 @@ local function input(event)
|
|||||||
profile[menu_items[menu_pos].get](profile), active_list)
|
profile[menu_items[menu_pos].get](profile), active_list)
|
||||||
update_list_cursor()
|
update_list_cursor()
|
||||||
elseif item.item_type == "exit" then
|
elseif item.item_type == "exit" then
|
||||||
local profile_id= GAMESTATE:GetEditLocalProfileID()
|
exit_screen()
|
||||||
PROFILEMAN:SaveLocalProfile(profile_id)
|
|
||||||
SCREENMAN:GetTopScreen():StartTransitioningScreen("SM_GoToNextScreen")
|
|
||||||
SOUND:PlayOnce(THEME:GetPathS("Common", "Start"))
|
|
||||||
end
|
end
|
||||||
|
elseif button == "Back" then
|
||||||
|
exit_screen()
|
||||||
else
|
else
|
||||||
if button == "MenuLeft" or button == "MenuUp" then
|
if button == "MenuLeft" or button == "MenuUp" then
|
||||||
if menu_pos > 1 then menu_pos= menu_pos - 1 end
|
if menu_pos > 1 then menu_pos= menu_pos - 1 end
|
||||||
@@ -181,11 +187,13 @@ local function input(event)
|
|||||||
end
|
end
|
||||||
elseif cursor_on_menu == "numpad" then
|
elseif cursor_on_menu == "numpad" then
|
||||||
local done= number_entry:handle_input(button)
|
local done= number_entry:handle_input(button)
|
||||||
if done then
|
if done or button == "Back" then
|
||||||
local item= menu_items[menu_pos]
|
local item= menu_items[menu_pos]
|
||||||
profile[item.set](profile, number_entry.value)
|
if button ~= "Back" then
|
||||||
|
profile[item.set](profile, number_entry.value)
|
||||||
menu_values[menu_pos]:playcommand(
|
menu_values[menu_pos]:playcommand(
|
||||||
"Set", {item_value_to_text(item, number_entry.value)})
|
"Set", {item_value_to_text(item, number_entry.value)})
|
||||||
|
end
|
||||||
fade_actor_to(fader, 0)
|
fade_actor_to(fader, 0)
|
||||||
fade_actor_to(number_entry.container, 0)
|
fade_actor_to(number_entry.container, 0)
|
||||||
cursor_on_menu= "main"
|
cursor_on_menu= "main"
|
||||||
@@ -199,8 +207,11 @@ local function input(event)
|
|||||||
if list_pos < #active_list then list_pos= list_pos + 1 end
|
if list_pos < #active_list then list_pos= list_pos + 1 end
|
||||||
update_list_cursor()
|
update_list_cursor()
|
||||||
menu_values[menu_pos]:playcommand("PressRight")
|
menu_values[menu_pos]:playcommand("PressRight")
|
||||||
elseif button == "Start" then
|
elseif button == "Start" or button == "Back" then
|
||||||
profile[menu_items[menu_pos].set](profile, active_list[list_pos].setting)
|
if button ~= "Back" then
|
||||||
|
profile[menu_items[menu_pos].set](
|
||||||
|
profile, active_list[list_pos].setting)
|
||||||
|
end
|
||||||
local valactor= menu_values[menu_pos]
|
local valactor= menu_values[menu_pos]
|
||||||
left_showing= false
|
left_showing= false
|
||||||
right_showing= false
|
right_showing= false
|
||||||
|
|||||||
@@ -239,6 +239,13 @@ local function update_list_cursor()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function exit_screen()
|
||||||
|
local profile_id= GAMESTATE:GetEditLocalProfileID()
|
||||||
|
PROFILEMAN:SaveLocalProfile(profile_id)
|
||||||
|
SCREENMAN:GetTopScreen():StartTransitioningScreen("SM_GoToNextScreen")
|
||||||
|
SOUND:PlayOnce(THEME:GetPathS("Common", "Start"))
|
||||||
|
end
|
||||||
|
|
||||||
local function input(event)
|
local function input(event)
|
||||||
local pn= event.PlayerNumber
|
local pn= event.PlayerNumber
|
||||||
if not pn then return false end
|
if not pn then return false end
|
||||||
@@ -270,11 +277,10 @@ local function input(event)
|
|||||||
profile[menu_items[menu_pos].get](profile), active_list)
|
profile[menu_items[menu_pos].get](profile), active_list)
|
||||||
update_list_cursor()
|
update_list_cursor()
|
||||||
elseif item.item_type == "exit" then
|
elseif item.item_type == "exit" then
|
||||||
local profile_id= GAMESTATE:GetEditLocalProfileID()
|
exit_screen()
|
||||||
PROFILEMAN:SaveLocalProfile(profile_id)
|
|
||||||
SCREENMAN:GetTopScreen():StartTransitioningScreen("SM_GoToNextScreen")
|
|
||||||
SOUND:PlayOnce(THEME:GetPathS("Common", "Start"))
|
|
||||||
end
|
end
|
||||||
|
elseif button == "Back" then
|
||||||
|
exit_screen()
|
||||||
else
|
else
|
||||||
if button == "MenuLeft" or button == "MenuUp" then
|
if button == "MenuLeft" or button == "MenuUp" then
|
||||||
if menu_pos > 1 then menu_pos= menu_pos - 1 end
|
if menu_pos > 1 then menu_pos= menu_pos - 1 end
|
||||||
@@ -286,11 +292,13 @@ local function input(event)
|
|||||||
end
|
end
|
||||||
elseif cursor_on_menu == "numpad" then
|
elseif cursor_on_menu == "numpad" then
|
||||||
local done= number_entry:handle_input(button)
|
local done= number_entry:handle_input(button)
|
||||||
if done then
|
if done or button == "Back" then
|
||||||
local item= menu_items[menu_pos]
|
local item= menu_items[menu_pos]
|
||||||
profile[item.set](profile, number_entry.value)
|
if button ~= "Back" then
|
||||||
|
profile[item.set](profile, number_entry.value)
|
||||||
menu_values[menu_pos]:playcommand(
|
menu_values[menu_pos]:playcommand(
|
||||||
"Set", {item_value_to_text(item, number_entry.value)})
|
"Set", {item_value_to_text(item, number_entry.value)})
|
||||||
|
end
|
||||||
--fade_actor_to(fader, 0)
|
--fade_actor_to(fader, 0)
|
||||||
fade_actor_to(number_entry.container, 0)
|
fade_actor_to(number_entry.container, 0)
|
||||||
cursor_on_menu= "main"
|
cursor_on_menu= "main"
|
||||||
@@ -304,8 +312,11 @@ local function input(event)
|
|||||||
if list_pos < #active_list then list_pos= list_pos + 1 end
|
if list_pos < #active_list then list_pos= list_pos + 1 end
|
||||||
update_list_cursor()
|
update_list_cursor()
|
||||||
menu_values[menu_pos]:playcommand("PressRight")
|
menu_values[menu_pos]:playcommand("PressRight")
|
||||||
elseif button == "Start" then
|
elseif button == "Start" or button == "Back" then
|
||||||
profile[menu_items[menu_pos].set](profile, active_list[list_pos].setting)
|
if button ~= "Back" then
|
||||||
|
profile[menu_items[menu_pos].set](
|
||||||
|
profile, active_list[list_pos].setting)
|
||||||
|
end
|
||||||
local valactor= menu_values[menu_pos]
|
local valactor= menu_values[menu_pos]
|
||||||
left_showing= false
|
left_showing= false
|
||||||
right_showing= false
|
right_showing= false
|
||||||
|
|||||||
Reference in New Issue
Block a user