Barotrauma icon indicating copy to clipboard operation
Barotrauma copied to clipboard

GUI window lock position doesn't work

Open SomeRandomNoobKekeke opened this issue 2 years ago • 5 comments

Disclaimers

  • [X] I have searched the issue tracker to check if the issue has already been reported.
  • [ ] My issue happened while using mods.

What happened?

Locked windows are moved to the center of the screen at the beginning of each round It doesn't seem intended

20240210022327_1 20240210022402_1

Reproduction steps

Start campaing on a sub with a fabricator e.g. Camel Open fabricator and lock all windows Start some mission Check fabricator

Bug prevalence

Happens every time I play

Single player or multiplayer?

Single player

-

No response

Version

v1.2.8.0 (Winter Update hotfix 2)

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

SomeRandomNoobKekeke avatar Feb 09 '24 23:02 SomeRandomNoobKekeke

~~This is probably caused by window position restrictions See this https://github.com/FakeFishGames/Barotrauma/issues/13413#issuecomment-1937057558~~

SomeRandomNoobKekeke avatar Feb 10 '24 16:02 SomeRandomNoobKekeke

I'm afraid I couldn't find a way to reproduce this: the panels seem to stay in the same position between rounds (regardless if they're locked or not):

https://github.com/FakeFishGames/Barotrauma/assets/14351070/826416fb-b477-47f7-aa80-2eb0bec888a4

Regalis11 avatar Feb 19 '24 10:02 Regalis11

Hmm, I've done more testing, it's indeed hard to reproduce in vanilla 100% way is: don't move the windows, just lock them

As i said it's becoming a problem if you have 2 cabinets linked to a fabricator Like on some custom subs, or if you use Barocraftables + lua linker you can put and link as many cabinets as you want Even though there's enough space and windows are locked they still get teleported to origin on round start

https://github.com/FakeFishGames/Barotrauma/assets/122838333/f426f94a-6cdb-4a0b-a419-d70d7be7c479

I assumed that if windows got teleported in both cases then it's the same problem, maybe it's not I also don't know if it happens for 3+ things linked together, or they have to cover some % of screen Needs even more testing barodev small

Link to the camel where fabricator linked to 2 cabinets if you need it

SomeRandomNoobKekeke avatar Feb 19 '24 12:02 SomeRandomNoobKekeke

I did even more testing

Repositioned item interfaces retain their positions between rounds.

It was added in v1.1.14.0 and i didn't notice So you don't even need to lock windows for them to retain position

In fact this happens only when you lock some windows, and it seems that only windows that haven't been touched in this round could teleport in next one

So the fix is: don't use locking, or touch every window before locking Also it's not fixed by removing positioning restrictions, so that's just lack of testing i guess

SomeRandomNoobKekeke avatar Feb 21 '24 05:02 SomeRandomNoobKekeke

I found another example of "why 3+ windows may not retain their positions" When you open some item for the first time game tries to place interfaces of all linked items in center For 2 items layout is symmetric, but for 3 there are more combinations possible

https://github.com/FakeFishGames/Barotrauma/assets/122838333/c1d8a914-e26d-492d-828c-5b2cdf860fbd

But with locking it works fine

https://github.com/FakeFishGames/Barotrauma/assets/122838333/b4f3c622-1ce5-4b6c-b08a-3e5524536235

SomeRandomNoobKekeke avatar Feb 21 '24 14:02 SomeRandomNoobKekeke