[quote]
3x1920x1080 / 5760x1080 / (48:9) - working 07/Jan/2010
hudlayout.res
I have also worked with a friend to develop a perl script that reads the hudlayout.res file and is able to increment a defined value to all the xpos values, this had made updating and testing a lot faster than manually searching for and calculating each value by hand.
Do you ever run into issues because you incremented some values that shouldn't have been incremented? Just curious since a blind update of all xpos key/value strings seems kind of risky.
But great job on the script, :D
I had run into issues before yes, tho nothing major, I have now a slightly updated script to counter the ones that required no changes here...
Code:
#!/usr/bin/perl
use strict;
my $x = $ARGV[1];
open(my $f, '<', $ARGV[0]);
open(my $f2, '>', $ARGV[2]);
my $text = '';
$text .= $_ while(<$f>);
$text =~ s/^(s*"xpos"s+"r?)(-?d+)(?=")/$1.($2+$x);/eim;
my $hud_sections = join('|', [
'HudWeaponSelection', 'HudKothTimeStatus',
'HudObjectiveStatus', 'HudProgressBar']);
$text =~ s/((?:$hud_sections)s+{[^}]*?
"xpos"s+"r?)(-?d+)(?=")/$1.0/egisx;
$text =~ s/(HudWeaponSelections+{[^}]*?
"rightmargin"s+"r?)(-?d+)(?=")/$1.$x/eisx;
print $fh2 $text;
This will ignore the following sections,
"HudWeaponSelection"
"HudKothTimeStatus"
"HudObjectiveStatus"
"HudProgressBar"
and only replace xpos values that do not contain C or C- there for anything that is already centered remains untouched.