Skip to content

Commit

Permalink
Minor QoL theme edits
Browse files Browse the repository at this point in the history
Adds scrollwheel select to Netplay 
Adds NetPlay mouse avatar select to SP 
Username localization during avatar change
  • Loading branch information
Unknown committed Mar 29, 2018
1 parent 368b6b9 commit b4cad27
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ t[#t+1] = LoadFont("Common Large")..{
}
t[#t+1] = LoadActor("../_cursor");
t[#t+1] = LoadActor("../_mouseselect")
t[#t+1] = LoadActor("../_mousewheelscroll")
t[#t+1] = LoadActor("currenttime");
t[#t+1] = LoadActor("../_halppls");
t[#t+1] = LoadActor("../_userlist");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
local t = Def.ActorFrame{}
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) then
if isOver(top:GetChild("Overlay"):GetChild("PlayerAvatar"):GetChild("Avatar"..PLAYER_1):GetChild("Image")) then
SCREENMAN:AddNewScreenToTop("ScreenAvatarSwitch");
end;
end;
if GAMESTATE:IsPlayerEnabled(PLAYER_2) then
if isOver(top:GetChild("Overlay"):GetChild("PlayerAvatar"):GetChild("Avatar"..PLAYER_2):GetChild("Image")) then
SCREENMAN:AddNewScreenToTop("ScreenAvatarSwitch");
end;
end;
end;
end
return false;
end

local t = Def.ActorFrame{
OnCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) SCREENMAN:GetTopScreen():UsersVisible(false) end;
}

t[#t+1] = Def.Actor{
CodeMessageCommand=function(self,params)
if params.Name == "AvatarShow" and getTabIndex() == 0 then
SCREENMAN:AddNewScreenToTop("ScreenAvatarSwitch")
end
end
}
SCREENMAN:AddNewScreenToTop("ScreenAvatarSwitch");
end;
end;
};

t[#t+1] = LoadActor("../_frame")
t[#t+1] = LoadActor("../_PlayerInfo")
Expand Down
2 changes: 1 addition & 1 deletion Themes/Til Death/BGAnimations/ScreenTitleMenu underlay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ t[#t+1] = LoadFont("Common Large") .. {

t[#t+1] = LoadActor(THEME:GetPathG("","_ring")) .. {
InitCommand=function(self)
self:xy(capWideScale(get43size(SCREEN_WIDTH-10),SCREEN_WIDTH-530),frameY-130):diffuse(getDifficultyColor("Difficulty_Couple")):diffusealpha(1):baserotationx(420)
self:xy(capWideScale(get43size(SCREEN_WIDTH-10),SCREEN_WIDTH-530),frameY-130):diffuse(getDifficultyColor("Difficulty_Couple")):diffusealpha(1):baserotationx(0)
end
}
return t
8 changes: 5 additions & 3 deletions Themes/Til Death/BGAnimations/_switchavatar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ local function saveAvatar(pn)
local avatar = getSelectedAvatar(pn)
local profile = PROFILEMAN:GetProfile(pn)
local GUID = profile:GetGUID()
local profileName = profile:GetDisplayName()
avatarConfig:get_data().avatar[GUID] = avatar
avatarConfig:set_dirty()
avatarConfig:save()
SCREENMAN:SystemMessage(string.format("%s Avatar set to: '%s'",pn,avatar))
SCREENMAN:SystemMessage(string.format("%s's avatar set to: '%s'",profileName,avatar))
end

-- The main function that contains errything
Expand Down Expand Up @@ -222,12 +223,13 @@ local function avatarSwitch(pn)
self:queuecommand("Set")
end;
SetCommand=function(self,params)
local profileName = profile:GetDisplayName()
--self:settextf("Player 1 avatar: ci%d ai%d",cursorIndex,avatarIndex)
if pn == PLAYER_1 then
self:settextf("Player 1 Avatar: %s",avatars[data[pn]["avatarIndex"]])
self:settextf("%s's avatar: %s",profileName,avatars[data[pn]["avatarIndex"]])
end;
if pn == PLAYER_2 then
self:settextf("Player 2 Avatar: %s",avatars[data[pn]["avatarIndex"]])
self:settextf("%s's avatar: %s",profileName,avatars[data[pn]["avatarIndex"]])
end;
end;
CodeMessageCommand=function(self)
Expand Down

0 comments on commit b4cad27

Please sign in to comment.