avoid text overlapping

This commit is contained in:
2026-04-15 21:34:28 +03:00
parent be360a51b8
commit bb2af28b48
3 changed files with 66 additions and 53 deletions
@@ -31,9 +31,9 @@ class GenericObject extends EventManager{
if (!data.exclude && (data.hud || data.description)){
engine.clickable.add(this.object, async e=>{
this.object.__onhud = !this.object.__onhud;
if (engine.dashboard){
if (data.hud){
this.object.__onhud = !this.object.__onhud;
const filterNoHud = a=>a.getClip().name.match(/\.nohud/)
if (this.object._hud ){
this.#actions.filter(filterNoHud).forEach(a=>a.play());
@@ -59,10 +59,11 @@ class GenericObject extends EventManager{
}
}
if (data.description){
engine.dashboard.updateText(this.object.__onhud ? data.description : '', {
engine.dashboard.updateText((!data.hud || this.object.__onhud) ? data.description : '', {
textScrolledCallback: (d)=>{
d && this.dispatchEvent({type:'finish'})
}
},
hideOnFinish: true
})
}
}