diff --git a/popnhax/custom_categs.cc b/popnhax/custom_categs.cc index 62145e0..9a5e223 100644 --- a/popnhax/custom_categs.cc +++ b/popnhax/custom_categs.cc @@ -36,8 +36,8 @@ bool g_subcategmode = false; uint32_t g_min_id = 4000; uint32_t g_max_id = 0; +const char *g_categicon; char *g_categname; -const char *g_categicon = "cate_cc"; char *g_categformat; char *g_customformat; @@ -1008,10 +1008,11 @@ bool patch_exclude(const char *game_dll_fn) (void **)&real_after_getlevel); } - LOG("popnhax: custom_exclude_from_level: Custom songs excluded from level listings\n"); + LOG("popnhax: custom_exclude_from_level: customs excluded from level folders\n"); return true; } +#define F_OK 0 bool patch_custom_categs(const char *dllFilename, struct popnhax_config *config) { LOG("config is %p\n", (void*)config); @@ -1019,12 +1020,23 @@ LOG("config is %p\n", (void*)config); g_max_id = config->custom_categ_max_songid; uint8_t mode = config->custom_categ; + char icon_path[64]; + sprintf(icon_path, "data_mods\\_popnhax_assets\\tex\\system%d\\ms_ifs\\cate_cc.png", config->game_version); + if (access(icon_path, F_OK) == 0) + { + g_categicon = "cate_cc"; + } + else + { + LOG("popnhax: custom_categ: custom icon asset not found. Using \"customize category\" icon\n"); + g_categicon = "cate_13"; + } + g_categname = config->custom_category_title; g_categformat = config->custom_category_format; -LOG("custom songid range is [%d;%d]\n", g_min_id, g_max_id); -LOG("category name is %s\n", g_categname); -LOG("category format is %s\n", g_categformat); + LOG("category name is %s\n", g_categname); + LOG("category format is %s\n", g_categformat); #if SIMPLE_CATEG_ALLOC == 1 songlist = (uint32_t*)calloc(1,5); @@ -1042,6 +1054,8 @@ LOG("category format is %s\n", g_categformat); patch_custom_track_format(dllFilename); } + if (config->custom_exclude_from_version) + LOG("popnhax: custom_exclude_from_version: customs excluded from version folders\n"); //musichax_core_init took care of it if (config->custom_exclude_from_level) patch_exclude(dllFilename); diff --git a/popnhax/dllmain.cc b/popnhax/dllmain.cc index 7570df2..c2d8781 100644 --- a/popnhax/dllmain.cc +++ b/popnhax/dllmain.cc @@ -1563,9 +1563,6 @@ static bool patch_database() { ); limit_table[STYLE_TABLE_IDX] = new_limit_table[STYLE_TABLE_IDX]; - if (config.custom_exclude_from_version) - LOG("popnhax: custom_exclude_from_version: customs excluded from version folders\n"); //musichax_core_init took care of it - if (config.disable_redirection) { LOG("Redirection-related code is disabled, buffer address, buffer size and related patches will not be applied"); printf("Redirection-related code is disabled, buffer address, buffer size and related patches will not be applied");