Support for backslashed spaces in script commands
This commit is contained in:
parent
e7295bb18f
commit
7a31c1fc55
|
|
@ -131,7 +131,6 @@ sub RunScriptLine {
|
|||
# Copy to refer to
|
||||
my $oline = $line;
|
||||
|
||||
# Remove comments
|
||||
$line=~s/#.+$//; # Remove comments
|
||||
$line=~s/^\s+//; # Remove leading whitespace
|
||||
$line=~s/\s+$//; # Remove trailing whitespace
|
||||
|
|
@ -141,7 +140,14 @@ sub RunScriptLine {
|
|||
return 0;
|
||||
}
|
||||
|
||||
my($cmd, @opts)=split(/\s+/, $line);
|
||||
my @opts;
|
||||
{
|
||||
my $sline = $line;
|
||||
$sline=~s/\\ /\x01/g;
|
||||
(@opts)=split(/\s+/, $sline);
|
||||
map { s/\x01/ /g } (@opts);
|
||||
}
|
||||
my $cmd = shift(@opts);
|
||||
LogData(DEBUG, "$file:$linenum $cmd(" . join(',',@opts) . ")");
|
||||
if(exists $script_commands{$cmd}) {
|
||||
$script_commands{$cmd}{'sub'}->(@opts);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ __init__:
|
|||
Show aka3 spritesheet.png 200 0 3 max_loops=10
|
||||
|
||||
AddSayer h "Hermione" aka01.png 200 200 200 255
|
||||
AddSayer h2 "Topless_Hermione" aka05.png 255 0 0 255
|
||||
AddSayer h2 "Topless\ Hermione" aka05.png 255 0 0 255
|
||||
AddSayer h3 "Stripping\ Hermione" spritesheet.png 255 0 0 255
|
||||
|
||||
Jump donothing
|
||||
|
||||
|
|
@ -18,8 +19,8 @@ donothing:
|
|||
LoopCount=LoopCount+1
|
||||
h "Loop number [LoopCount]"
|
||||
TestVar=lc("Foo").uc(lc("Foo"))
|
||||
h "TestVar [TestVar]"
|
||||
h2 "TestVar [TestVar]"
|
||||
TestVar = uc("[TestVar]")
|
||||
h "TestVar2 [TestVar]"
|
||||
h3 "TestVar2 [TestVar]"
|
||||
ExitGame
|
||||
Jump donothing
|
||||
|
|
|
|||
Loading…
Reference in New Issue