Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new feature to Change Game Description #14

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion addons/amxmodx/configs/multimod_manager/configs.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@
// If the path does not exist, it will be considered as disabled
// E.g.: "addons/resemiclip"

"change_game_description": true, // true / false (Changes the game description with the name of the mod)
"change_game_description": 1,
// 0 = Disabled
// 1 = Changes the game description with the name (modname) of the mod
// 2 = Changes the game description with the tag (mod_tag) of the mod

"mods":
[
Expand Down
2 changes: 1 addition & 1 deletion addons/amxmodx/scripting/include/mm_incs/defines.inc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ enum GlobalConfigs_e
ReSemiclipPath[PLATFORM_MAX_PATH],

// Change Game Description
bool:ChangeGameDescription,
ChangeGameDescription,

// Mods
Array:Mods,
Expand Down
9 changes: 7 additions & 2 deletions addons/amxmodx/scripting/multimod_manager.sma
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ MultiMod_Init()
g_GlobalConfigs[MaxRecentMaps] = max(0, json_object_get_number(jConfigsFile, "max_recent_maps"));
g_GlobalConfigs[OverwriteMapcycle] = json_object_get_bool(jConfigsFile, "overwrite_mapcycle");
json_object_get_string(jConfigsFile, "resemiclip_path", g_GlobalConfigs[ReSemiclipPath], PLATFORM_MAX_PATH-1);
g_GlobalConfigs[ChangeGameDescription] = json_object_get_bool(jConfigsFile, "change_game_description");
g_GlobalConfigs[ChangeGameDescription] = clamp(json_object_get_number(jConfigsFile, "change_game_description"), 0, 2);

new JSON:jArrayMods = json_object_get_value(jConfigsFile, "mods");
new iCount = json_array_get_count(jArrayMods);
Expand Down Expand Up @@ -972,7 +972,12 @@ MultiMod_SetGameDescription(const iMod)
new aMod[ArrayMods_e];
ArrayGetArray(g_GlobalConfigs[Mods], iMod, aMod);

set_member_game(m_GameDesc, aMod[ModName]);
switch(g_GlobalConfigs[ChangeGameDescription])
{
case 1: set_member_game(m_GameDesc, aMod[ModName]);
case 2: set_member_game(m_GameDesc, aMod[ModTag]);
}

return 1;
}

Expand Down
Loading