|
|
@ -81,15 +81,19 @@ sub to_string { |
|
|
|
my ($self) = @_; |
|
|
|
my ($self) = @_; |
|
|
|
my @fields = $self->fields(); |
|
|
|
my @fields = $self->fields(); |
|
|
|
my $string = "Style: "; |
|
|
|
my $string = "Style: "; |
|
|
|
|
|
|
|
my @values = (); |
|
|
|
foreach my $field (@fields) { |
|
|
|
foreach my $field (@fields) { |
|
|
|
my $d = $STYLE_DEFAULTS{$field}; |
|
|
|
my $d = $STYLE_DEFAULTS{$field}; |
|
|
|
|
|
|
|
my $v = $self->{$f} // $d->{value}; |
|
|
|
if ($d->{type} eq 'x') { |
|
|
|
if ($d->{type} eq 'x') { |
|
|
|
$fmt = ($self->{_vers} eq 'ass') ? '&H%08X' : '%d'; |
|
|
|
$fmt = ($self->{_vers} eq 'ass') ? '&H%08X' : '%d'; |
|
|
|
$string .= sprintf $fmt, $self->{$f}; |
|
|
|
$v = sprintf $fmt, $v; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$string .= $self->{$f} // $d->{value}; |
|
|
|
# use as is |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
push @values, $v; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$string .= join(',', @values); |
|
|
|
|
|
|
|
|
|
|
|
return $string; |
|
|
|
return $string; |
|
|
|
} |
|
|
|
} |
|
|
|