Skip to content

Commit

Permalink
added possibly templateable mouse select for profile screen
Browse files Browse the repository at this point in the history
the whole screen should probably be rewritten though
  • Loading branch information
MinaciousGrace committed Nov 24, 2018
1 parent 0d3f2a7 commit 7aaf002
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions Themes/Til Death/BGAnimations/ScreenSelectProfile overlay.lua
@@ -1,4 +1,30 @@
--Commenting out the Player 2 stuff so if someone is attempting to use this theme for versus or 2P side, it's not going to work. Go use Prim's original spawnhack theme for that. -Misterkister
local function selectprofile(self)
if isOver(self) then
SCREENMAN:GetTopScreen():SetProfileIndex(PLAYER_1, self:GetParent():GetName() + 1)
SCREENMAN:GetTopScreen():Finish()
end
end
local function genericHighlight(self, highlight, base, clickaction)
self:SetUpdateFunction(function(self)
self:RunCommandsOnChildren(
function(self)
if isOver(self) then
self:diffusealpha(highlight)
else
self:diffusealpha(base)
end
end
)
end)
self:SetUpdateRate(0.5)
if clickaction then
self:RunCommandsOnChildren(
function(self)
self:addcommand("LeftClickMessage", clickaction)
end
)
end
end

function GetLocalProfiles()
local t = {}
Expand All @@ -8,11 +34,15 @@ function GetLocalProfiles()
local profile = PROFILEMAN:GetLocalProfileFromIndex(p)
local ProfileCard =
Def.ActorFrame {
Name = p,
InitCommand = function(self)
genericHighlight(self, 0.75, 1, selectprofile)
end,
LoadFont("Common Large") ..
{
Text = string.format("%s: %.2f", profile:GetDisplayName(), profile:GetPlayerRating()),
InitCommand = function(self)
self:xy(34 / 2, -10):zoom(0.4):ztest(true, maxwidth, (200 - 34 - 4) / 0.4)
self:xy(34 / 2, -10):zoom(0.4):ztest(true, maxwidth, (200 - 34 - 4) / 0.4)
end
},
LoadFont("Common Normal") ..
Expand Down

0 comments on commit 7aaf002

Please sign in to comment.