Add label into in front of Interface title.

Change code in function.pl
1. Add this code under "my $title;"
Code: Select all
# Add label
if (defined($config{label})) {
$title = TF("\[%s\]", $config{label});
}
Code: Select all
if ($net->getState() == Network::IN_GAME) {
...
# Translation Comment: Interface Title with character status
$title .= TF("%s B%s (%s), J%s (%s) : w%s%s - %s",
$charName, $char->{lv}, $basePercent . '%',
$char->{lv_job}, $jobPercent . '%',
$weight, $pos, $Settings::NAME);
} elsif ($net->getState() == Network::NOT_CONNECTED) {
# Translation Comment: Interface Title
$title .= TF("%sNot connected - %s", $charName, $Settings::NAME);
} else {
# Translation Comment: Interface Title
$title .= TF("%sConnecting - %s", $charName, $Settings::NAME);
}
Code: Select all
# Set interface title
my $charName;
my $title;
# Add label
if (defined($config{label})) {
$title = TF("\[%s\]", $config{label});
}
$charName = "$char->{name}: " if ($char);
if ($net->getState() == Network::IN_GAME) {
my ($basePercent, $jobPercent, $weight, $pos);
assert(defined $char);
$basePercent = sprintf("%.2f", $char->{exp} / $char->{exp_max} * 100) if ($char->{exp_max});
$jobPercent = sprintf("%.2f", $char->{exp_job} / $char->{exp_job_max} * 100) if ($char->{exp_job_max});
$weight = int($char->{weight} / $char->{weight_max} * 100) . "%" if ($char->{weight_max});
$pos = " : $char->{pos_to}{x},$char->{pos_to}{y} " . $field->name if ($char->{pos_to} && $field);
# Translation Comment: Interface Title with character status
$title .= TF("%s B%s (%s), J%s (%s) : w%s%s - %s",
$charName, $char->{lv}, $basePercent . '%',
$char->{lv_job}, $jobPercent . '%',
$weight, $pos, $Settings::NAME);
} elsif ($net->getState() == Network::NOT_CONNECTED) {
# Translation Comment: Interface Title
$title .= TF("%sNot connected - %s", $charName, $Settings::NAME);
} else {
# Translation Comment: Interface Title
$title .= TF("%sConnecting - %s", $charName, $Settings::NAME);
}
my %args = (return => $title);
Plugins::callHook('mainLoop::setTitle',\%args);
$interface->title($args{return});