Advertisement
CabCon

[GSC] Color System by CabCon

Aug 4th, 2015
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 9.03 KB | None | 0 0
  1. ////////////////////////////////////////////////////////
  2. //////////COLOR_SYSTEM//CREATED_BY_CABCON///////////////  
  3. ////////////////////////////////////////////////////////
  4.  
  5.  
  6. StartUp()
  7. {
  8.     self endon("EndOfEdit");
  9.      
  10.     //TODO :Do here your close function from your menu :D (Close menu at start)  
  11.      
  12.     null = 0;
  13.     Selection_1= 0;
  14.     Selection_2= 0;
  15.     Selection_3= 0;
  16.     newTag= .1;
  17.     self iprintln("Press ^2[{+frag}]^7 to Scroll Down"); //TODO :print buttons to control
  18.     self iprintln("Press ^2[{+attack}]^7/^2[{+speed_throw}]^7 to Change Value of Color"); //TODO :print buttons to control
  19.     self iprintln("Press ^2[{+melee}]^7 to exit Editor"); //TODO :print buttons to control
  20.     self.RPG_1=true;self.RPG_2=false;self.RPG_3=false;main_selection=2;selection_max = 1.1; selection_min = -0.1;
  21.     self.color_box = newclienthudelem( self );
  22.     self.color_box.alignx = "left";
  23.     self.color_box.aligny = "top";
  24.     self.color_box.y = 110;
  25.     self.color_box.x = 100;
  26.     self.color_box elemFade(.5,1);
  27.     self.color_box.foreground = 1;
  28.     self.color_box setshader( "white", 30, 30 );
  29.     self.color_box.color =(0,0,0);
  30.     self.color_box elemMoveX(.5,220);
  31.     self.color_box elemFade(.5,1);
  32.     self CreateValue();
  33.     self.debug_value_text[1] setValue(Selection_1);
  34.     self.debug_value_text[2] setValue(Selection_2);
  35.     self.debug_value_text[3] setValue(Selection_3);
  36.     width = Selection_1 * 100;
  37.     width = int( max( width, 1 ) );
  38.     self.debug_health_box_value[1] setshader( "white", width, 10 );
  39.     self.debug_health_box_value[2] setshader( "white", width, 10 );
  40.     self.debug_health_box_value[3] setshader( "white", width, 10 );
  41.     wait .5;
  42.     self.debug_value_text[3] elemFade(.5,.7);self.debug_value_text[2] elemFade(.5,.7);self.debug_value_text[1] elemFade(.5,1);
  43.     self.debug_health_box[3] elemFade(.5,.7);self.debug_health_box[2] elemFade(.5,.7);self.debug_health_box[1] elemFade(.5,1);
  44.     wait .5;
  45.     for(;;)
  46.     {
  47.         if(self.RPG_1==true)
  48.         {
  49.             Selection_1_before=Selection_1;
  50.             if(self AttackButtonPressed())Selection_1 +=newTag ;
  51.             if(self AdsButtonPressed())Selection_1 -=newTag ;
  52.             if(Selection_1==selection_max)Selection_1=0;
  53.             if(Selection_1==selection_min)Selection_1=1;
  54.             self.color_box.color = (Selection_1,Selection_2,Selection_3);
  55.             if(Selection_1_before!=Selection_1)
  56.             {
  57.                     self.debug_value_text[1] setValue(Selection_1);
  58.                     width = Selection_1 * 100;
  59.                     width = int( max( width, 1 ) );
  60.                     self.debug_health_box_value[1] setshader( "white", width, 10 );
  61.             }
  62.         }
  63.         if(self.RPG_2==true)
  64.         {
  65.             Selection_2_before=Selection_2;
  66.             if(self AttackButtonPressed())Selection_2 +=newTag ;
  67.             if(self AdsButtonPressed())Selection_2 -=newTag ;
  68.             if(Selection_2==selection_max)Selection_2=0;
  69.             if(Selection_2==selection_min)Selection_2=1;
  70.             self.color_box.color = (Selection_1,Selection_2,Selection_3);
  71.             if(Selection_2_before!=Selection_2)
  72.             {
  73.  
  74.                 self.debug_value_text[2] setValue(Selection_2);
  75.                     width =  Selection_2 * 100;
  76.                     width = int( max( width, 1 ) );
  77.                     self.debug_health_box_value[2] setshader( "white", width, 10 );
  78.             }
  79.         }
  80.         if(self.RPG_3==true)
  81.         {
  82.             Selection_3_before=Selection_3;
  83.             if(self AttackButtonPressed())Selection_3 +=newTag ;
  84.             if(self AdsButtonPressed())Selection_3 -=newTag ;
  85.             if(Selection_3==selection_max)Selection_3=0;
  86.             if(Selection_3==selection_min)Selection_3=1;
  87.             self.color_box.color = (Selection_1,Selection_2,Selection_3);
  88.             if(Selection_3_before!=Selection_3)
  89.             {
  90.                  
  91.                 self.debug_value_text[3] setValue(Selection_3);
  92.                     width =  Selection_3  * 100;
  93.                     width = int( max( width, 1 ) );
  94.                     self.debug_health_box_value[3] setshader( "white", width, 10 );
  95.             }
  96.         }
  97.         if(self FragButtonPressed())
  98.         {
  99.             if(main_selection==1)
  100.                 {
  101.                     self.RPG_1=true;self.RPG_2=false;self.RPG_3=false;main_selection=2;
  102.                     self.debug_value_text[3] elemFade(.5,.7);self.debug_value_text[2] elemFade(.5,.7);self.debug_value_text[1] elemFade(.5,1);
  103.                     self.debug_health_box[3] elemFade(.5,.7);self.debug_health_box[2] elemFade(.5,.7);self.debug_health_box[1] elemFade(.5,1);
  104.                     wait .5;
  105.                 }
  106.             else if(main_selection==2)
  107.                 {
  108.                     self.RPG_1=false;self.RPG_2=true;self.RPG_3=false;main_selection=3;
  109.                     self.debug_value_text[3] elemFade(.5,.7);self.debug_value_text[2] elemFade(.5,1);self.debug_value_text[1] elemFade(.5,.7);
  110.                     self.debug_health_box[3] elemFade(.5,.7);self.debug_health_box[2] elemFade(.5,1);self.debug_health_box[1] elemFade(.5,.7);
  111.                     wait .5;
  112.                 }
  113.             else if(main_selection==3)
  114.                 {
  115.                     self.RPG_1=false;self.RPG_2=false;self.RPG_3=true;main_selection=1;
  116.                     self.debug_value_text[3]elemFade(.5,1);self.debug_value_text[2] elemFade(.5,.7);self.debug_value_text[1] elemFade(.5,.7);
  117.                     self.debug_health_box[3]elemFade(.5,1);self.debug_health_box[2] elemFade(.5,.7);self.debug_health_box[1] elemFade(.5,.7);
  118.                     wait .5;
  119.                 }
  120.         }
  121.         if(self MeleeButtonPressed())
  122.         {
  123.             for(i = 1;i <= 3; i++)
  124.                 {
  125.                     self.debug_value_text[i] elemMoveX(.5,-20);
  126.                     self.debug_value_text[i] elemFade(.5,0);
  127.                     self.debug_health_box[i] elemMoveX(.5,0);
  128.                     self.debug_health_box[i] elemFade(.5,0);
  129.                     self.debug_health_box_value[i] elemMoveX(.5,0);
  130.                     self.debug_health_box_value[i] elemFade(.5,0);
  131.                 }
  132.                 self.color_box elemMoveX(.5,-100);
  133.                 self.color_box elemFade(.5,0);
  134.                 wait .5;
  135.                 input = (Selection_1,Selection_2,Selection_3);
  136.                 self thread newTag(input);
  137.                         self notify("EndOfEdit");
  138.                          
  139.         }
  140.         wait .1;
  141.     }
  142. }
  143.  
  144. newTag(input)
  145. {
  146.     /*
  147.     TODO :THE INPUT IS YOUR SELECTED COLOR  
  148.     */
  149.     self.menu fadeovertime(.5); //TODO :glow animation for the shader/text ...
  150.     self.menu.color = input; //TODO :HERE YOU SET YOUR SHADER/TEXT TO A COLOR set the color "input"
  151.  
  152.     self iprintln("Theme ^2Changed"); //TODO :print end of function
  153. }
  154. CreateValue() //create hud
  155. {
  156.     for(i = 1;i <= 3; i++)
  157.     {
  158.     self.debug_value_text[i] = newclienthudelem( self );
  159.     self.debug_value_text[i].y = 100 + i*10;
  160.     self.debug_value_text[i].alignx = "left";
  161.     self.debug_value_text[i].aligny = "top";
  162.     self.debug_value_text[i].horzalign = "fullscreen";
  163.     self.debug_value_text[i].vertalign = "fullscreen";
  164.     self.debug_value_text[i].fontscale = 1;
  165.     self.debug_value_text[i].foreground = 1;
  166.     self.debug_value_text[i].x = -20;
  167.      
  168.     self.debug_health_box[i] = newclienthudelem( self );
  169.     self.debug_health_box[i].y = 100 + i*10;
  170.     self.debug_health_box[i].alignx = "left";
  171.     self.debug_health_box[i].aligny = "top";
  172.     self.debug_health_box[i].horzalign = "fullscreen";
  173.     self.debug_health_box[i].vertalign = "fullscreen";
  174.     self.debug_health_box[i].foreground = 0;
  175.     self.debug_health_box[i].background = 0;
  176.     self.debug_health_box[i].x = 0;
  177.      
  178.     self.debug_health_box_value[i] = newclienthudelem( self );
  179.     self.debug_health_box_value[i].y = 100 + i*10;
  180.     self.debug_health_box_value[i].alignx = "left";
  181.     self.debug_health_box_value[i].aligny = "top";
  182.     self.debug_health_box_value[i].horzalign = "fullscreen";
  183.     self.debug_health_box_value[i].vertalign = "fullscreen";
  184.     self.debug_health_box_value[i].foreground = 1;
  185.     self.debug_health_box_value[i].background = 1;
  186.     self.debug_health_box_value[i].x = 0;
  187.     self.debug_health_box_value[i].color = (0,0,0);
  188.      
  189.     self.debug_health_box[i] setshader( "white", 100, 10 );
  190.      
  191.     self.debug_health_box_value[i] elemMoveX(.5,120);
  192.     self.debug_health_box_value[i] elemFade(.5,1);
  193.     self.debug_health_box[i] elemMoveX(.5,120);
  194.     self.debug_health_box[i] elemFade(.5,1);
  195.     self.debug_value_text[i] elemMoveX(.5,100);
  196.     self.debug_value_text[i] elemFade(.5,1);
  197.     }
  198.      
  199.  }
  200.  
  201. elemFade(time,alpha)
  202. {
  203.         self fadeOverTime(time);
  204.         self.alpha=alpha;
  205. }
  206.  
  207. elemMoveX(time,input)
  208. {
  209.         self moveOverTime(time);
  210.         self.x=input;
  211. }
  212.  
  213. ////////////////////////////////////////////////////////
  214. //////////END/////////COLOR_SYSTEM//////////////////////
  215. ////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement