Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////////////////////////////////////
- //////////COLOR_SYSTEM//CREATED_BY_CABCON///////////////
- ////////////////////////////////////////////////////////
- StartUp()
- {
- self endon("EndOfEdit");
- //TODO :Do here your close function from your menu :D (Close menu at start)
- null = 0;
- Selection_1= 0;
- Selection_2= 0;
- Selection_3= 0;
- newTag= .1;
- self iprintln("Press ^2[{+frag}]^7 to Scroll Down"); //TODO :print buttons to control
- self iprintln("Press ^2[{+attack}]^7/^2[{+speed_throw}]^7 to Change Value of Color"); //TODO :print buttons to control
- self iprintln("Press ^2[{+melee}]^7 to exit Editor"); //TODO :print buttons to control
- self.RPG_1=true;self.RPG_2=false;self.RPG_3=false;main_selection=2;selection_max = 1.1; selection_min = -0.1;
- self.color_box = newclienthudelem( self );
- self.color_box.alignx = "left";
- self.color_box.aligny = "top";
- self.color_box.y = 110;
- self.color_box.x = 100;
- self.color_box elemFade(.5,1);
- self.color_box.foreground = 1;
- self.color_box setshader( "white", 30, 30 );
- self.color_box.color =(0,0,0);
- self.color_box elemMoveX(.5,220);
- self.color_box elemFade(.5,1);
- self CreateValue();
- self.debug_value_text[1] setValue(Selection_1);
- self.debug_value_text[2] setValue(Selection_2);
- self.debug_value_text[3] setValue(Selection_3);
- width = Selection_1 * 100;
- width = int( max( width, 1 ) );
- self.debug_health_box_value[1] setshader( "white", width, 10 );
- self.debug_health_box_value[2] setshader( "white", width, 10 );
- self.debug_health_box_value[3] setshader( "white", width, 10 );
- wait .5;
- self.debug_value_text[3] elemFade(.5,.7);self.debug_value_text[2] elemFade(.5,.7);self.debug_value_text[1] elemFade(.5,1);
- self.debug_health_box[3] elemFade(.5,.7);self.debug_health_box[2] elemFade(.5,.7);self.debug_health_box[1] elemFade(.5,1);
- wait .5;
- for(;;)
- {
- if(self.RPG_1==true)
- {
- Selection_1_before=Selection_1;
- if(self AttackButtonPressed())Selection_1 +=newTag ;
- if(self AdsButtonPressed())Selection_1 -=newTag ;
- if(Selection_1==selection_max)Selection_1=0;
- if(Selection_1==selection_min)Selection_1=1;
- self.color_box.color = (Selection_1,Selection_2,Selection_3);
- if(Selection_1_before!=Selection_1)
- {
- self.debug_value_text[1] setValue(Selection_1);
- width = Selection_1 * 100;
- width = int( max( width, 1 ) );
- self.debug_health_box_value[1] setshader( "white", width, 10 );
- }
- }
- if(self.RPG_2==true)
- {
- Selection_2_before=Selection_2;
- if(self AttackButtonPressed())Selection_2 +=newTag ;
- if(self AdsButtonPressed())Selection_2 -=newTag ;
- if(Selection_2==selection_max)Selection_2=0;
- if(Selection_2==selection_min)Selection_2=1;
- self.color_box.color = (Selection_1,Selection_2,Selection_3);
- if(Selection_2_before!=Selection_2)
- {
- self.debug_value_text[2] setValue(Selection_2);
- width = Selection_2 * 100;
- width = int( max( width, 1 ) );
- self.debug_health_box_value[2] setshader( "white", width, 10 );
- }
- }
- if(self.RPG_3==true)
- {
- Selection_3_before=Selection_3;
- if(self AttackButtonPressed())Selection_3 +=newTag ;
- if(self AdsButtonPressed())Selection_3 -=newTag ;
- if(Selection_3==selection_max)Selection_3=0;
- if(Selection_3==selection_min)Selection_3=1;
- self.color_box.color = (Selection_1,Selection_2,Selection_3);
- if(Selection_3_before!=Selection_3)
- {
- self.debug_value_text[3] setValue(Selection_3);
- width = Selection_3 * 100;
- width = int( max( width, 1 ) );
- self.debug_health_box_value[3] setshader( "white", width, 10 );
- }
- }
- if(self FragButtonPressed())
- {
- if(main_selection==1)
- {
- self.RPG_1=true;self.RPG_2=false;self.RPG_3=false;main_selection=2;
- self.debug_value_text[3] elemFade(.5,.7);self.debug_value_text[2] elemFade(.5,.7);self.debug_value_text[1] elemFade(.5,1);
- self.debug_health_box[3] elemFade(.5,.7);self.debug_health_box[2] elemFade(.5,.7);self.debug_health_box[1] elemFade(.5,1);
- wait .5;
- }
- else if(main_selection==2)
- {
- self.RPG_1=false;self.RPG_2=true;self.RPG_3=false;main_selection=3;
- self.debug_value_text[3] elemFade(.5,.7);self.debug_value_text[2] elemFade(.5,1);self.debug_value_text[1] elemFade(.5,.7);
- self.debug_health_box[3] elemFade(.5,.7);self.debug_health_box[2] elemFade(.5,1);self.debug_health_box[1] elemFade(.5,.7);
- wait .5;
- }
- else if(main_selection==3)
- {
- self.RPG_1=false;self.RPG_2=false;self.RPG_3=true;main_selection=1;
- self.debug_value_text[3]elemFade(.5,1);self.debug_value_text[2] elemFade(.5,.7);self.debug_value_text[1] elemFade(.5,.7);
- self.debug_health_box[3]elemFade(.5,1);self.debug_health_box[2] elemFade(.5,.7);self.debug_health_box[1] elemFade(.5,.7);
- wait .5;
- }
- }
- if(self MeleeButtonPressed())
- {
- for(i = 1;i <= 3; i++)
- {
- self.debug_value_text[i] elemMoveX(.5,-20);
- self.debug_value_text[i] elemFade(.5,0);
- self.debug_health_box[i] elemMoveX(.5,0);
- self.debug_health_box[i] elemFade(.5,0);
- self.debug_health_box_value[i] elemMoveX(.5,0);
- self.debug_health_box_value[i] elemFade(.5,0);
- }
- self.color_box elemMoveX(.5,-100);
- self.color_box elemFade(.5,0);
- wait .5;
- input = (Selection_1,Selection_2,Selection_3);
- self thread newTag(input);
- self notify("EndOfEdit");
- }
- wait .1;
- }
- }
- newTag(input)
- {
- /*
- TODO :THE INPUT IS YOUR SELECTED COLOR
- */
- self.menu fadeovertime(.5); //TODO :glow animation for the shader/text ...
- self.menu.color = input; //TODO :HERE YOU SET YOUR SHADER/TEXT TO A COLOR set the color "input"
- self iprintln("Theme ^2Changed"); //TODO :print end of function
- }
- CreateValue() //create hud
- {
- for(i = 1;i <= 3; i++)
- {
- self.debug_value_text[i] = newclienthudelem( self );
- self.debug_value_text[i].y = 100 + i*10;
- self.debug_value_text[i].alignx = "left";
- self.debug_value_text[i].aligny = "top";
- self.debug_value_text[i].horzalign = "fullscreen";
- self.debug_value_text[i].vertalign = "fullscreen";
- self.debug_value_text[i].fontscale = 1;
- self.debug_value_text[i].foreground = 1;
- self.debug_value_text[i].x = -20;
- self.debug_health_box[i] = newclienthudelem( self );
- self.debug_health_box[i].y = 100 + i*10;
- self.debug_health_box[i].alignx = "left";
- self.debug_health_box[i].aligny = "top";
- self.debug_health_box[i].horzalign = "fullscreen";
- self.debug_health_box[i].vertalign = "fullscreen";
- self.debug_health_box[i].foreground = 0;
- self.debug_health_box[i].background = 0;
- self.debug_health_box[i].x = 0;
- self.debug_health_box_value[i] = newclienthudelem( self );
- self.debug_health_box_value[i].y = 100 + i*10;
- self.debug_health_box_value[i].alignx = "left";
- self.debug_health_box_value[i].aligny = "top";
- self.debug_health_box_value[i].horzalign = "fullscreen";
- self.debug_health_box_value[i].vertalign = "fullscreen";
- self.debug_health_box_value[i].foreground = 1;
- self.debug_health_box_value[i].background = 1;
- self.debug_health_box_value[i].x = 0;
- self.debug_health_box_value[i].color = (0,0,0);
- self.debug_health_box[i] setshader( "white", 100, 10 );
- self.debug_health_box_value[i] elemMoveX(.5,120);
- self.debug_health_box_value[i] elemFade(.5,1);
- self.debug_health_box[i] elemMoveX(.5,120);
- self.debug_health_box[i] elemFade(.5,1);
- self.debug_value_text[i] elemMoveX(.5,100);
- self.debug_value_text[i] elemFade(.5,1);
- }
- }
- elemFade(time,alpha)
- {
- self fadeOverTime(time);
- self.alpha=alpha;
- }
- elemMoveX(time,input)
- {
- self moveOverTime(time);
- self.x=input;
- }
- ////////////////////////////////////////////////////////
- //////////END/////////COLOR_SYSTEM//////////////////////
- ////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement