Skip to content

Commit

Permalink
wheel script: screen exit, numWheelItems
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Jul 27, 2020
1 parent c037944 commit 69a38c8
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions Scripts/11 Wheel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ function Wheel:new(params)
local left = gameButton == "MenuLeft" or key == "DeviceButton_left"
local enter = gameButton == "Start" or key == "DeviceButton_enter"
local right = gameButton == "MenuRight" or key == "DeviceButton_right"
local exit = gameButton == "Back" or key == "DeviceButton_escape"
if left or right then
if event.type == "InputEventType_FirstPress" then
if interval then
Expand All @@ -225,6 +226,11 @@ function Wheel:new(params)
if event.type == "InputEventType_FirstPress" then
whee.onSelection(whee:getCurrentFrame(), whee:getCurrentItem())
end
elseif exit then
if event.type == "InputEventType_FirstPress" then
SCREENMAN:set_input_redirected(PLAYER_1, false)
SCREENMAN:GetTopScreen():Cancel()
end
end
return false
end
Expand Down Expand Up @@ -314,16 +320,22 @@ function MusicWheel:new(params)
local songActorBuilder = params.songActorBuilder
local songActorUpdater = params.songActorUpdater
local groupActorUpdater = params.groupActorUpdater

-- Cache all pack counts
local packCounts = SONGMAN:GetSongGroupNames()
for i, song in ipairs(SONGMAN:GetAllSongs()) do
local pack = song:GetGroupName()
local x = packCounts[pack]
packCounts[pack] = x and x + 1 or 1
local function packCounter()
for i, song in ipairs(SONGMAN:GetAllSongs()) do
local pack = song:GetGroupName()
local x = packCounts[pack]
packCounts[pack] = x and x + 1 or 1
end
end
packCounter()

local w
w =
Wheel:new {
count = params.count,
frameTransformer = params.frameTransformer,
x = params.x,
highlightBuilder = params.highlightBuilder,
Expand Down

0 comments on commit 69a38c8

Please sign in to comment.