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