3
0
mirror of https://github.com/CrazyRedMachine/popnhax.git synced 2024-11-24 06:10:12 +01:00

custom track title format2

This commit is contained in:
CrazyRedMachine 2024-05-02 02:46:21 +02:00
parent dd109549b0
commit 607c2842b6
4 changed files with 15 additions and 8 deletions

View File

@ -152,8 +152,10 @@
<custom_category_title __type="str">Customs</custom_category_title> <custom_category_title __type="str">Customs</custom_category_title>
<!-- Format used for category title (in BM2DXFontScript format, refer to popnhax_tools documentation) --> <!-- Format used for category title (in BM2DXFontScript format, refer to popnhax_tools documentation) -->
<custom_category_format __type="str">[ol:4][olc:d92f0d]%s</custom_category_format> <custom_category_format __type="str">[ol:4][olc:d92f0d]%s</custom_category_format>
<!-- Format used for custom song titles on song select (Note: colors not working for kaimei and unilab, but rotation does, e.g.: * [rz:3]%s[/rz] ) --> <!-- Format used for custom song titles on song select (Note: colors not working for kaimei and above, but rotation does, e.g. "* [rz:3]%s[/rz]" ) -->
<custom_track_title_format __type="str"></custom_track_title_format> <custom_track_title_format __type="str"></custom_track_title_format>
<!-- Optional secondary format used for older games only (Full colors supported, e.g. "[ol:4][olc:d92f0d]%s") -->
<custom_track_title_format2 __type="str"></custom_track_title_format2>
<!-- Translation --> <!-- Translation -->
<!-- Disable .dict string replacements and .ips patches --> <!-- Disable .dict string replacements and .ips patches -->

View File

@ -63,6 +63,7 @@ struct popnhax_config {
char custom_category_title[16]; char custom_category_title[16];
char custom_category_format[64]; char custom_category_format[64];
char custom_track_title_format[64]; char custom_track_title_format[64];
char custom_track_title_format2[64];
}; };
#endif #endif

View File

@ -695,7 +695,7 @@ static bool patch_favorite_categ(const char *game_dll_fn) {
//hook result screen to replace 3 functions //hook result screen to replace 3 functions
{ {
int64_t first_loc = search(data, dllSize, "\xBF\x07\x00\x00\x00\xC6\x85\x61\xD3", 9, 0); int64_t first_loc = search(data, dllSize, "\x10\xBF\x07\x00\x00\x00\xC6\x85", 8, 0);
if (first_loc == -1) { if (first_loc == -1) {
LOG("popnhax: local_favorites: cannot find result screen function\n"); LOG("popnhax: local_favorites: cannot find result screen function\n");
return false; return false;
@ -1046,11 +1046,13 @@ bool patch_custom_categs(const char *dllFilename, struct popnhax_config *config)
print_databases(); print_databases();
} }
if ( config->custom_track_title_format[0] != '\0' ) if ( config->game_version < 26 && config->custom_track_title_format2[0] != '\0' )
{ g_customformat = config->custom_track_title_format2;
else if ( config->custom_track_title_format[0] != '\0' )
g_customformat = config->custom_track_title_format; g_customformat = config->custom_track_title_format;
if ( g_customformat != NULL )
patch_custom_track_format(dllFilename); patch_custom_track_format(dllFilename);
}
if (config->custom_exclude_from_version) if (config->custom_exclude_from_version)
LOG("popnhax: Customs excluded from version folders\n"); //musichax_core_init took care of it LOG("popnhax: Customs excluded from version folders\n"); //musichax_core_init took care of it

View File

@ -32,7 +32,7 @@
#include "SearchFile.h" #include "SearchFile.h"
#define PROGRAM_VERSION "1.11.beta2" #define PROGRAM_VERSION "1.11"
const char *g_game_dll_fn = NULL; const char *g_game_dll_fn = NULL;
const char *g_config_fn = NULL; const char *g_config_fn = NULL;
@ -201,6 +201,8 @@ PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_STR, struct popnhax_config, custom_category
"/popnhax/custom_category_format") "/popnhax/custom_category_format")
PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_STR, struct popnhax_config, custom_track_title_format, PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_STR, struct popnhax_config, custom_track_title_format,
"/popnhax/custom_track_title_format") "/popnhax/custom_track_title_format")
PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_STR, struct popnhax_config, custom_track_title_format2,
"/popnhax/custom_track_title_format2")
PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_BOOL, struct popnhax_config, local_favorites, PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_BOOL, struct popnhax_config, local_favorites,
"/popnhax/local_favorites") "/popnhax/local_favorites")
PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_BOOL, struct popnhax_config, ignore_music_limit, PSMAP_MEMBER_REQ(PSMAP_PROPERTY_TYPE_BOOL, struct popnhax_config, ignore_music_limit,
@ -5539,7 +5541,7 @@ static bool get_music_limit_from_file(const char *filepath, uint32_t *limit){
} }
char *data = (char *)lpBasePtr; char *data = (char *)lpBasePtr;
uint32_t delta = 0; int32_t delta = 0;
//first retrieve .rdata virtual and raw addresses to compute delta //first retrieve .rdata virtual and raw addresses to compute delta
{ {