Skip to content

Commit

Permalink
stage 2
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jul 26, 2018
1 parent 4c27584 commit a1b7a50
Show file tree
Hide file tree
Showing 20 changed files with 96 additions and 126 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -132,6 +132,5 @@ t[#t+1] = Def.ActorFrame {
}
}

t[#t+1] = LoadActor("../_mouseselect")
t[#t+1] = LoadActor("../_mousewheelscroll")
return t
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local update = false
local t = Def.ActorFrame{
BeginCommand=function(self)
self:queuecommand("Set"):visible(false)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Themes/Til Death/BGAnimations/ScreenTitleMenu underlay.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 2 additions & 14 deletions Themes/Til Death/BGAnimations/_cursor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
Expand Down
72 changes: 1 addition & 71 deletions Themes/Til Death/BGAnimations/_mouseselect.lua
Original file line number Diff line number Diff line change
@@ -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
-- merged into mousewheelscroll
56 changes: 56 additions & 0 deletions Themes/Til Death/BGAnimations/_mousewheelscroll.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions Themes/Til Death/BGAnimations/goaldisplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ local function input(event)
elseif moving == true then
moving = false
end
return true
end
return false
end
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion Themes/Til Death/BGAnimations/packlistDisplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading

0 comments on commit a1b7a50

Please sign in to comment.