Last active
December 28, 2015 01:39
-
-
Save freem/7421674 to your computer and use it in GitHub Desktop.
adding PlayerOptions onto ScreenSelectMusic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# new metrics for player options placement | |
[ScreenSelectMusic] | |
PlayerOptionsP1X= | |
PlayerOptionsP1Y= | |
PlayerOptionsP1OnCommand= | |
PlayerOptionsP1OffCommand= | |
PlayerOptionsP2X= | |
PlayerOptionsP2Y= | |
PlayerOptionsP2OnCommand= | |
PlayerOptionsP2OffCommand= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- BGAnimations/ScreenSelectMusic decorations.lua | |
local t = Def.ActorFrame {} | |
for pn in ivalues(PlayerNumber) do | |
-- and add this just before the end: | |
local PlayerOptions = LoadActor( THEME:GetPathG( Var "LoadingScreen", "PlayerOptions" ), pn ); | |
t[#t+1] = StandardDecorationFromTable( "PlayerOptions" .. ToEnumShortString(pn), PlayerOptions ); | |
end | |
return t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Graphics/ScreenSelectMusic PlayerOptions.lua | |
-- player options text for selectmusic | |
local Player = ... | |
if not Player then error("ScreenSelectMusic PlayerOptions requires a Player") end | |
return Def.ActorFrame{ | |
LoadFont("Common normal")..{ | |
InitCommand=cmd(zoom,1); | |
BeginCommand=cmd(playcommand,"Update"); | |
PlayerOptionsChangedMessageCommand=function(self,param) | |
if param.PlayerNumber == Player then self:playcommand("Update") end | |
end; | |
UpdateCommand=function(self) | |
local pstate = GAMESTATE:GetPlayerState(Player) | |
self:settext(pstate:GetPlayerOptionsString('ModsLevel_Preferred')) | |
end; | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment