mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-01-22 15:43:18 -05:00
Add Mod Categories (#214)
* Add Mod Categories * Update French Translation take 3, hope this coauthor works frfr Co-Authored-By: Skeltan <110261917+Skeltan@users.noreply.github.com> * Add "All" option * Portugese translation Co-Authored-By: Mechstreme <84944335+Mechstreme@users.noreply.github.com> * Add Categorias to purtugese Co-Authored-By: Mechstreme <84944335+Mechstreme@users.noreply.github.com> * Update French.ini Co-Authored-By: Skeltan <110261917+Skeltan@users.noreply.github.com> * Free category from memory * Update German Language Co-Authored-By: DMMaster636 <86197998+DMMaster636@users.noreply.github.com> * Add CS mod category * Make built in character select mods use CS category * Remove main Character Select mod from having category entry CS has its own github repo so gonna let Squishy handle that * Add all translations using DeepL * Forgot to remove that * Actually translate the italian language lol * Remove uneccessary translation comments * Ok, now I actually saved all the files, so this should work now :D --------- Co-authored-by: Skeltan <110261917+Skeltan@users.noreply.github.com> Co-authored-by: Mechstreme <84944335+Mechstreme@users.noreply.github.com> Co-authored-by: DMMaster636 <86197998+DMMaster636@users.noreply.github.com>
This commit is contained in:
parent
f81919ca23
commit
0f8e397a25
18 changed files with 179 additions and 40 deletions
|
@ -171,10 +171,18 @@ WARN_SOCKET = "Ujistěte se, že je vaše brána firewall správně nakonfigurov
|
|||
HOST = "Hostovat"
|
||||
|
||||
[HOST_MODS]
|
||||
ROMHACKS = "ROMHACKY"
|
||||
MODS = "MODY"
|
||||
CATEGORIES = "Kategorie"
|
||||
WARNING = "\\#ffffa0\\Varování:\\#dcdcdc\\ Máte povoleno 10 nebo více módů, vypněte prosím některé, abyste zabránili nestabilitě nebo zpoždění."
|
||||
|
||||
[HOST_MOD_CATEGORIES]
|
||||
ALL = "Všechny"
|
||||
MISC = "Různé"
|
||||
ROMHACKS = "Romhacks"
|
||||
GAMEMODES = "Herní režimy"
|
||||
MOVESETS = "Sady pohybů"
|
||||
CHARACTER_SELECT = "Character Select"
|
||||
|
||||
[HOST_SAVE]
|
||||
SAVE_TITLE = "UKLADACI SLOT"
|
||||
ERASE_TITLE = "SMAZAT"
|
||||
|
@ -220,7 +228,7 @@ PORT = "Port"
|
|||
PASSWORD = "Heslo"
|
||||
SAVE_SLOT = "Ukládací slot"
|
||||
SETTINGS = "Nastavení"
|
||||
MODS = "Modifikace a herní módy"
|
||||
MODS = "Modifikace"
|
||||
ROMHACKS = "Rom-Hacky"
|
||||
APPLY = "Použít"
|
||||
HOST = "Hostovat"
|
||||
|
|
|
@ -171,10 +171,18 @@ WARN_SOCKET = "Zorg ervoor dat uw firewall correct is geconfigureerd.\nDirecte v
|
|||
HOST = "Organisator"
|
||||
|
||||
[HOST_MODS]
|
||||
ROMHACKS = "ROMHACKS"
|
||||
MODS = "MODS"
|
||||
CATEGORIES = "Categorieën"
|
||||
WARNING = "\\#ffffa0\\Waarschuwing:\\#dcdcdc\\ Je hebt 10 of meer mods ingeschakeld, schakel er een paar uit om instabiliteit of lag te voorkomen."
|
||||
|
||||
[HOST_MOD_CATEGORIES]
|
||||
ALL = "Alle"
|
||||
MISC = "Diverse"
|
||||
ROMHACKS = "Romhacks"
|
||||
GAMEMODES = "Spelmodi"
|
||||
MOVESETS = "Bewegingssets"
|
||||
CHARACTER_SELECT = "Character Select"
|
||||
|
||||
[HOST_SAVE]
|
||||
SAVE_TITLE = "OPSLAAN"
|
||||
ERASE_TITLE = "VERWIJDEREN"
|
||||
|
@ -220,7 +228,7 @@ PORT = "Port"
|
|||
PASSWORD = "Wachtwoord"
|
||||
SAVE_SLOT = "Opslag slot"
|
||||
SETTINGS = "Instellingen"
|
||||
MODS = "Mods en gamemodi"
|
||||
MODS = "Mods"
|
||||
ROMHACKS = "Rom-Hacks"
|
||||
APPLY = "Toepassen"
|
||||
HOST = "Organiseer"
|
||||
|
|
|
@ -171,10 +171,18 @@ WARN_SOCKET = "Make sure your firewall is properly configured.\nDirect connectio
|
|||
HOST = "Host"
|
||||
|
||||
[HOST_MODS]
|
||||
ROMHACKS = "ROMHACKS"
|
||||
MODS = "MODS"
|
||||
CATEGORIES = "Categories"
|
||||
WARNING = "\\#ffffa0\\Warning:\\#dcdcdc\\ You have 10 or more mods enabled, please disable some to prevent instability or lag."
|
||||
|
||||
[HOST_MOD_CATEGORIES]
|
||||
ALL = "All"
|
||||
MISC = "Misc"
|
||||
ROMHACKS = "Romhacks"
|
||||
GAMEMODES = "Gamemodes"
|
||||
MOVESETS = "Movesets"
|
||||
CHARACTER_SELECT = "Character Select"
|
||||
|
||||
[HOST_SAVE]
|
||||
SAVE_TITLE = "SAVE"
|
||||
ERASE_TITLE = "ERASE"
|
||||
|
@ -223,7 +231,7 @@ PORT = "Port"
|
|||
PASSWORD = "Password"
|
||||
SAVE_SLOT = "Save Slot"
|
||||
SETTINGS = "Settings"
|
||||
MODS = "Mods & Gamemodes"
|
||||
MODS = "Mods"
|
||||
ROMHACKS = "Rom-Hacks"
|
||||
APPLY = "Apply"
|
||||
HOST = "Host"
|
||||
|
|
|
@ -171,10 +171,18 @@ WARN_SOCKET = "Assurez-vous que votre pare-feu est correctement configuré.\nLes
|
|||
HOST = "Héberger"
|
||||
|
||||
[HOST_MODS]
|
||||
ROMHACKS = "ROM-HACKS"
|
||||
MODS = "MODS"
|
||||
CATEGORIES = "Catégories"
|
||||
WARNING = "\\#ffffa0\\Avertissement :\\#dcdcdc\\ 10 mods ou plus sont activés, veuillez en désactiver certains pour éviter l'instabilité ou le lag."
|
||||
|
||||
[HOST_MOD_CATEGORIES]
|
||||
ALL = "Tous"
|
||||
MISC = "Autres"
|
||||
ROMHACKS = "Romhacks"
|
||||
GAMEMODES = "Modes de jeu"
|
||||
MOVESETS = "Movesets"
|
||||
CHARACTER_SELECT = "Character Select"
|
||||
|
||||
[HOST_SAVE]
|
||||
SAVE_TITLE = "SAUVEGARDE"
|
||||
ERASE_TITLE = "EFFACER"
|
||||
|
@ -220,7 +228,7 @@ PORT = "Port"
|
|||
PASSWORD = "Mot de Passe"
|
||||
SAVE_SLOT = "Sauvegarde"
|
||||
SETTINGS = "Paramètres"
|
||||
MODS = "Mods et modes de jeu"
|
||||
MODS = "Mods"
|
||||
ROMHACKS = "Rom-Hacks"
|
||||
APPLY = "Appliquer"
|
||||
HOST = "Héberger"
|
||||
|
|
|
@ -171,10 +171,18 @@ WARN_SOCKET = "Stelle sicher, dass Deine Firewall ordnungsgemäß konfiguriert i
|
|||
HOST = "Hosten"
|
||||
|
||||
[HOST_MODS]
|
||||
ROMHACKS = "ROM-HACKS"
|
||||
MODS = "MODS"
|
||||
CATEGORIES = "Kategorien"
|
||||
WARNING = "\\#ffffa0\\Warnung:\\#dcdcdc\\ Du hast 10 oder mehr Mods aktiviert, bitte deaktiviere einige, um Instabilität oder Lag zu vermeiden."
|
||||
|
||||
[HOST_MOD_CATEGORIES]
|
||||
ALL = "Alle"
|
||||
MISC = "Verschiedenes"
|
||||
ROMHACKS = "Rom-Hacks"
|
||||
GAMEMODES = "Spielmodi"
|
||||
MOVESETS = "Bewegungssätze"
|
||||
CHARACTER_SELECT = "Character Select"
|
||||
|
||||
[HOST_SAVE]
|
||||
SAVE_TITLE = "SPEICHERN"
|
||||
ERASE_TITLE = "LÖSCHEN"
|
||||
|
@ -220,7 +228,7 @@ PORT = "Port"
|
|||
PASSWORD = "Passwort"
|
||||
SAVE_SLOT = "Speicherplatz"
|
||||
SETTINGS = "Einstellungen"
|
||||
MODS = "Mods & Spielmodi"
|
||||
MODS = "Mods"
|
||||
ROMHACKS = "Rom-Hacks"
|
||||
APPLY = "Übernehmen"
|
||||
HOST = "Hosten"
|
||||
|
|
|
@ -169,10 +169,18 @@ WARN_SOCKET = "Assicurati che il tuo firewall sia configurato correttamente.\nLe
|
|||
HOST = "Crea"
|
||||
|
||||
[HOST_MODS]
|
||||
ROMHACKS = "ROMHACKS"
|
||||
MODS = "MODS"
|
||||
CATEGORIES = "Categorie"
|
||||
WARNING = "\\#ffffa0\\Attenzione:\\#dcdcdc\\ Sono state attivate 10 o più mod, disabilitarne alcune per evitare instabilità o lag."
|
||||
|
||||
[HOST_MOD_CATEGORIES]
|
||||
ALL = "Tutti"
|
||||
MISC = "Varie"
|
||||
ROMHACKS = "Romhacks"
|
||||
GAMEMODES = "Modalità di gioco"
|
||||
MOVESETS = "Set di spostamenti"
|
||||
CHARACTER_SELECT = "Character Select"
|
||||
|
||||
[HOST_SAVE]
|
||||
SAVE_TITLE = "SALVATAGGIO"
|
||||
ERASE_TITLE = "CANCELLA"
|
||||
|
@ -218,7 +226,7 @@ PORT = "Porta"
|
|||
PASSWORD = "Password"
|
||||
SAVE_SLOT = "Slot di Salvataggio"
|
||||
SETTINGS = "Opzioni"
|
||||
MODS = "Mod e modalità di gioco"
|
||||
MODS = "Mod"
|
||||
ROMHACKS = "Rom-Hacks"
|
||||
APPLY = "Applica"
|
||||
HOST = "Crea"
|
||||
|
|
|
@ -171,10 +171,18 @@ WARN_SOCKET = "Upewnij się, że twoja zapora jest poprawnie skonfigurowana.\nBe
|
|||
HOST = "Hostuj"
|
||||
|
||||
[HOST_MODS]
|
||||
ROMHACKS = "ROM-HACKI"
|
||||
MODS = "MODYFIKACJE"
|
||||
CATEGORIES = "Kategorie"
|
||||
WARNING = "\\#ffffa0\\Ostrzeżenie:\\#dcdcdc\\ Masz włączonych 10 lub więcej Modyfikacji. Wyłącz niektóre, aby zapobiec niestabilności lub opóźnieniom."
|
||||
|
||||
[HOST_MOD_CATEGORIES]
|
||||
ALL = "Wszystkie"
|
||||
MISC = "Różne"
|
||||
ROMHACKS = "Hacki do romów"
|
||||
GAMEMODES = "Tryby gry"
|
||||
MOVESETS = "Zestawy ruchów"
|
||||
CHARACTER_SELECT = "Character Select"
|
||||
|
||||
[HOST_SAVE]
|
||||
SAVE_TITLE = "ZAPISY"
|
||||
ERASE_TITLE = "KASOWANIE"
|
||||
|
@ -220,7 +228,7 @@ PORT = "Port"
|
|||
PASSWORD = "Hasło"
|
||||
SAVE_SLOT = "Plik Zapisu"
|
||||
SETTINGS = "Ustawienia"
|
||||
MODS = "Modyfikacje i Tryby Gry"
|
||||
MODS = "Modyfikacje"
|
||||
ROMHACKS = "Rom-Hacki"
|
||||
APPLY = "Zastosuj"
|
||||
HOST = "Hostuj"
|
||||
|
|
|
@ -171,10 +171,18 @@ WARN_SOCKET = "Verifique se o seu firewall está bem configurado.\nAo usar conex
|
|||
HOST = "Criar"
|
||||
|
||||
[HOST_MODS]
|
||||
ROMHACKS = "ROMHACKS"
|
||||
MODS = "MODS"
|
||||
CATEGORIES = "Categorias"
|
||||
WARNING = "\\#ffffa0\\Aviso:\\#dcdcdc\\ Você tem 10 ou mais mods ativados, desative alguns para evitar instabilidade ou lag."
|
||||
|
||||
[HOST_MOD_CATEGORIES]
|
||||
ALL = "Todos"
|
||||
MISC = "Outros"
|
||||
ROMHACKS = "Romhacks"
|
||||
GAMEMODES = "Modos de jogo"
|
||||
MOVESETS = "Movesets"
|
||||
CHARACTER_SELECT = "Character Select"
|
||||
|
||||
[HOST_SAVE]
|
||||
SAVE_TITLE = "ARQUIVO"
|
||||
ERASE_TITLE = "APAGAR ARQUIVO"
|
||||
|
@ -220,7 +228,7 @@ PORT = "Porta"
|
|||
PASSWORD = "Senha"
|
||||
SAVE_SLOT = "Arquivo de salvamento"
|
||||
SETTINGS = "Configurações"
|
||||
MODS = "Mods e modos de jogo"
|
||||
MODS = "Mods"
|
||||
ROMHACKS = "Rom-Hacks"
|
||||
APPLY = "Aplicar"
|
||||
HOST = "Criar"
|
||||
|
|
|
@ -170,10 +170,18 @@ WARN_SOCKET = "Убедитесь, что ваш файрвол настроен
|
|||
HOST = "Хост"
|
||||
|
||||
[HOST_MODS]
|
||||
ROMHACKS = "ROMHACKS"
|
||||
MODS = "MODS"
|
||||
CATEGORIES = "Категории"
|
||||
WARNING = "\\#ffffa0\\Внимание:\\#dcdcdc\\ У вас включено 10 или более модов, пожалуйста, отключите некоторые из них, чтобы предотвратить нестабильность или лаги."
|
||||
|
||||
[HOST_MOD_CATEGORIES]
|
||||
ALL = "Все"
|
||||
MISC = "Разное"
|
||||
ROMHACKS = "Romhacks"
|
||||
GAMEMODES = "Игровые режимы"
|
||||
MOVESETS = "Наборы движений"
|
||||
CHARACTER_SELECT = "Character Select"
|
||||
|
||||
[HOST_SAVE]
|
||||
SAVE_TITLE = "SAVE"
|
||||
ERASE_TITLE = "ERASE"
|
||||
|
@ -219,7 +227,7 @@ PORT = "Порт"
|
|||
PASSWORD = "Пароль"
|
||||
SAVE_SLOT = "Слот сохранения"
|
||||
SETTINGS = "Настройки"
|
||||
MODS = "Моды и режимы игры"
|
||||
MODS = "Моды"
|
||||
ROMHACKS = "ROM-Хаки"
|
||||
APPLY = "Применить"
|
||||
HOST = "Хост"
|
||||
|
|
|
@ -171,10 +171,18 @@ WARN_SOCKET = "Asegúrate de que tu firewall esté configurado correctamente.\nL
|
|||
HOST = "Crear"
|
||||
|
||||
[HOST_MODS]
|
||||
ROMHACKS = "ROMHACKS"
|
||||
MODS = "MODS"
|
||||
CATEGORIES = "Categorías"
|
||||
WARNING = "\\#ffffa0\\Advertencia:\\#dcdcdc\\ Tienes 10 o más mods activados, por favor desactiva algunos para prevenir inestabilidad o lag."
|
||||
|
||||
[HOST_MOD_CATEGORIES]
|
||||
ALL = "Todos"
|
||||
MISC = "Varios"
|
||||
ROMHACKS = "Romhacks"
|
||||
GAMEMODES = "Modos de juego"
|
||||
MOVESETS = "Conjuntos de movimientos"
|
||||
CHARACTER_SELECT = "Character Select"
|
||||
|
||||
[HOST_SAVE]
|
||||
SAVE_TITLE = "RANURAS DE\nGUARDADO"
|
||||
ERASE_TITLE = "BORRAR"
|
||||
|
@ -220,7 +228,7 @@ PORT = "Puerto"
|
|||
PASSWORD = "Contraseña"
|
||||
SAVE_SLOT = "Ranuras"
|
||||
SETTINGS = "Ajustes"
|
||||
MODS = "Mods y modos de juego"
|
||||
MODS = "Mods"
|
||||
ROMHACKS = "Rom-Hacks"
|
||||
APPLY = "Aplicar"
|
||||
HOST = "Crear"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
-- name: [CS] VL-Tone & Cjes Luigi
|
||||
-- description: [CS] \\#00ff00\\VL-Tone \\#dcdcdc\\& \\#00ff00\\Cjes Luigi\n\\#dcdcdc\\By: Coop Deluxe Team\n\nReturn of TWO nostalgic Luigi's dating back to the 2000s!\n\n\\#00ff00\\Model Credits:\n\\#dcdcdc\\VL-Tone\nCJes\n\n\\#00ff00\\Model Porting:\n\\#dcdcdc\\AngelicMiracles "Yuyake"\nFluffaMario\nSonicDark
|
||||
-- category: cs
|
||||
|
||||
-- localize functions to improve performance
|
||||
local table_insert,play_sound,djui_hud_get_screen_width,maxf,math_sin,djui_hud_set_color,djui_hud_set_font,string_format,djui_hud_measure_text,djui_hud_print_text,djui_hud_set_resolution,min,math_min,math_max,djui_hud_set_rotation,djui_hud_render_rect = table.insert,play_sound,djui_hud_get_screen_width,maxf,math.sin,djui_hud_set_color,djui_hud_set_font,string.format,djui_hud_measure_text,djui_hud_print_text,djui_hud_set_resolution,min,math.min,math.max,djui_hud_set_rotation,djui_hud_render_rect
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
-- name: [CS] Extra Characters
|
||||
-- description: [CS] \\#fc03df\\Ext\\#ffc342\\ra \\#00ff00\\Chara\\#d60f6f\\cters\n\\#dcdcdc\\By Coop Deluxe Team\n\n\\#dcdcdc\\This Character Select pack adds other characters from the Mario series!\n\n\\#ff6868\\Model Credits:\n\\\#dcdcdc\\FluffaMario\nAngelicMiracles "Yuyake"\nMelzinoff\nThatGurlTilly\n\n\\#00ff00\\Voice Actors:\n\\#dcdcdc\\MelissaMekrose\nSuperKirbyLover\nMorphiGalaxi\nAngelicMiracles "Yuyake"\nRihannaDeleon\n\n\\#ff6868\\Requires \\00ff00\\Character Select \\#ff6868\\enabled!
|
||||
-- description: [CS] \\#fc03df\\Ext\\#ffc342\\ra \\#00ff00\\Chara\\#d60f6f\\cters\n\\#dcdcdc\\By Coop Deluxe Team\n\n\\#dcdcdc\\This Character Select pack adds other characters from the Mario series!\n\n\\#ff6868\\Model Credits:\n\\\#dcdcdc\\FluffaMario\nAngelicMiracles "Yuyake"\nMelzinoff\nThatGurlTilly\n\n\\#00ff00\\Voice Actors:\n\\#dcdcdc\\MelissaMekrose\nSuperKirbyLover\nMorphiGalaxi\nAngelicMiracles "Yuyake"\nRihannaDeleon\n\n\\#ff6868\\Requires \\00ff00\\Character Select \\#ff6868\\enabled!
|
||||
-- category: cs
|
|
@ -494,7 +494,7 @@ local function mario_update(m)
|
|||
optionTable[i].optionBeingSet = false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local offset = gPlayerSyncTable[m.playerIndex].offset
|
||||
if offset ~= 0 and offset ~= nil then
|
||||
if altOffsetActs[m.action] ~= false then
|
||||
|
@ -710,7 +710,7 @@ local function on_hud_render()
|
|||
local textX = x * 0.5
|
||||
djui_hud_print_text(TEXT_NAME, width - textX - djui_hud_measure_text(TEXT_NAME) * 0.3, 55, 0.6)
|
||||
djui_hud_set_font(FONT_TINY)
|
||||
local creditScale = 0.6
|
||||
local creditScale = 0.6
|
||||
creditScale = math.min(creditScale, 100/djui_hud_measure_text(TEXT_CREDIT))
|
||||
djui_hud_print_text(TEXT_CREDIT, width - textX - djui_hud_measure_text(TEXT_CREDIT) * creditScale *0.5, 74, creditScale)
|
||||
djui_hud_set_font(FONT_ALIASED)
|
||||
|
@ -961,7 +961,7 @@ local function on_hud_render()
|
|||
djui_hud_render_rect(widthHalf - 4 * widthScaleLimited, yOffset + 10 - 2 * widthScaleLimited, 8 * widthScaleLimited, 5 * widthScaleLimited)
|
||||
end
|
||||
|
||||
-- Options
|
||||
-- Options
|
||||
for i = currOption - 2, currOption + 2 do
|
||||
if not (i < 1 or i > optionTableCount) then
|
||||
local toggleName = optionTable[i].name
|
||||
|
@ -1295,7 +1295,7 @@ local function chat_command(msg)
|
|||
return true
|
||||
end
|
||||
|
||||
-- Stop Character checks if API disallows it
|
||||
-- Stop Character checks if API disallows it
|
||||
if not menu_is_allowed() or charBeingSet then
|
||||
djui_chat_message_create("Character Cannot be Changed")
|
||||
return true
|
||||
|
|
|
@ -182,12 +182,7 @@ void djui_panel_host_create(struct DjuiBase* caller) {
|
|||
}
|
||||
|
||||
djui_button_create(body, DLANG(HOST, SETTINGS), DJUI_BUTTON_STYLE_NORMAL, djui_panel_host_settings_create);
|
||||
|
||||
struct DjuiButton* button2 = djui_button_create(body, DLANG(HOST, MODS), DJUI_BUTTON_STYLE_NORMAL, djui_panel_host_mods_create);
|
||||
button2->base.tag = 0;
|
||||
|
||||
struct DjuiButton* button3 = djui_button_create(body, DLANG(HOST, ROMHACKS), DJUI_BUTTON_STYLE_NORMAL, djui_panel_host_mods_create);
|
||||
button3->base.tag = 1;
|
||||
djui_button_create(body, DLANG(HOST, MODS), DJUI_BUTTON_STYLE_NORMAL, djui_panel_host_mods_create);
|
||||
|
||||
struct DjuiRect* rect3 = djui_rect_container_create(body, 64);
|
||||
{
|
||||
|
|
|
@ -10,15 +10,28 @@
|
|||
#include "pc/mods/mods_utils.h"
|
||||
#include "djui_panel_main.h"
|
||||
#include "djui_panel_host.h"
|
||||
#include "djui_panel_host_mods.h"
|
||||
#include "djui_panel_pause.h"
|
||||
|
||||
#define DJUI_MOD_PANEL_WIDTH (410.0f + (16 * 2.0f))
|
||||
#define MOD_CATEGORY_ALL "MOD_CATEGORY_ALL"
|
||||
#define MOD_CATEGORY_MISC "MOD_CATEGORY_MISC"
|
||||
|
||||
static struct DjuiFlowLayout* sModLayout = NULL;
|
||||
static struct DjuiThreePanel* sDescriptionPanel = NULL;
|
||||
static struct DjuiText* sTooltip = NULL;
|
||||
unsigned int selectedCategory = 0;
|
||||
static bool sWarned = false;
|
||||
static bool sRomHacks = false;
|
||||
|
||||
struct ModCategory sCategories[] = {
|
||||
// lang key, mod category
|
||||
{ "ALL", MOD_CATEGORY_ALL },
|
||||
{ "ROMHACKS", "romhack" },
|
||||
{ "GAMEMODES", "gamemode" },
|
||||
{ "MOVESETS", "moveset" },
|
||||
{ "CHARACTER_SELECT", "cs" },
|
||||
{ "MISC", MOD_CATEGORY_MISC },
|
||||
};
|
||||
|
||||
void djui_panel_host_mods_create(struct DjuiBase* caller);
|
||||
|
||||
|
@ -119,27 +132,58 @@ static void djui_panel_host_mods_destroy(struct DjuiBase* base) {
|
|||
sTooltip = NULL;
|
||||
}
|
||||
|
||||
void djui_panel_host_mods_create(struct DjuiBase* caller) {
|
||||
if (caller != NULL) {
|
||||
sRomHacks = caller->tag != 0;
|
||||
void djui_panel_on_categories_change(UNUSED struct DjuiBase* caller) {
|
||||
if (gDjuiInMainMenu) {
|
||||
djui_panel_shutdown();
|
||||
gDjuiInMainMenu = true;
|
||||
djui_panel_main_create(NULL);
|
||||
djui_panel_host_create(NULL);
|
||||
djui_panel_host_mods_create(NULL);
|
||||
} else {
|
||||
djui_panel_shutdown();
|
||||
djui_panel_pause_create(NULL);
|
||||
djui_panel_host_create(NULL);
|
||||
djui_panel_host_mods_create(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void djui_panel_host_mods_create(struct DjuiBase* caller) {
|
||||
|
||||
mods_update_selectable();
|
||||
djui_panel_host_mods_description_create();
|
||||
|
||||
struct DjuiThreePanel* panel = djui_panel_menu_create(
|
||||
sRomHacks ? DLANG(HOST_MODS, ROMHACKS) : DLANG(HOST_MODS, MODS),
|
||||
true);
|
||||
struct DjuiThreePanel* panel = djui_panel_menu_create(DLANG(HOST_MODS, MODS), true);
|
||||
|
||||
struct DjuiBase* body = djui_three_panel_get_body(panel);
|
||||
{
|
||||
// copy category choices from sCategories
|
||||
int numCategories = sizeof(sCategories) / sizeof(sCategories[0]);
|
||||
char* categoryChoices[sizeof(sCategories)];
|
||||
|
||||
// loop thru all categories names, and add those to the categoryChoices string array
|
||||
for (int i = 0; i < numCategories; i++) {
|
||||
categoryChoices[i] = djui_language_get("HOST_MOD_CATEGORIES", sCategories[i].langKey);
|
||||
}
|
||||
djui_selectionbox_create(body, DLANG(HOST_MODS, CATEGORIES), categoryChoices, numCategories, &selectedCategory, djui_panel_on_categories_change);
|
||||
struct DjuiPaginated* paginated = djui_paginated_create(body, 8);
|
||||
sModLayout = paginated->layout;
|
||||
struct DjuiBase* layoutBase = &paginated->layout->base;
|
||||
for (int i = 0; i < gLocalMods.entryCount; i++) {
|
||||
struct Mod* mod = gLocalMods.entries[i];
|
||||
if (sRomHacks != (mod->incompatible && strstr(mod->incompatible, "romhack"))) {
|
||||
char* category = mod->category;
|
||||
if (!category) { category = mod->incompatible; }
|
||||
if (!strstr(sCategories[selectedCategory].category, MOD_CATEGORY_ALL) && !strstr(sCategories[selectedCategory].category, MOD_CATEGORY_MISC) && (!category || !strstr(category, sCategories[selectedCategory].category))) {
|
||||
continue;
|
||||
} else if (!strstr(sCategories[selectedCategory].category, MOD_CATEGORY_ALL) && strstr(sCategories[selectedCategory].category, MOD_CATEGORY_MISC)) {
|
||||
bool doContinue = false;
|
||||
for (int i = 0; i < numCategories; i++) {
|
||||
if (strstr(sCategories[selectedCategory].category, MOD_CATEGORY_MISC) && (category && strstr(category, sCategories[i].category))) {
|
||||
doContinue = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (doContinue) { continue; }
|
||||
}
|
||||
struct DjuiCheckbox* checkbox = djui_checkbox_create(layoutBase, mod->name, &mod->enabled, djui_mod_checkbox_on_value_change);
|
||||
checkbox->base.tag = i;
|
||||
|
@ -158,7 +202,7 @@ void djui_panel_host_mods_create(struct DjuiBase* caller) {
|
|||
djui_button_create(body, DLANG(MENU, BACK), DJUI_BUTTON_STYLE_BACK, djui_panel_menu_back);
|
||||
}
|
||||
|
||||
panel->bodySize.value = paginated->base.height.value + 16 + 64;
|
||||
panel->bodySize.value = paginated->base.height.value + 64 + 64;
|
||||
}
|
||||
|
||||
panel->base.destroy = djui_panel_host_mods_destroy;
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
#pragma once
|
||||
#include "djui.h"
|
||||
|
||||
struct ModCategory {
|
||||
const char* langKey;
|
||||
const char* category;
|
||||
};
|
||||
|
||||
void djui_panel_host_mods_create(struct DjuiBase* caller);
|
||||
|
|
|
@ -193,6 +193,11 @@ void mod_clear(struct Mod* mod) {
|
|||
mod->incompatible = NULL;
|
||||
}
|
||||
|
||||
if (mod->category != NULL) {
|
||||
free(mod->category);
|
||||
mod->category = NULL;
|
||||
}
|
||||
|
||||
if (mod->description != NULL) {
|
||||
free(mod->description);
|
||||
mod->description = NULL;
|
||||
|
@ -407,6 +412,7 @@ static void mod_extract_fields(struct Mod* mod) {
|
|||
// default to null
|
||||
mod->name = NULL;
|
||||
mod->incompatible = NULL;
|
||||
mod->category = NULL;
|
||||
mod->description = NULL;
|
||||
mod->pausable = true;
|
||||
mod->ignoreScriptWarnings = false;
|
||||
|
@ -435,6 +441,11 @@ static void mod_extract_fields(struct Mod* mod) {
|
|||
if (snprintf(mod->incompatible, MOD_INCOMPATIBLE_MAX_LENGTH, "%s", extracted) < 0) {
|
||||
LOG_INFO("Truncated mod incompatible field '%s'", mod->incompatible);
|
||||
}
|
||||
} else if (mod->category == NULL && (extracted = extract_lua_field("-- category:", buffer))) {
|
||||
mod->category = calloc(MOD_CATEGORY_MAX_LENGTH + 1, sizeof(char));
|
||||
if (snprintf(mod->category, MOD_CATEGORY_MAX_LENGTH, "%s", extracted) < 0) {
|
||||
LOG_INFO("Truncated mod category field '%s'", mod->category);
|
||||
}
|
||||
} else if (mod->description == NULL && (extracted = extract_lua_field("-- description:", buffer))) {
|
||||
mod->description = calloc(MOD_DESCRIPTION_MAX_LENGTH + 1, sizeof(char));
|
||||
if (snprintf(mod->description, MOD_DESCRIPTION_MAX_LENGTH, "%s", extracted) < 0) {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#define MOD_NAME_MAX_LENGTH 64
|
||||
#define MOD_INCOMPATIBLE_MAX_LENGTH 256
|
||||
#define MOD_CATEGORY_MAX_LENGTH 64
|
||||
#define MOD_DESCRIPTION_MAX_LENGTH 800
|
||||
|
||||
struct Mods;
|
||||
|
@ -24,6 +25,7 @@ struct ModFile {
|
|||
struct Mod {
|
||||
char* name;
|
||||
char* incompatible;
|
||||
char* category;
|
||||
char* description;
|
||||
char relativePath[SYS_MAX_PATH];
|
||||
char basePath[SYS_MAX_PATH];
|
||||
|
|
Loading…
Reference in a new issue