mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Remove leftover debug feature
This commit is contained in:
parent
893c65d927
commit
fe75dbfa28
10 changed files with 14 additions and 66 deletions
|
|
@ -75,13 +75,10 @@ static void discord_populate_details(char* buffer, int bufferLength) {
|
|||
bufferLength -= versionLength;
|
||||
|
||||
// get mod strings
|
||||
u8 autoexecMod = mods_has_autoexec_mod();
|
||||
if (gActiveMods.entryCount - autoexecMod <= 0) { return; }
|
||||
char* strings[gActiveMods.entryCount - autoexecMod];
|
||||
if (gActiveMods.entryCount <= 0) { return; }
|
||||
char* strings[gActiveMods.entryCount];
|
||||
for (int i = 0; i < gActiveMods.entryCount; i++) {
|
||||
struct Mod* mod = gActiveMods.entries[i];
|
||||
if (mod_get_is_autoexec(mod)) { continue; }
|
||||
strings[i] = mod->name;
|
||||
strings[i] = gActiveMods.entries[i]->name;
|
||||
}
|
||||
|
||||
// add seperator
|
||||
|
|
@ -90,7 +87,7 @@ static void discord_populate_details(char* buffer, int bufferLength) {
|
|||
bufferLength -= 3;
|
||||
|
||||
// concat mod strings
|
||||
str_seperator_concat(buffer, bufferLength, strings, gActiveMods.entryCount - autoexecMod, ", ");
|
||||
str_seperator_concat(buffer, bufferLength, strings, gActiveMods.entryCount, ", ");
|
||||
}
|
||||
|
||||
void discord_activity_update(void) {
|
||||
|
|
|
|||
|
|
@ -138,9 +138,6 @@ void djui_panel_host_mods_create(struct DjuiBase* caller) {
|
|||
struct DjuiBase* layoutBase = &paginated->layout->base;
|
||||
for (int i = 0; i < gLocalMods.entryCount; i++) {
|
||||
struct Mod* mod = gLocalMods.entries[i];
|
||||
if (mod_get_is_autoexec(mod)) {
|
||||
continue;
|
||||
}
|
||||
if (isRomHacks != (mod->incompatible && strstr(mod->incompatible, "romhack"))) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,12 +18,10 @@ void djui_panel_modlist_create(UNUSED struct DjuiBase* caller) {
|
|||
gDjuiModList = NULL;
|
||||
}
|
||||
|
||||
u8 autoexecMod = mods_has_autoexec_mod();
|
||||
|
||||
// only create if we have mods
|
||||
if (gActiveMods.entryCount - autoexecMod == 0) { return; }
|
||||
if (gActiveMods.entryCount == 0) { return; }
|
||||
|
||||
f32 bodyHeight = ((gActiveMods.entryCount - autoexecMod) * 32) + (gActiveMods.entryCount - 1 - autoexecMod) * 4;
|
||||
f32 bodyHeight = (gActiveMods.entryCount * 32) + (gActiveMods.entryCount - 1) * 4;
|
||||
struct DjuiThreePanel* panel = djui_panel_menu_create(DLANG(MODLIST, MODS));
|
||||
djui_three_panel_set_body_size(panel, bodyHeight);
|
||||
gDjuiModList = panel;
|
||||
|
|
@ -42,7 +40,6 @@ void djui_panel_modlist_create(UNUSED struct DjuiBase* caller) {
|
|||
|
||||
for (int i = 0; i < gActiveMods.entryCount; i++) {
|
||||
struct Mod* mod = gActiveMods.entries[i];
|
||||
if (mod_get_is_autoexec(mod)) { continue; }
|
||||
|
||||
struct DjuiFlowLayout* row = djui_flow_layout_create(body);
|
||||
djui_base_set_size_type(&row->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
|
||||
|
|
|
|||
|
|
@ -20,11 +20,6 @@ size_t mod_get_lua_size(struct Mod* mod) {
|
|||
return size;
|
||||
}
|
||||
|
||||
bool mod_get_is_autoexec(struct Mod* mod) {
|
||||
if (!strcmp(mod->name, "autoexec") || !strcmp(mod->name, "autoexec.lua")) { return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
static void mod_activate_bin(struct ModFile* file) {
|
||||
// copy geo name
|
||||
char geoName[64] = { 0 };
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ struct Mod {
|
|||
};
|
||||
|
||||
size_t mod_get_lua_size(struct Mod* mod);
|
||||
bool mod_get_is_autoexec(struct Mod* mod);
|
||||
void mod_activate(struct Mod* mod);
|
||||
void mod_clear(struct Mod* mod);
|
||||
bool mod_load(struct Mods* mods, char* basePath, char* modName);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ void mods_get_main_mod_name(char* destination, u32 maxSize) {
|
|||
|
||||
for (u16 i = 0; i < gLocalMods.entryCount; i++) {
|
||||
struct Mod* mod = gLocalMods.entries[i];
|
||||
if (!mod->enabled || mod_get_is_autoexec(mod)) { continue; }
|
||||
if (!mod->enabled) { continue; }
|
||||
size_t size = mod_get_lua_size(mod);
|
||||
if (size > pickedSize) {
|
||||
picked = mod;
|
||||
|
|
@ -61,13 +61,6 @@ u16 mods_get_character_select_count(void) {
|
|||
return enabled;
|
||||
}
|
||||
|
||||
u8 mods_has_autoexec_mod(void) {
|
||||
for (u16 i = 0; i < gLocalMods.entryCount; i++) {
|
||||
if (mod_get_is_autoexec(gLocalMods.entries[i])) { return TRUE; }
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void mods_local_store_enabled(void) {
|
||||
assert(sLocalEnabledPaths == NULL);
|
||||
struct LocalEnabledPath* prev = NULL;
|
||||
|
|
@ -125,14 +118,6 @@ bool mods_generate_remote_base_path(void) {
|
|||
return true;
|
||||
}
|
||||
|
||||
static struct Mod* get_autoexec_mod(void) {
|
||||
for (u16 i = 0; i < gLocalMods.entryCount; i++) {
|
||||
if (mod_get_is_autoexec(gLocalMods.entries[i])) {
|
||||
return gLocalMods.entries[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void mods_activate(struct Mods* mods) {
|
||||
mods_clear(&gActiveMods);
|
||||
|
||||
|
|
@ -143,11 +128,8 @@ void mods_activate(struct Mods* mods) {
|
|||
if (mod->enabled) { enabledCount++; }
|
||||
}
|
||||
|
||||
// is joining a game and has an autoexec mod
|
||||
bool autoexec = mods == &gRemoteMods && mods_has_autoexec_mod();
|
||||
|
||||
// allocate
|
||||
gActiveMods.entries = calloc(enabledCount + autoexec, sizeof(struct Mod*));
|
||||
gActiveMods.entries = calloc(enabledCount, sizeof(struct Mod*));
|
||||
if (gActiveMods.entries == NULL) {
|
||||
LOG_ERROR("Failed to allocate active mods table!");
|
||||
return;
|
||||
|
|
@ -156,9 +138,8 @@ void mods_activate(struct Mods* mods) {
|
|||
// copy enabled entries
|
||||
gActiveMods.entryCount = 0;
|
||||
gActiveMods.size = 0;
|
||||
for (int i = 0; i < mods->entryCount + autoexec; i++) {
|
||||
// checks if the mod is out of the remote mods bounds and if so, use the autoexec mod
|
||||
struct Mod* mod = i == mods->entryCount ? get_autoexec_mod() : mods->entries[i];
|
||||
for (int i = 0; i < mods->entryCount; i++) {
|
||||
struct Mod* mod = mods->entries[i];
|
||||
if (mod->enabled) {
|
||||
mod->index = gActiveMods.entryCount;
|
||||
gActiveMods.entries[gActiveMods.entryCount++] = mod;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ extern char gRemoteModsBasePath[];
|
|||
void mods_get_main_mod_name(char* destination, u32 maxSize);
|
||||
u16 mods_get_enabled_count(void);
|
||||
u16 mods_get_character_select_count(void);
|
||||
u8 mods_has_autoexec_mod(void);
|
||||
bool mods_generate_remote_base_path(void);
|
||||
void mods_activate(struct Mods* mods);
|
||||
void mods_clear(struct Mods* mods);
|
||||
|
|
|
|||
|
|
@ -180,12 +180,10 @@ static void coopnet_populate_description(void) {
|
|||
bufferLength -= versionLength;
|
||||
|
||||
// get mod strings
|
||||
u8 autoexecMod = mods_has_autoexec_mod();
|
||||
if (gActiveMods.entryCount - autoexecMod <= 0) { return; }
|
||||
char* strings[gActiveMods.entryCount - autoexecMod];
|
||||
if (gActiveMods.entryCount <= 0) { return; }
|
||||
char* strings[gActiveMods.entryCount];
|
||||
for (int i = 0; i < gActiveMods.entryCount; i++) {
|
||||
struct Mod* mod = gActiveMods.entries[i];
|
||||
if (mod_get_is_autoexec(mod)) { continue; }
|
||||
strings[i] = mod->name;
|
||||
}
|
||||
|
||||
|
|
@ -196,7 +194,7 @@ static void coopnet_populate_description(void) {
|
|||
bufferLength -= strlen(sep);
|
||||
|
||||
// concat mod strings
|
||||
str_seperator_concat(buffer, bufferLength, strings, gActiveMods.entryCount - autoexecMod, "\\#dcdcdc\\\n");
|
||||
str_seperator_concat(buffer, bufferLength, strings, gActiveMods.entryCount, "\\#dcdcdc\\\n");
|
||||
}
|
||||
|
||||
void ns_coopnet_update(void) {
|
||||
|
|
|
|||
|
|
@ -50,13 +50,12 @@ void network_send_mod_list(void) {
|
|||
snprintf(version, MAX_VERSION_LENGTH, "%s", get_version());
|
||||
LOG_INFO("sending version: %s", version);
|
||||
packet_write(&p, &version, sizeof(u8) * MAX_VERSION_LENGTH);
|
||||
packet_write(&p, &gActiveMods.entryCount - mods_has_autoexec_mod(), sizeof(u16));
|
||||
packet_write(&p, &gActiveMods.entryCount, sizeof(u16));
|
||||
network_send_to(0, &p);
|
||||
|
||||
LOG_INFO("sent mod list (%u):", gActiveMods.entryCount);
|
||||
for (u16 i = 0; i < gActiveMods.entryCount; i++) {
|
||||
struct Mod* mod = gActiveMods.entries[i];
|
||||
if (mod_get_is_autoexec(mod)) { continue; }
|
||||
|
||||
u16 nameLength = strlen(mod->name);
|
||||
if (nameLength > MOD_NAME_MAX_LENGTH) { nameLength = MOD_NAME_MAX_LENGTH; }
|
||||
|
|
|
|||
|
|
@ -266,19 +266,6 @@ void game_exit(void) {
|
|||
exit(0);
|
||||
}
|
||||
|
||||
void enable_autoexec_mod(void) {
|
||||
for (int i = 0; i < gLocalMods.entryCount; i ++) {
|
||||
struct Mod* mod = gLocalMods.entries[i];
|
||||
if (mod_get_is_autoexec(mod)) {
|
||||
#ifdef DEVELOPMENT
|
||||
mod->enabled = true;
|
||||
#else
|
||||
mod->enabled = false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void* main_game_init(UNUSED void* arg) {
|
||||
const char *gamedir = gCLIOpts.GameDir[0] ? gCLIOpts.GameDir : FS_BASEDIR;
|
||||
const char *userpath = gCLIOpts.SavePath[0] ? gCLIOpts.SavePath : sys_user_path();
|
||||
|
|
@ -296,7 +283,6 @@ void* main_game_init(UNUSED void* arg) {
|
|||
|
||||
mods_init();
|
||||
enable_queued_mods();
|
||||
enable_autoexec_mod();
|
||||
if (gIsThreaded) {
|
||||
REFRESH_MUTEX(
|
||||
gCurrLoadingSegment.percentage = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue