Advertisement
Jousway

I dont get it

Mar 20th, 2012
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.42 KB | None | 0 0
  1. if GetUserPref("NoteskinType") == "1" then
  2. local ntype1 = "bottom part arrow.png";
  3. local ntype2 = "top part arrow";
  4. elseif GetUserPref("NoteskinType") == "2" then
  5. local ntype1 = "bottom part circle.png";
  6. local ntype2 = "top part circle";
  7. else
  8. local ntype1 = "bottom part bar.png";
  9. local ntype2 = "top part bar";
  10. end;
  11.  
  12. local t = Def.ActorFrame {
  13.     -- colour Bar and circle parts
  14.     LoadActor("red.png") .. {
  15.         InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y-118;x,SCREEN_CENTER_X);
  16.     };
  17.     LoadActor("green.png") .. {
  18.         InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y-60;x,SCREEN_CENTER_X);
  19.     };
  20.     LoadActor("blue.png") .. {
  21.         InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y-2;x,SCREEN_CENTER_X);
  22.     };
  23.     LoadActor("dark.png") .. {
  24.         InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y+100;x,SCREEN_CENTER_X+180);
  25.     };
  26.     LoadActor("light.png") .. {
  27.         Name="light";
  28.         InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y+100;x,SCREEN_CENTER_X+180;diffuse,diffuselight);
  29.     };
  30.    
  31.     -- colour selectors
  32.     LoadActor("Selector.png") .. {
  33.         Name="pos1";
  34.         InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y-118;x,posred);
  35.     };
  36.     LoadActor("Selector.png") .. {
  37.         Name="pos2";
  38.         InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y-60;x,posgreen);
  39.     };
  40.     LoadActor("Selector.png") .. {
  41.         Name="pos3";
  42.         InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y-2;x,posblue);
  43.     };
  44.     LoadActor("Select round.png") .. {
  45.         Name="circle";
  46.         InitCommand=cmd(zoom,0.5;y,poscircleY;x,poscircleX);
  47.     };
  48.    
  49.     -- noteskin part
  50.     LoadActor( ntype1 ) .. {
  51.         Name="Fill";
  52.         InitCommand=cmd(y,SCREEN_CENTER_Y+100;x,SCREEN_CENTER_X-180;diffuse,DiffuseColor);
  53.     };
  54.     Def.Sprite {
  55.         Texture=( ntype2 );
  56.         Frames = Sprite.LinearFrames( 4, 1 );
  57.         InitCommand=cmd(y,SCREEN_CENTER_Y+100;x,SCREEN_CENTER_X-180);
  58.     };
  59. };
  60.  
  61.  
  62. -- update function to change it actively
  63. local function Update(self)
  64.     --if GetUserPref("Use10sinsteadof1s") == "1" then
  65.         local red = GetUserPrefN("NoteskinColour4Red")*10/256;
  66.         local green = GetUserPrefN("NoteskinColour4Green")*10/256;
  67.         local blue = GetUserPrefN("NoteskinColour4Blue")*10/256;
  68.     --[[else
  69.         local red = GetUserPrefN("NoteskinColour4Red")/256;
  70.         local green = GetUserPrefN("NoteskinColour4Green")/256;
  71.         local blue = GetUserPrefN("NoteskinColour4Blue")/256;
  72.     end;--]]
  73.    
  74.     local posred = self:GetChild("pos1"):x((SCREEN_CENTER_X-124)+string.format("%f",red)*255);
  75.     local posgreen = self:GetChild("pos2"):x((SCREEN_CENTER_X-124)+string.format("%f",green)*255);
  76.     local posblue = self:GetChild("pos3"):x((SCREEN_CENTER_X-124)+string.format("%f",blue)*255);
  77.    
  78.     if red > green and red > blue then
  79.         local diffuselight = self:GetChild("light"):diffuse(color(string.format("%f, %f, %f, %f", "1", "1", "1", red)));
  80.     elseif green > red and green > blue then
  81.         local diffuselight = self:GetChild("light"):diffuse(color(string.format("%f, %f, %f, %f", "1", "1", "1", green)));
  82.     elseif blue > red and blue > green then
  83.         local diffuselight = self:GetChild("light"):diffuse(color(string.format("%f, %f, %f, %f", "1", "1", "1", blue)));
  84.     end;
  85.    
  86.     local poscircleY = self:GetChild("circle"):y((SCREEN_CENTER_Y+100)-(string.format("%f",red)*62)+(string.format("%f",green)*32)+(string.format("%f",blue)*32));
  87.     local poscircleX = self:GetChild("circle"):x((SCREEN_CENTER_X+180)-(string.format("%f",green)*54)+(string.format("%f",blue)*54));
  88.    
  89.     local DiffuseColor = self:GetChild("Fill"):diffuse(color(string.format("%f, %f, %f, %f", red, green, blue, "1")));
  90. end;
  91.  
  92. t.InitCommand=cmd(SetUpdateFunction,Update);
  93.  
  94. return t;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement