mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
One more change to multi-value placeholders: indices start from 0. #1899
This commit is contained in:
parent
a4b6075600
commit
7a9dec3720
2 changed files with 8 additions and 10 deletions
|
@ -43,7 +43,7 @@ sub apply_config {
|
|||
foreach my $opt_key (@opt_keys) {
|
||||
my $value = $config->$opt_key;
|
||||
next unless ref($value) eq 'ARRAY';
|
||||
$m->{"${opt_key}_" . ($_+1)} = $value->[$_] for 0..$#$value;
|
||||
$m->{"${opt_key}_" . $_} = $value->[$_] for 0..$#$value;
|
||||
$m->{$opt_key} = $value->[0];
|
||||
if ($Slic3r::Config::Options->{$opt_key}{type} eq 'point') {
|
||||
$m->{"${opt_key}_X"} = $value->[0];
|
||||
|
@ -73,8 +73,8 @@ sub process {
|
|||
my $regex = join '|', keys %{$self->_multiple};
|
||||
$string =~ s/\[($regex)\]/$self->_multiple->{$1}/egx;
|
||||
|
||||
# unhandled indices are populated using the first value, except _0 which is ignored for safety
|
||||
$string =~ s/\[($regex)_[1-9]\d*\]/$self->_multiple->{$1}/egx;
|
||||
# unhandled indices are populated using the first value
|
||||
$string =~ s/\[($regex)_\d+\]/$self->_multiple->{$1}/egx;
|
||||
}
|
||||
|
||||
return $string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue