Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
Merge pull request #222 from ChrisEberleSchool/settingsPanel-multiple…
Browse files Browse the repository at this point in the history
…Instances-fix-develop

Settings panel multiple instances fix develop
  • Loading branch information
xspanger3770 authored Feb 3, 2024
2 parents 3f1fda0 + 269bdc5 commit 09a3a51
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,19 @@ public static void main(String[] args) throws Exception{
});
}

public SettingsFrame(Component parent, boolean isClient) {
this.isClient = isClient;
initialize(parent);
}
// settings panel instance tracker
private static SettingsFrame openInstance = null;

public SettingsFrame(Component parent, boolean isClient) {
this.isClient = isClient;
// Check if an instance is already open, if so, return before creating a new instance
if (openInstance != null && openInstance.isVisible()) {
openInstance.toFront();
return;
}
openInstance = this;
initialize(parent);
}

private void initialize(Component parent) {
setTitle(!isClient ? "GlobalQuake Settings" : "GlobalQuake Settings (Client)");
Expand Down

0 comments on commit 09a3a51

Please sign in to comment.