Mise à jour de 'Run.sh'

add new method: getmodprefix
This commit is contained in:
2022-07-18 17:43:02 +00:00
parent 82d298e3a2
commit ca203d396d

48
Run.sh
View File

@@ -36,6 +36,12 @@ function del_ServerActors() {
del_iniKey 'XC_Engine.XC_GameEngine' ServerActors $1
}
function getmodprefix() {
UNUFile=$(find $OUTPUT_DIR/System -type f -name "UN*.u" -exec basename {} \;)
UNBaseName="${UNUFile%.*}"
echo $UNBaseName
}
function install() {
rsync -a $SCRIPT_DIR/Help/ $OUTPUT_DIR/Help --exclude '.git'
rsync -a $SCRIPT_DIR/System/ $OUTPUT_DIR/System --exclude '.git'
@@ -44,8 +50,7 @@ function install() {
}
function enable() {
UNUFile=$(find $OUTPUT_DIR/System -type f -name "UN*.u" -exec basename {} \;)
UNBaseName="${UNUFile%.*}"
UNBaseName=getmodprefix()
VAUFile=$(find $OUTPUT_DIR/System -type f -name "VAH*.u" -exec basename {} \;)
VABaseName="${VAUFile%.*}"
@@ -58,8 +63,7 @@ function enable() {
}
function disable() {
UNUFile=$(find $OUTPUT_DIR/System -type f -name "UN*.u" -exec basename {} \;)
UNBaseName="${UNUFile%.*}"
UNBaseName=getmodprefix()
VAUFile=$(find $OUTPUT_DIR/System -type f -name "VAH*.u" -exec basename {} \;)
VABaseName="${VAUFile%.*}"
@@ -72,63 +76,45 @@ function disable() {
}
function enableCG() {
UNUFile=$(find $OUTPUT_DIR/System -type f -name "UN*.u" -exec basename {} \;)
UNBaseName="${UNUFile%.*}"
UNBaseName=getmodprefix()
add_ServerActors $UNBaseName.NewNetCG
echo enable ok
}
function disableCG() {
UNUFile=$(find $OUTPUT_DIR/System -type f -name "UN*.u" -exec basename {} \;)
UNBaseName="${UNUFile%.*}"
UNBaseName=getmodprefix()
del_ServerActors $UNBaseName.NewNetCG
echo disable ok
}
function enableDJ() {
UNUFile=$(find $OUTPUT_DIR/System -type f -name "UN*.u" -exec basename {} \;)
UNBaseName="${UNUFile%.*}"
UNBaseName=getmodprefix()
add_ServerActors $UNBaseName.DoubleJump
echo enable ok
}
function disableDJ() {
UNUFile=$(find $OUTPUT_DIR/System -type f -name "UN*.u" -exec basename {} \;)
UNBaseName="${UNUFile%.*}"
UNBaseName=getmodprefix()
del_ServerActors $UNBaseName.DoubleJump
echo disable ok
}
function enableGM() {
UNUFile=$(find $OUTPUT_DIR/System -type f -name "UN*.u" -exec basename {} \;)
UNBaseName="${UNUFile%.*}"
UNBaseName=getmodprefix()
add_ServerActors $UNBaseName.GrapMut
echo enable ok
}
function disableGM() {
UNUFile=$(find $OUTPUT_DIR/System -type f -name "UN*.u" -exec basename {} \;)
UNBaseName="${UNUFile%.*}"
UNBaseName=getmodprefix()
del_ServerActors $UNBaseName.GrapMut
echo disable ok
}
function show_help() {
echo
echo "Usage: $0 { install | enable | disable } <UT99_INSTALL_DIR> [<UT99_CONFIG_FILE>]"
echo "Usage: $0 { getmodprefix |install | enable | disable } <UT99_INSTALL_DIR> [<UT99_CONFIG_FILE>]"
echo " $0 { enableCG | disableCG } <UT99_INSTALL_DIR> [<UT99_CONFIG_FILE>]"
echo " $0 { enableDJ | disableDJ } <UT99_INSTALL_DIR> [<UT99_CONFIG_FILE>]"
echo " $0 { enableGM | disableGM } <UT99_INSTALL_DIR> [<UT99_CONFIG_FILE>]"
@@ -163,6 +149,10 @@ function check_game_dir() {
}
case "$1" in
'getmodprefix')
check_game_dir
getmodprefix
;;
'install')
check_game_dir
install