OpenKore / openkore

A free/open source client and automation tool for Ragnarok Online
http://openkore.com
Other
1.28k stars 1.04k forks source link

There is no color in Vx #3747

Closed hubertyang88 closed 1 year ago

hubertyang88 commented 1 year ago

------------------ Openkore Issues Template ------------------

hubertyang88 commented 1 year ago

while trying to fix color , I fixed Connected status To show connected info in bottom : add $self->status_update(); in sub updateHook

sub updateHook {
    my $hookname = shift;
    my $r_args = shift;
    my $self = shift;
    return unless defined $self->{mw};
    $self->updatePos();
    $self->{mw}->update();
    $self->setAiText("@ai_seq");
    $self->status_update();
    #if ($field->baseName eq $config{lockMap} || !$config{lockMap}) {
    #   $self->status_update("On Map: " . $field->baseName);
    #} else {
    #   $self->status_update("On Map: " . $field->baseName . " | LockMap: " . $config{lockMap});
    #}
}

and modify sub status_update (copied from tk.pm )

sub status_update {
    my $self = shift;
    my $Text = shift;
    my $oldStatText = $Text || '';
    if (!$conState) {
        $Text = "Initializing...";
    } elsif ($conState == 1) {
        $Text = "Not connected";
    } elsif ($conState > 1 && $conState < 5) {
        $Text = "Connecting...";
    } else {
        $Text = "Connected";
    }
    if($oldStatText ne $Text) {
        $self->{status_gen}->configure( -text => $Text);
    }
}
hubertyang88 commented 1 year ago

bug is located , comment this line out return unless $colors_loaded; in sub resetColors , now color works in Vx