first commit

This commit is contained in:
cclecle
2022-12-03 21:23:30 +00:00
commit b042a6b07a
5 changed files with 151 additions and 0 deletions

25
Help/HUDFix.txt Normal file
View File

@@ -0,0 +1,25 @@
//===========================================================================
// HUD Scaling Fix by Azarael
//===========================================================================
This mutator replaces the HUDs of all standard gametypes. It will work with custom gametypes which
use a standard HUD class. The replacement HUDs draw widgets in the correct ratio for your current
screen resolution. Additionally, support for the UT2003 HUDs has been added. These can be switched to
via the mutator options.
As this mutator replaces the HUD, it is naturally not compatible with any other mutator which does so
as well. If the other mutator's custom HUD can safely be replaced (as in the case of UTComp, for
example), this mutator can be made the first in the mutator chain.
If you are a server admin, /please/ run this mutator on your servers. If you are a custom gametype creator,
please derive your HUD from this package and redistribute it. It makes the HUD so much more
bearable.
Additional console commands:
General:
scalehud x: Scales the HUD. Allows values greater than 1. Maxes at ResScaleX / ResScaleY.
Mutant:
togglecenterradar: Toggles between the default Mutant radar (which I find to be incredibly distracting)
and code for a smaller radar drawn just below the top of the screen.
This version is intended to be final. If there are any issues or inaccuracies, mail lonewolfut@gmail.com. Thanks.

3
Readme.md Normal file
View File

@@ -0,0 +1,3 @@
# HUDFix Release GIT repository
checkout official page : https://forums.epicgames.com/unreal-tournament-2003-2004/user-maps-mods/full-releases/299029-hud-scaling-fix

121
Run.sh Normal file
View File

@@ -0,0 +1,121 @@
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
OUTPUT_DIR="$2"
CFG_FILE="$3"
DEFAULT_CFG_FILE=UT2004.ini
function add_iniKeyEx() {
crudini --set $OUTPUT_DIR/System/$1 $2 __$3 $4
# Warning: ugly hack with sed to allow multiple key instances + to remove space around '='
sed -i "s/[[:space:]]*__$(echo $3 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')[[:space:]]*=[[:space:]]*/$(echo $3 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')=/g" $OUTPUT_DIR/System/$1
}
# !!Warning!! section is not considered
function del_iniKeyEx() {
sed -i "/[[:space:]]*$(echo $3 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')[[:space:]]*=[[:space:]]*$(echo $4 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')/d" $OUTPUT_DIR/System/$1
}
function add_iniKey() {
add_iniKeyEx $CFG_FILE $1 $2 $3
}
# !!Warning!! section is not considered
function del_iniKey() {
del_iniKeyEx $CFG_FILE $1 $2 $3
}
function add_ServerPackage() {
add_iniKey 'Engine.GameEngine' ServerPackages $1
}
function del_ServerPackage() {
del_iniKey 'Engine.GameEngine' ServerPackages $1
}
function add_ServerActors() {
add_iniKey 'Engine.GameEngine' ServerActors $1
}
function del_ServerActors() {
del_iniKey 'Engine.GameEngine' ServerActors $1
}
function getmodprefix() {
_File=$(find $OUTPUT_DIR/System -type f -iname "HUDFix*\.u" -exec basename {} \; | sort -nr | head -n 1)
BaseName="${_File%.*}"
echo "$BaseName"
}
function install() {
rsync -a $SCRIPT_DIR/Help/ $OUTPUT_DIR/Help/ --exclude '.git'
rsync -a $SCRIPT_DIR/System/ $OUTPUT_DIR/System/ --exclude '.git'
echo install ok
}
function enable() {
BaseName="$(getmodprefix)"
add_ServerPackage $BaseName
echo enable ok
}
function disable() {
BaseName="$(getmodprefix)"
del_ServerPackage $BaseName
echo disable ok
}
function show_help() {
echo
echo "Usage: $0 { getmodprefix | install | enable | disable } <UT2k4_INSTALL_DIR> [<UT2k4_CONFIG_FILE>]"
echo
}
function check_cfg_file() {
if [ -z ${CFG_FILE} ]
then
echo "CFG_FILE is unset, setting it to $DEFAULT_CFG_FILE"
CFG_FILE=$DEFAULT_CFG_FILE
else
echo "CFG_FILE is set to '$CFG_FILE'"
fi
if [ ! -f $OUTPUT_DIR/System/$CFG_FILE ]
then
echo "$OUTPUT_DIR/System/$CFG_FILE does not exist"
show_help
exit 9999 # die with error code 9999
fi
}
function check_game_dir() {
### Check if a directory does not exist ###
if [ ! -d $OUTPUT_DIR ]
then
echo "incorrect <UT2k4_INSTALL_DIR>"
show_help
exit 9999 # die with error code 9999
fi
}
case "$1" in
'getmodprefix')
check_game_dir
getmodprefix
;;
'install')
check_game_dir
install
;;
'enable')
check_game_dir
check_cfg_file
disable
enable
;;
'disable')
check_game_dir
check_cfg_file
disable
;;
*)
show_help
exit 1
;;
esac
exit 0

BIN
System/HUDFix.u Normal file

Binary file not shown.

2
System/HUDFix.ucl Normal file
View File

@@ -0,0 +1,2 @@
Mutator=(ClassName=HUDFix.Mut2K3HUDFix,GroupName=HUD,IconMaterialName=MutatorArt.nosym,FriendlyName=HUDFix.Mut2K3HUDFix.FriendlyName,Description=HUDFix.Mut2K3HUDFix.Description,FriendlyName=HUDFix.Mut2K3HUDFix.FriendlyName,FallbackName="Heads-Up Display Fix: UT2003 HUDs",FallbackDesc="Enables the UT2003 HUDs for all gametypes using a standard HUD class.")
Mutator=(ClassName=HUDFix.MutHUDFix,GroupName=HUD,IconMaterialName=MutatorArt.nosym,FriendlyName=HUDFix.MutHUDFix.FriendlyName,Description=HUDFix.MutHUDFix.Description,FriendlyName=HUDFix.MutHUDFix.FriendlyName,FallbackName="Heads-Up Display Fix",FallbackDesc="Enables various HUD fixes for UT2004's standard HUDs.")