Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Function
- local function CreatePaneText( pnPlayer, rcRadarCategory )
- local t = Def.ActorFrame {
- OnCommand=cmd(playcommand,"Set");
- SetCommand=function(self)
- local c = self:GetChildren();
- -- (cmd(stoptweening;zoom,2.5;decelerate,0.1;zoom,1))(self);
- if GAMESTATE:GetCurrentSong() or GAMESTATE:GetCurrentCourse() then
- local vSteps = GAMESTATE:GetCurrentSteps( pnPlayer );
- local vRv = vSteps:GetRadarValues(pnPlayer);
- local sValue = vRv:GetValue( rcRadarCategory );
- c.Frame:diffuse( CustomDifficultyToColor( vSteps:GetDifficulty() ) );
- c.Difficulty:settext( sValue );
- c.Description:settext( ToEnumShortString( rcRadarCategory ) );
- else
- c.Frame:diffuse( Color("White") );
- c.Difficulty:settext( "0" );
- c.Description:settext( "None" );
- end
- end;
- CurrentSongChangedMessageCommand = cmd(playcommand,"Set");
- CurrentCourseChangedMessageCommand = cmd(playcommand,"Set");
- CurrentStepsP1ChangedMessageCommand = cmd(playcommand,"Set");
- CurrentStepsP2ChangedMessageCommand = cmd(playcommand,"Set");
- CurrentTrailP1ChangedMessageCommand = cmd(playcommand,"Set");
- CurrentTrailP2ChangedMessageCommand = cmd(playcommand,"Set");
- --
- LoadActor(THEME:GetPathG("PaneDisplay","frame")) .. {
- Name="Frame";
- };
- LoadFont("Common Normal") .. {
- Text="Testing";
- Name="Description";
- InitCommand=cmd(x,-52;zoom,0.5);
- };
- LoadFont("Common Normal") .. {
- Text="000";
- Name="Difficulty";
- InitCommand=cmd(x,58;zoom,0.5);
- };
- };
- return t
- end;
- ## Code
- for pn in ivalues(PlayerNumber) do
- local MetricsName = "PaneDisplay" .. PlayerNumberToString(pn);
- local x = Def.ActorFrame {};
- local sCategories = { 'RadarCategory_Jumps','RadarCategory_Holds','RadarCategory_Mines','RadarCategory_Hands','RadarCategory_Rolls' };
- for i=1,#sCategories do
- x[#x+1] = CreatePaneText( PlayerNumber, sCategories[i] ) .. {
- InitCommand=cmd(y,20*(i-1));
- };
- end
- t[#t+1] = x .. {
- InitCommand=function(self) self:player(pn); self:name(MetricsName); ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); end;
- };
- end;
Add Comment
Please, Sign In to add comment