thorpedosg

XuUEuU2e

Aug 6th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. ## Function
  2. local function CreatePaneText( pnPlayer, rcRadarCategory )
  3. local t = Def.ActorFrame {
  4. OnCommand=cmd(playcommand,"Set");
  5. SetCommand=function(self)
  6. local c = self:GetChildren();
  7. -- (cmd(stoptweening;zoom,2.5;decelerate,0.1;zoom,1))(self);
  8. if GAMESTATE:GetCurrentSong() or GAMESTATE:GetCurrentCourse() then
  9. local vSteps = GAMESTATE:GetCurrentSteps( pnPlayer );
  10. local vRv = vSteps:GetRadarValues(pnPlayer);
  11. local sValue = vRv:GetValue( rcRadarCategory );
  12.  
  13. c.Frame:diffuse( CustomDifficultyToColor( vSteps:GetDifficulty() ) );
  14. c.Difficulty:settext( sValue );
  15. c.Description:settext( ToEnumShortString( rcRadarCategory ) );
  16. else
  17. c.Frame:diffuse( Color("White") );
  18. c.Difficulty:settext( "0" );
  19. c.Description:settext( "None" );
  20. end
  21. end;
  22. CurrentSongChangedMessageCommand = cmd(playcommand,"Set");
  23. CurrentCourseChangedMessageCommand = cmd(playcommand,"Set");
  24. CurrentStepsP1ChangedMessageCommand = cmd(playcommand,"Set");
  25. CurrentStepsP2ChangedMessageCommand = cmd(playcommand,"Set");
  26. CurrentTrailP1ChangedMessageCommand = cmd(playcommand,"Set");
  27. CurrentTrailP2ChangedMessageCommand = cmd(playcommand,"Set");
  28. --
  29. LoadActor(THEME:GetPathG("PaneDisplay","frame")) .. {
  30. Name="Frame";
  31. };
  32. LoadFont("Common Normal") .. {
  33. Text="Testing";
  34. Name="Description";
  35. InitCommand=cmd(x,-52;zoom,0.5);
  36. };
  37. LoadFont("Common Normal") .. {
  38. Text="000";
  39. Name="Difficulty";
  40. InitCommand=cmd(x,58;zoom,0.5);
  41. };
  42. };
  43. return t
  44. end;
  45. ## Code
  46. for pn in ivalues(PlayerNumber) do
  47. local MetricsName = "PaneDisplay" .. PlayerNumberToString(pn);
  48. local x = Def.ActorFrame {};
  49. local sCategories = { 'RadarCategory_Jumps','RadarCategory_Holds','RadarCategory_Mines','RadarCategory_Hands','RadarCategory_Rolls' };
  50. for i=1,#sCategories do
  51. x[#x+1] = CreatePaneText( PlayerNumber, sCategories[i] ) .. {
  52. InitCommand=cmd(y,20*(i-1));
  53. };
  54. end
  55. t[#t+1] = x .. {
  56. InitCommand=function(self) self:player(pn); self:name(MetricsName); ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); end;
  57. };
  58. end;
Add Comment
Please, Sign In to add comment