Skip to content

Commit

Permalink
fix: obj_ini.icon string failsafe (Adeptus-Dominus#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
OH296 authored Dec 16, 2024
1 parent a0cd481 commit 9723f01
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions objects/obj_controller/Draw_64.gml
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,29 @@ if (!zoomed && !zui){


if (y_slide>0) then draw_set_alpha((100-(y_slide*2))/100);

draw_set_alpha(1);
draw_sprite(spr_new_banner,0,1439+new_banner_x,62);
draw_sprite(spr_new_ui_cover,0,0,(900-17));
// Handles custom chapters
if (string_count("custom",obj_ini.icon_name)>0){
var cusl=string_replace(obj_ini.icon_name,"custom","");
cusl=real(cusl);
if (obj_cuicons.spr_custom[cusl]>0) and (obj_cuicons.spr_custom_icon[cusl]!=-1){
draw_sprite_stretched(obj_cuicons.spr_custom_icon[cusl],0,1451+new_banner_x,73,141,141);
}
}
// Handles icon for normal chapters
if (string_count("custom",obj_ini.icon_name)==0){
var icon_sprite=spr_icon,icc=obj_ini.icon;
if (icc<=20) then scr_image("creation",icc,1451+new_banner_x,73,141,141);
if (icc>20){
icon_sprite=spr_icon_chapters;
icc-=19;
draw_sprite(icon_sprite,icc,1451+new_banner_x,73);
}
if (is_string(obj_ini.icon_name)){
if (string_count("custom",obj_ini.icon_name)>0){
var cusl=string_replace(obj_ini.icon_name,"custom","");
cusl=real(cusl);
if (obj_cuicons.spr_custom[cusl]>0) and (obj_cuicons.spr_custom_icon[cusl]!=-1){
draw_sprite_stretched(obj_cuicons.spr_custom_icon[cusl],0,1451+new_banner_x,73,141,141);
}
}else {
var icon_sprite=spr_icon,icc=obj_ini.icon;
if (icc<=20) then scr_image("creation",icc,1451+new_banner_x,73,141,141);
if (icc>20){
icon_sprite=spr_icon_chapters;
icc-=19;
draw_sprite(icon_sprite,icc,1451+new_banner_x,73);
}
}
}


draw_set_color(38144);
draw_set_font(fnt_menu);
Expand Down

0 comments on commit 9723f01

Please sign in to comment.