diff --git a/Themes/Til Death/BGAnimations/ScreenBundleSelect underlay.lua b/Themes/Til Death/BGAnimations/ScreenBundleSelect underlay.lua index 4820687889..585d906b6e 100644 --- a/Themes/Til Death/BGAnimations/ScreenBundleSelect underlay.lua +++ b/Themes/Til Death/BGAnimations/ScreenBundleSelect underlay.lua @@ -67,7 +67,7 @@ local o = Def.ActorFrame{ packlist = DLMAN:GetPacklist() self:SetUpdateFunction(highlight) end, - --OnCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) end, + BeginCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) end, WheelUpSlowMessageCommand=function(self) self:queuecommand("PrevPage") diff --git a/Themes/Til Death/BGAnimations/ScreenCoreBundleSelect underlay.lua b/Themes/Til Death/BGAnimations/ScreenCoreBundleSelect underlay.lua index 52ef8cef2a..25968066f6 100644 --- a/Themes/Til Death/BGAnimations/ScreenCoreBundleSelect underlay.lua +++ b/Themes/Til Death/BGAnimations/ScreenCoreBundleSelect underlay.lua @@ -7,7 +7,7 @@ local ind = 7 local function input(event) if event.DeviceInput.button == 'DeviceButton_left mouse button' then if event.type == "InputEventType_Release" then - --MESSAGEMAN:Broadcast("ScMouseLeftClick") + MESSAGEMAN:Broadcast("ScMouseLeftClick") end end return false @@ -17,7 +17,7 @@ local o = Def.ActorFrame{ InitCommand=function(self) self:xy(SCREEN_WIDTH/2, 50):halign(0.5) end, - OnCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) end, + BeginCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) end, CodeMessageCommand = function(self, params) if params.Name == 'Up' then ind = ind - 1 diff --git a/Themes/Til Death/BGAnimations/ScreenNetRoom decorations/roomsearch.lua b/Themes/Til Death/BGAnimations/ScreenNetRoom decorations/roomsearch.lua index 07321d7af0..2003cb44f7 100644 --- a/Themes/Til Death/BGAnimations/ScreenNetRoom decorations/roomsearch.lua +++ b/Themes/Til Death/BGAnimations/ScreenNetRoom decorations/roomsearch.lua @@ -24,7 +24,7 @@ local function searchInput(event) if event.type ~= "InputEventType_Release" and active then if event.DeviceInput.button == "DeviceButton_left mouse button" then inputting = 0 - --MESSAGEMAN:Broadcast("MouseLeftClicks") + MESSAGEMAN:Broadcast("MouseLeftClicks") MESSAGEMAN:Broadcast("UpdateString") elseif event.DeviceInput.button == "DeviceButton_right mouse button" then inputting = 0 @@ -107,7 +107,7 @@ end local t = Def.ActorFrame{ BeginCommand=function(self) whee = SCREENMAN:GetTopScreen():GetMusicWheel() - --SCREENMAN:GetTopScreen():AddInputCallback(searchInput) + SCREENMAN:GetTopScreen():AddInputCallback(searchInput) self:finishtweening() if NSMAN:IsETTP() then ms.ok("Song search activated") diff --git a/Themes/Til Death/BGAnimations/ScreenNetRoom decorations/tabs.lua b/Themes/Til Death/BGAnimations/ScreenNetRoom decorations/tabs.lua index b6a6c9abc3..8221302440 100644 --- a/Themes/Til Death/BGAnimations/ScreenNetRoom decorations/tabs.lua +++ b/Themes/Til Death/BGAnimations/ScreenNetRoom decorations/tabs.lua @@ -33,7 +33,7 @@ local function input(event) end local t = Def.ActorFrame{ - --OnCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) end, + OnCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) end, BeginCommand=function(self) resetTabIndex() end, PlayerJoinedMessageCommand=function(self) resetTabIndex() end, BeginningSearchMessageCommand=function(self) active = true end, diff --git a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/tabs.lua b/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/tabs.lua index 8f2117f9a4..3951f68255 100644 --- a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/tabs.lua +++ b/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/tabs.lua @@ -34,7 +34,7 @@ local function input(event) end local t = Def.ActorFrame{ - --OnCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) end, + OnCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) end, BeginCommand=function(self) resetTabIndex() end, PlayerJoinedMessageCommand=function(self) resetTabIndex() end, BeginningSearchMessageCommand=function(self) active = true end, diff --git a/Themes/Til Death/BGAnimations/ScreenPackDownloader underlay.lua b/Themes/Til Death/BGAnimations/ScreenPackDownloader underlay.lua index 623ea078f9..da05ca156d 100644 --- a/Themes/Til Death/BGAnimations/ScreenPackDownloader underlay.lua +++ b/Themes/Til Death/BGAnimations/ScreenPackDownloader underlay.lua @@ -154,7 +154,7 @@ local o = Def.ActorFrame{ packlist = DLMAN:GetPacklist() self:SetUpdateFunction(highlight) end, - --OnCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(DlInput) end, + BeginCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(DlInput) end, WheelUpSlowMessageCommand=function(self) self:queuecommand("PrevPage") diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/default.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/default.lua index 2de89e9ccd..f2da118db1 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/default.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/default.lua @@ -1,17 +1,17 @@ local t = Def.ActorFrame{} t[#t+1] = LoadActor("wifetwirl") ---t[#t+1] = LoadActor("msd") ---t[#t+1] = LoadActor("songsearch") +t[#t+1] = LoadActor("msd") +t[#t+1] = LoadActor("songsearch") t[#t+1] = LoadActor("tabs") ---t[#t+1] = LoadActor("songinfo") ---t[#t+1] = LoadActor("score") ---t[#t+1] = LoadActor("profile") ---t[#t+1] = LoadActor("filter") +t[#t+1] = LoadActor("songinfo") +t[#t+1] = LoadActor("score") +t[#t+1] = LoadActor("profile") +t[#t+1] = LoadActor("filter") t[#t+1] = LoadActor("goaltracker") ---t[#t+1] = LoadActor("playlists") ---t[#t+1] = LoadActor("downloads") ---t[#t+1] = LoadActor("tags") +t[#t+1] = LoadActor("playlists") +t[#t+1] = LoadActor("downloads") +t[#t+1] = LoadActor("tags") t[#t+1] = Def.ActorFrame { InitCommand=function(self) @@ -132,6 +132,5 @@ t[#t+1] = Def.ActorFrame { } } -t[#t+1] = LoadActor("../_mouseselect") t[#t+1] = LoadActor("../_mousewheelscroll") return t \ No newline at end of file diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/goaltracker.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/goaltracker.lua index df9755742d..9d96ca9cad 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/goaltracker.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/goaltracker.lua @@ -1,4 +1,3 @@ -local update = false local t = Def.ActorFrame{ BeginCommand=function(self) self:queuecommand("Set"):visible(false) @@ -15,10 +14,8 @@ local t = Def.ActorFrame{ if getTabIndex() == 6 then self:queuecommand("On") self:visible(true) - update = true else self:queuecommand("Off") - update = false end end, TabChangedMessageCommand=function(self) diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/tabs.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/tabs.lua index 3dc8d4fd0b..ce14ee4265 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/tabs.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/tabs.lua @@ -22,12 +22,10 @@ local function input(event) return false end local t = Def.ActorFrame{ - OnCommand=function(self) - --SCREENMAN:GetTopScreen():AddInputCallback(input) + BeginCommand=function(self) + SCREENMAN:GetTopScreen():AddInputCallback(input) + resetTabIndex() end, - BeginCommand=function(self) resetTabIndex() end, - BeginningSearchMessageCommand=function(self) active = true end, -- this is for disabling numeric input in the text search and is unused atm - EndingSearchMessageCommand=function(self) active = true end, NumericInputActiveMessageCommand=function(self) numericinputactive = true end, NumericInputEndedMessageCommand=function(self) numericinputactive = false end, } diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/tags.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/tags.lua index de5a50b2ac..7f0d72ecf0 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/tags.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/tags.lua @@ -62,13 +62,13 @@ end local t = Def.ActorFrame{ BeginCommand=function(self) + SCREENMAN:GetTopScreen():AddInputCallback(newTagInput) self:queuecommand("Set"):visible(false) end, OffCommand=function(self) self:bouncebegin(0.2):xy(-500,0):diffusealpha(0) end, OnCommand=function(self) - SCREENMAN:GetTopScreen():AddInputCallback(newTagInput) self:bouncebegin(0.2):xy(0,0):diffusealpha(1) end, MouseRightClickMessageCommand=function(self) diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic overlay/default.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic overlay/default.lua index 8f646f5db8..0fb21973c0 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic overlay/default.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic overlay/default.lua @@ -2,16 +2,16 @@ local function input(event) local top = SCREENMAN:GetTopScreen() if event.DeviceInput.button == 'DeviceButton_left mouse button' then if event.type == "InputEventType_Release" then - if GAMESTATE:IsPlayerEnabled(PLAYER_1) and not SCREENMAN:get_input_redirected(PLAYER_1) then + if not SCREENMAN:get_input_redirected(PLAYER_1) then if isOver(top:GetChild("Overlay"):GetChild("PlayerAvatar"):GetChild("Avatar"..PLAYER_1):GetChild("Image")) then SCREENMAN:AddNewScreenToTop("ScreenAvatarSwitch") end end end end - if event.DeviceInput.button == "DeviceButton_left mouse button" then + if event.DeviceInput.button == "DeviceButton_left mouse button" and event.type == "InputEventType_Release" then MESSAGEMAN:Broadcast("MouseLeftClick") - elseif event.DeviceInput.button == "DeviceButton_right mouse button" then + elseif event.DeviceInput.button == "DeviceButton_right mouse button" and event.type == "InputEventType_Release" then MESSAGEMAN:Broadcast("MouseRightClick") end return false diff --git a/Themes/Til Death/BGAnimations/ScreenTitleMenu underlay.lua b/Themes/Til Death/BGAnimations/ScreenTitleMenu underlay.lua index d440d70917..7c9da2d217 100644 --- a/Themes/Til Death/BGAnimations/ScreenTitleMenu underlay.lua +++ b/Themes/Til Death/BGAnimations/ScreenTitleMenu underlay.lua @@ -1,9 +1,9 @@ local function input(event) -- for update button if event.type ~= "InputEventType_Release" then if event.DeviceInput.button == "DeviceButton_left mouse button" then - --MESSAGEMAN:Broadcast("MouseLeftClick") + MESSAGEMAN:Broadcast("MouseLeftClick") elseif event.DeviceInput.button == "DeviceButton_right mouse button" then - --MESSAGEMAN:Broadcast("MouseRightClick") + MESSAGEMAN:Broadcast("MouseRightClick") end end return false diff --git a/Themes/Til Death/BGAnimations/_cursor.lua b/Themes/Til Death/BGAnimations/_cursor.lua index 509e035cbf..14d8efaf4b 100644 --- a/Themes/Til Death/BGAnimations/_cursor.lua +++ b/Themes/Til Death/BGAnimations/_cursor.lua @@ -5,24 +5,13 @@ local maxChild = 20 local curIndex = 0 -local function input(event) - local top = SCREENMAN:GetTopScreen():GetChildren().Overlay - if event.DeviceInput.button == 'DeviceButton_left mouse button' then - if event.type == "InputEventType_Release" then - curIndex = (curIndex+1)%20 - MESSAGEMAN:Broadcast("Click") - end - end -return false -end - function cursorClick(index) return LoadActor(THEME:GetPathG("","_circle")) .. { Name="CursorClick", InitCommand=function(self) self:diffusealpha(0) end, - ClickMessageCommand=function(self) + MouseLeftClickMessageCommand=function(self) if index == curIndex then self:finishtweening() self:xy(INPUTFILTER:GetMouseX(),INPUTFILTER:GetMouseY()) @@ -32,13 +21,12 @@ function cursorClick(index) self:diffusealpha(0) self:zoom(1) end - end; + end, } end local t = Def.ActorFrame{ Name="Cursor", - OnCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) end } for i=0,maxChild do diff --git a/Themes/Til Death/BGAnimations/_mouseselect.lua b/Themes/Til Death/BGAnimations/_mouseselect.lua index 0f94c87112..4173d9e6f7 100644 --- a/Themes/Til Death/BGAnimations/_mouseselect.lua +++ b/Themes/Til Death/BGAnimations/_mouseselect.lua @@ -1,71 +1 @@ - -local whee -local top -local function mouseInput(event) - if top:GetSelectionState() == 2 then - return - end - - local mouseX = INPUTFILTER:GetMouseX() - local mouseY = INPUTFILTER:GetMouseY() - - if mouseX > capWideScale(370,500) and mouseX < SCREEN_WIDTH then - if event.DeviceInput.button == "DeviceButton_left mouse button" and event.type == "InputEventType_FirstPress"then - local n=0 - local m=1 - if mouseY > 220 and mouseY < 256 then - m=0 - elseif mouseY > 256 and mouseY < 292 then - m=1 - n=1 - elseif mouseY > 292 and mouseY < 328 then - m=1 - n=2 - elseif mouseY > 328 and mouseY < 364 then - m=1 - n=3 - elseif mouseY > 364 and mouseY < 400 then - m=1 - n=4 - elseif mouseY > 400 and mouseY < 436 then - m=1 - n=5 - elseif mouseY > 184 and mouseY < 220 then - m=-1 - n=1 - elseif mouseY > 148 and mouseY < 184 then - m=-1 - n=2 - elseif mouseY > 112 and mouseY < 148 then - m=-1 - n=3 - elseif mouseY > 76 and mouseY < 112 then - m=-1 - n=4 - elseif mouseY > 40 and mouseY <76 then - m=-1 - n=5 - end - - local doot = whee:MoveAndCheckType(m*n) - whee:Move(0) - if m == 0 or doot == "WheelItemDataType_Section" then - top:SelectCurrent(0) - end - elseif event.DeviceInput.button == "DeviceButton_right mouse button" and event.type == "InputEventType_FirstPress"then - setTabIndex(7) - MESSAGEMAN:Broadcast("TabChanged") - end - end -end - - -local t = Def.ActorFrame{ - BeginCommand=function(self) - top = SCREENMAN:GetTopScreen() - whee = top:GetMusicWheel() - top:AddInputCallback(mouseInput) - end, -} - -return t \ No newline at end of file +-- merged into mousewheelscroll \ No newline at end of file diff --git a/Themes/Til Death/BGAnimations/_mousewheelscroll.lua b/Themes/Til Death/BGAnimations/_mousewheelscroll.lua index 8964319868..81fff18e43 100644 --- a/Themes/Til Death/BGAnimations/_mousewheelscroll.lua +++ b/Themes/Til Death/BGAnimations/_mousewheelscroll.lua @@ -35,6 +35,62 @@ local function scrollInput(event) whee:Move(0) moving = false end + + if top:GetSelectionState() == 2 then + return + end + + local mouseX = INPUTFILTER:GetMouseX() + local mouseY = INPUTFILTER:GetMouseY() + + if mouseX > capWideScale(370,500) and mouseX < SCREEN_WIDTH then + if event.DeviceInput.button == "DeviceButton_left mouse button" and event.type == "InputEventType_FirstPress"then + local n=0 + local m=1 + if mouseY > 220 and mouseY < 256 then + m=0 + elseif mouseY > 256 and mouseY < 292 then + m=1 + n=1 + elseif mouseY > 292 and mouseY < 328 then + m=1 + n=2 + elseif mouseY > 328 and mouseY < 364 then + m=1 + n=3 + elseif mouseY > 364 and mouseY < 400 then + m=1 + n=4 + elseif mouseY > 400 and mouseY < 436 then + m=1 + n=5 + elseif mouseY > 184 and mouseY < 220 then + m=-1 + n=1 + elseif mouseY > 148 and mouseY < 184 then + m=-1 + n=2 + elseif mouseY > 112 and mouseY < 148 then + m=-1 + n=3 + elseif mouseY > 76 and mouseY < 112 then + m=-1 + n=4 + elseif mouseY > 40 and mouseY <76 then + m=-1 + n=5 + end + + local doot = whee:MoveAndCheckType(m*n) + whee:Move(0) + if m == 0 or doot == "WheelItemDataType_Section" then + top:SelectCurrent(0) + end + elseif event.DeviceInput.button == "DeviceButton_right mouse button" and event.type == "InputEventType_FirstPress"then + setTabIndex(7) + MESSAGEMAN:Broadcast("TabChanged") + end + end return false end diff --git a/Themes/Til Death/BGAnimations/goaldisplay.lua b/Themes/Til Death/BGAnimations/goaldisplay.lua index 7c5b474391..e8d12360bb 100644 --- a/Themes/Til Death/BGAnimations/goaldisplay.lua +++ b/Themes/Til Death/BGAnimations/goaldisplay.lua @@ -35,7 +35,6 @@ local function input(event) elseif moving == true then moving = false end - return true end return false end @@ -64,12 +63,14 @@ local goaltable local o = Def.ActorFrame{ Name = "GoalDisplay", InitCommand=function(self) + cheese = self self:xy(0,0) self:SetUpdateFunction(highlight) end, - OnCommand=function(self) - cheese = self + BeginCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) + end, + OnCommand=function(self) GetPlayerOrMachineProfile(PLAYER_1):SetFromAll() self:queuecommand("GoalTableRefresh") end, diff --git a/Themes/Til Death/BGAnimations/packlistDisplay.lua b/Themes/Til Death/BGAnimations/packlistDisplay.lua index 6e5f8c7aea..c8c45b4226 100644 --- a/Themes/Til Death/BGAnimations/packlistDisplay.lua +++ b/Themes/Til Death/BGAnimations/packlistDisplay.lua @@ -37,7 +37,7 @@ local o = Def.ActorFrame{ InitCommand=function(self) self:xy(0,0) end, - OnCommand=function(self) + BeginCommand=function(self) self:SetUpdateFunction(highlight) packlist = DLMAN:GetPacklist() packlist:SetFromAll() diff --git a/src/DownloadManager.cpp b/src/DownloadManager.cpp index 912e2f1e50..cf69b032c2 100644 --- a/src/DownloadManager.cpp +++ b/src/DownloadManager.cpp @@ -1273,7 +1273,6 @@ void DownloadManager::RefreshUserData() void DownloadManager::OnLogin() { - return; DLMAN->RefreshUserRank(); DLMAN->RefreshUserData(); FOREACH_ENUM(Skillset, ss) diff --git a/src/Screen.cpp b/src/Screen.cpp index b48e0f4616..6d8ac3c989 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -359,10 +359,10 @@ bool Screen::PassInputToLua(const InputEventPlus& input) lua_setfield(L, -2, "PlayerNumber"); Enum::Push(L, input.mp); lua_setfield(L, -2, "MultiPlayer"); - for(auto callback= m_InputCallbacks.begin(); - callback != m_InputCallbacks.end() && !handled; ++callback) - { - callback->second.PushSelf(L); + for(auto k : orderedcallbacks) { + if(handled) + break; + m_InputCallbacks[k].PushSelf(L); lua_pushvalue(L, -2); RString error= "Error running input callback: "; LuaHelpers::RunScriptOnStack(L, error, 1, 1, true); @@ -387,6 +387,7 @@ void Screen::AddInputCallbackFromStack(lua_State* L) { callback_key_t key= lua_topointer(L, 1); m_InputCallbacks[key]= LuaReference(L); + orderedcallbacks.push_back(key); } void Screen::RemoveInputCallback(lua_State* L) diff --git a/src/Screen.h b/src/Screen.h index e80524f5a2..1b245cf481 100644 --- a/src/Screen.h +++ b/src/Screen.h @@ -150,6 +150,7 @@ class Screen : public ActorFrame // to remove when removing a callback. using callback_key_t = const void *; map m_InputCallbacks; + vector orderedcallbacks; vector m_DelayedCallbackRemovals; bool m_CallingInputCallbacks; void InternalRemoveCallback(callback_key_t key);