@@ -45,6 +45,7 @@ public class ModularUIContext {
45
45
private final Deque <ModularWindow > windows = new LinkedList <>();
46
46
private final BiMap <Integer , ModularWindow > syncedWindows = HashBiMap .create (4 );
47
47
private final Map <ModularWindow , Pos2d > lastWindowPos = new HashMap <>();
48
+ private final Map <Integer , Pos2d > lastSyncedWindowPos = new HashMap <>();
48
49
private ModularWindow mainWindow ;
49
50
50
51
@ SideOnly (Side .CLIENT )
@@ -270,7 +271,12 @@ public void closeAllButMain() {
270
271
271
272
public void storeWindowPos (ModularWindow window , Pos2d pos ) {
272
273
if (windows .contains (window )) {
273
- this .lastWindowPos .put (window , pos );
274
+ Integer id = syncedWindows .inverse ().get (window );
275
+ if (id != null ) {
276
+ this .lastSyncedWindowPos .put (id , pos );
277
+ } else {
278
+ this .lastWindowPos .put (window , pos );
279
+ }
274
280
}
275
281
}
276
282
@@ -279,6 +285,12 @@ public boolean tryApplyStoredPos(ModularWindow window) {
279
285
if (this .lastWindowPos .containsKey (window )) {
280
286
window .setPos (this .lastWindowPos .get (window ));
281
287
return true ;
288
+ } else {
289
+ Integer id = syncedWindows .inverse ().get (window );
290
+ if (id != null && this .lastSyncedWindowPos .containsKey (id )) {
291
+ window .setPos (this .lastSyncedWindowPos .get (id ));
292
+ return true ;
293
+ }
282
294
}
283
295
return false ;
284
296
}
0 commit comments