Skip to content

Bug with "Ingame HUD" not updating when switching sectors #1

@EngineOfDarkness

Description

@EngineOfDarkness

Bug:

The Ingame Hud (the one where the resources are displayed) is not updated correctly.

It's only updated once and then never again

The callback method here https://github.com/riandrake/DistanceToCenter/blob/master/data/scripts/player/ui/distancetocenter.lua#L165

uses DTC.hud which is set here

https://github.com/riandrake/DistanceToCenter/blob/master/data/scripts/player/ui/distancetocenter.lua#L65

inside DTC.initialize and since DTC.initialize only runs once it never updates after being set initially.

Maybe Suggestion

Maybe you can use the onSectorEntered (or similar) Callback of the Player Entity to update DTC.hud.label_value with the correct distance?


First Picture is the Sector I spawn in with a distance of 306 to the center (see top left)

20201227041853_1

This picture shows a sector I switched into which is distance 404 to center (as shown in the 3rd screenshot), but the distance at the top left does not update from 306 to 404

20201227041948_1

20201227041955_1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions