Advertisement
lalaladoomsday

Odd SSL version of Hyuponia's CSS code

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