From 082d8c7c83929dc600e26d2c04fc9ef11bb00f37 Mon Sep 17 00:00:00 2001 From: xe1os <39219862+xe1os@users.noreply.github.com> Date: Sat, 4 Jul 2026 13:34:19 +0530 Subject: [PATCH] Add WeaponPaints installation function Implement function to install WeaponPaints files and update file list. --- lgsm/modules/mods_core.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/lgsm/modules/mods_core.sh b/lgsm/modules/mods_core.sh index ed59277cb..15f0c1e12 100755 --- a/lgsm/modules/mods_core.sh +++ b/lgsm/modules/mods_core.sh @@ -102,6 +102,10 @@ fn_mod_copy_destination() { fn_print_ok_eol_nl fn_script_log_pass "Copying ${modprettyname} to ${modinstalldir}" fi + + if [ "${modcommand}" == "weaponpaints" ]; then + fn_mod_install_weaponpaints_files + fi } # Add the mod to the installed-mods.txt. @@ -782,6 +786,35 @@ fn_mod_remove_gameinfo_gi_file() { fi } +fn_mod_install_weaponpaints_files() { + if [ -d "${modinstalldir}/WeaponPaints" ]; then + echo -en "moving WeaponPaints plugin to plugins directory..." + fn_sleep_time + + mkdir -p "${modinstalldir}/plugins" + rm -rf "${modinstalldir}/plugins/WeaponPaints" + mv "${modinstalldir}/WeaponPaints" "${modinstalldir}/plugins/WeaponPaints" + exitcode=$? + + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "Moving WeaponPaints to ${modinstalldir}/plugins/WeaponPaints" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Moving WeaponPaints to ${modinstalldir}/plugins/WeaponPaints" + fi + + # Update uninstall/update file list after moving plugin folder. + sed -i "s#^WeaponPaints#plugins/WeaponPaints#g" "${modsdir}/${modcommand}-files.txt" + fi + + # Do not let uninstall remove the shared CounterStrikeSharp gamedata directory itself. + if [ -f "${modsdir}/${modcommand}-files.txt" ]; then + sed -i "/^gamedata$/d" "${modsdir}/${modcommand}-files.txt" + fi +} + ## Database initialisation. mods_list.sh