Advertisement
lalaladoomsday

Hyuponia's "ae" CSS code

Dec 16th, 2020 (edited)
3,017
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //--- ---
  2. //
  3. // hyuponia's "ae" css code
  4. //
  5. // this is my single most user-UNfriendly code.
  6. // read my code and suffer, or just simply edit the only things you need to change.
  7. // feel free to use or edit or redistribute, long as you don't claim the original template as yours.
  8. // shoutouts to muno for css+ functions.
  9. //
  10. // to refresh the custom code proper, you have to temporarily change qe_b value or load another character with this code,
  11. // for example hyuponia's characters, and then load your character back. sorry, there wasn't really any better way i could find.
  12. //
  13. // and just in case, this code goes into css_draw.gml.
  14. //
  15. // now, please change this string to your character's name. used for resetting the values after other characters.
  16. //--- ---
  17. var qe_b = "template"
  18. // ! you can now scroll down until you reach "the primary part you should change."
  19.  
  20. var tmp_cur = 0;
  21. var tmp_i = [0, 0, 0, 0, 0];
  22. var tmp_x = [0, 0, 0, 0, 0];
  23. var tmp_y = [0, 0, 0, 0, 0];
  24. with(asset_get("cs_playercursor_obj")){
  25.     tmp_cur = (!tmp_i[0])?0:(!tmp_i[1])?1:(!tmp_i[2])?2:(!tmp_i[3])?3:4
  26.     tmp_i[tmp_cur] = 1
  27.     tmp_x[tmp_cur] = get_instance_x( self )
  28.     tmp_y[tmp_cur] = get_instance_y( self )
  29. }
  30. var tmp_pt = abs(player-5)-1
  31. var temp_x = x + 8;
  32. var temp_y = y + 9;
  33. var tmp_xl = 9
  34. var tmp_bw = 32
  35. var tmp_yl = 151
  36. var tmp_bh = 20
  37. var tmp_xl1 = x+tmp_xl
  38. var tmp_xl2 = tmp_xl1+tmp_bw
  39. var tmp_yl1 = y+tmp_yl
  40. var tmp_yl2 = tmp_yl1+tmp_bh
  41. draw_set_halign(fa_left);
  42.  
  43. var ye = false;
  44. if (variable_instance_exists(id,"qe")){
  45.     if (qe != qe_b){
  46.     ye = true;
  47.     }
  48. }
  49.  
  50. if (!variable_instance_exists(id,"ae") || ye == true){
  51.     qe = qe_b
  52.     ae = "ae"
  53.     oe = 0;
  54.     ue = 0; //cur
  55.     ne = 0; //tmp
  56.     ee = 0;
  57.     ee_m = 60;
  58.     ie = 0;
  59.     ye = false;
  60.     dial_time = 0;
  61.     dial_max = 8;
  62.    
  63.     //--- ---
  64.     // the primary part you should change.
  65.     //--- ---
  66.     altsel = 0; // change the alt select sound here. if you don't want to change the sound, put 0 here.
  67.     color_desc_activate = false; // optional "alt color description button". set to "true" to turn it on.
  68.    
  69.     col_max = 5; // number of alternate color palettes. 0 is the default color, count it accordingly.
  70.    
  71.     //first array index is for alternate color. second array index is for distinguishing the information in it.
  72.     ce[0,0] = make_color_rgb(236, 123, 222) // "color preview square" color. can be any color!
  73.     ce[0,1] = "Default" // the name of the alternate color.
  74.     ce[0,2] = "The default color." // description to display if "alt color description button" is on. keep it blank if none, and you can remove it if you didn't turn it on.
  75.     ce[1,0] = make_color_rgb(140, 192, 255)
  76.     ce[1,1] = "color_1"
  77.     ce[1,2] = "References this thing, etc. a a a a a a a a a a"
  78.     ce[2,0] = make_color_rgb(181, 88, 72)
  79.     ce[2,1] = "color_2"
  80.     ce[2,2] = ""
  81.     ce[3,0] = make_color_rgb(42, 222, 160)
  82.     ce[3,1] = "color_3"
  83.     ce[3,2] = ""
  84.     ce[4,0] = make_color_rgb(133, 112, 118)
  85.     ce[4,1] = "color_4"
  86.     ce[4,2] = ""
  87.     ce[5,0] = make_color_rgb(118, 93, 135)
  88.     ce[5,1] = "color_5"
  89.     ce[5,2] = ""
  90.     // you can add more, by copypasting and changing the first index of the array accordingly.
  91.     // ! changing part end.
  92.     // you can ignore the mess below...
  93. }
  94.  
  95. if (ae == "ae"){
  96.     ae = "oe";
  97. }
  98. if (ae == "oe"){
  99.     ae = "ue";
  100. }
  101. if (ne != ue){
  102.     ie = (ue == col_max && ne == 0) ? -1 : (ue == 0 && ne == col_max) ? 1 : (ne < ue) ? 1 : -1
  103.     ne = ue;
  104.     ae = "ne";
  105.     if (altsel!=0){
  106.     sound_stop(altsel);
  107.     sound_play(altsel);
  108.     }
  109. }
  110. if (ae == "ne"){
  111.     ee = ee_m;
  112.     ae = "ue";
  113. }
  114. if (ee > 0){
  115.     var tw = ease_quartOut(0, 1, ee, ee_m);
  116.     var tw_b = (ease_quartOut(0, 1, ee, ee_m)/2) - (ease_quartIn(0, 1, ee, ee_m)/2);
  117.     var tw_c = (ease_quartOut(0, 1, ee, ee_m)/4) - (ease_quartIn(0, 1, ee, ee_m)/4);
  118.     var tw_d = (ease_quartOut(0, 1, ee, ee_m)/2) + (ease_quartIn(0, 1, ee, ee_m));
  119.     var tw_e = (ease_quartOut(0, 1, ee, ee_m)/4) + (ease_quartIn(0, 1, ee, ee_m)/2);
  120.     var tw_f = (ease_quartOut(0, 1, ee, ee_m)/6) + (ease_quartIn(0, 1, ee, ee_m)/4);
  121.     var tw_g = (ease_quartOut(0, 1, ee, ee_m)) + (ease_quartIn(0, 1, ee, ee_m)/2);
  122.     var dist = 14;
  123.     var typ = round(ease_expoIn(0, dist, ee, ee_m-2));
  124.     //using muno's function;
  125.     if (ue-2>=0){
  126.     rectDraw(temp_x + 2, temp_y + 77 +(0-(dist*2)-6+(typ*ie)), temp_x + 16, temp_y + 91 +(0-(dist*2)-6+(typ*ie)),
  127.     ce[clamp(ue-2,0,col_max),0], c_gray, (ie==-1) ? tw_c : tw_e );
  128.     }
  129.     if (ue-1>=0){
  130.     rectDraw(temp_x + 2, temp_y + 77 +(0-dist-3+(typ*ie)), temp_x + 16, temp_y + 91 +(0-dist-3+(typ*ie)),
  131.     ce[clamp(ue-1,0,col_max),0], c_gray, (ie==-1) ? tw_b : tw_d );
  132.     }
  133.    
  134.     rectDraw(temp_x + 2, temp_y + 77 +(typ*ie), temp_x + 16, temp_y + 91 +(typ*ie), ce[ue,0], c_white, tw);
  135.    
  136.     if (ue+1<=col_max){
  137.     rectDraw(temp_x + 2, temp_y + 77 +(dist+3+(typ*ie)), temp_x + 16, temp_y + 91 +(dist+3+(typ*ie)),
  138.     ce[clamp(ue+1,0,col_max),0], c_gray, (ie==1) ? tw_b : tw_d );
  139.     }
  140.     if (ue+2<=col_max){
  141.     rectDraw(temp_x + 2, temp_y + 77 +((dist*2)+6+(typ*ie)), temp_x + 16, temp_y + 91 +((dist*2)+6+(typ*ie)),
  142.     ce[clamp(ue+2,0,col_max),0], c_gray, (ie==1) ? tw_c : tw_e );
  143.     }
  144.    
  145.     if (ue+(3*-ie)<=col_max && ue+(3*-ie)>=0){
  146.     rectDraw(temp_x + 2, temp_y + 77 +((((dist*3)+9)*-ie)+(typ*ie)),
  147.     temp_x + 16, temp_y + 91 +((((dist*3)+9)*-ie)+(typ*ie)),
  148.     ce[clamp(ue+(3*-ie),0,col_max),0], c_gray, tw_f);
  149.     }
  150.    
  151. textDraw(temp_x + 2 + ((player==0)?32:0), temp_y + 130, "fName", c_white, 0, 1000, 1, true, tw_g, ce[ue,1]);
  152.    
  153.     ee--;
  154. }
  155.     ue = get_player_color(player);
  156.  
  157. //this part does button stuff, drawing etc
  158.  
  159. if (color_desc_activate){
  160.     if (tmp_x[tmp_pt]>tmp_xl1 && tmp_x[tmp_pt]<tmp_xl2 && tmp_y[tmp_pt]>tmp_yl1 && tmp_y[tmp_pt]<tmp_yl2){
  161.         if (dial_time<dial_max){ dial_time++; }
  162.     }else{
  163.         if (dial_time>0){ dial_time--; }
  164.     }
  165.     draw_set_alpha(0.3);
  166.     draw_rectangle_colour(tmp_xl2-1, tmp_yl1+3, tmp_xl2, tmp_yl2, c_dkgray, c_dkgray, c_dkgray, c_dkgray, false);
  167.     textDraw(round(tmp_xl1+(tmp_bw/2))-3, round(tmp_yl1+(tmp_bh/2))-4, "fName", c_dkgray, 0, 100, 1, false, 0.3, "?");
  168.     var dial_ease = ease_linear( 0, 100, dial_time, dial_max )
  169.     draw_set_alpha(dial_ease/130);
  170.     draw_rectangle_colour(x+10, y+95-round(dial_ease/30), x+210, y+153, c_black, c_black, c_black, c_black, false);
  171.     draw_set_alpha(dial_ease/500);
  172.     draw_rectangle_colour(tmp_xl1, tmp_yl1+3, tmp_xl2, tmp_yl2, c_white, c_white, c_white, c_white, false);
  173.     draw_set_alpha(1);
  174.     textDraw(x+14, (y+100)-round(dial_ease/30), "fName", c_white, 18, 200, 1, false, dial_ease/100, "- Color "+string(ue)+": "+ce[ue,1]);
  175.     textDraw(x+14, (y+120)-round(dial_ease/30), "fName", c_white, 18, 200, 1, false, dial_ease/100, ce[ue,2]);
  176. }
  177.  
  178. //ae code end
  179.  
  180.  
  181.  
  182. //--- ---
  183. // altered version of muno's functions. if you have other css codes, this part needs to be at the bottom of the code.
  184. //--- ---
  185.  
  186. #define textDraw(x, y, font, color, lineb, linew, scale, outline, alpha, string)
  187.  
  188. draw_set_font(asset_get(argument[2]));
  189.  
  190. if argument[7]{
  191.     for (i = -1; i < 2; i++){
  192.         for (j = -1; j < 2; j++){
  193.             draw_text_ext_transformed_color(argument[0] + i * 2, argument[1] + j * 2, argument[9], argument[4], argument[5], argument[6], argument[6], 0, c_black, c_black, c_black, c_black, 1);
  194.         }
  195.     }
  196. }
  197.  
  198. draw_text_ext_transformed_color(argument[0], argument[1], argument[9], argument[4], argument[5], argument[6], argument[6], 0, argument[3], argument[3], argument[3], argument[3], argument[8]);
  199.  
  200. return string_width_ext(argument[9], argument[4], argument[5]);
  201.  
  202.  
  203. #define rectDraw(x1, y1, x2, y2, color, out_color, alpha)
  204.  
  205. draw_set_alpha(argument[6]);
  206. draw_rectangle_color(argument[0], argument[1], argument[2], argument[3], argument[5], argument[5], argument[5], argument[5], false);
  207. draw_set_alpha(argument[6]*1.5);
  208. draw_rectangle_color(argument[0]+2, argument[1]+2, argument[2]-2, argument[3]-2, argument[4], argument[4], argument[4], argument[4], false);
  209. draw_set_alpha(1);
  210.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement