Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3833- Increased width of round counter label - added additional light details to getInfo #3835

Merged
merged 4 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ private JsonObject getMapInfo() throws ParserException {

String visionType = zone.getVisionType().name();
minfo.addProperty("vision type", visionType);
minfo.addProperty("vision distance", zone.getTokenVisionDistance());

JsonObject ginfo = new JsonObject();

Expand Down Expand Up @@ -326,6 +327,9 @@ private JsonObject getCampaignInfo() throws ParserException {
linfo.addProperty("name", ls.getName());
linfo.addProperty("max range", ls.getMaxRange());
linfo.addProperty("type", ls.getType().toString());
linfo.addProperty("shape", ls.getShapeType().toString());
linfo.addProperty("lumens", ls.getLumens());
linfo.addProperty("scale", ls.isScaleWithToken());
// List<Light> lights = new ArrayList<Light>();
// for (Light light : ls.getLightList()) {
// lights.add(light);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
package net.rptools.maptool.client.ui.theme;

import com.formdev.flatlaf.FlatIconColors;
import com.formdev.flatlaf.IntelliJTheme;
import com.formdev.flatlaf.IntelliJTheme.ThemeLaf;
import com.formdev.flatlaf.FlatLaf;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.jidesoft.plaf.LookAndFeelFactory;
Expand All @@ -34,6 +33,10 @@
import javax.swing.UnsupportedLookAndFeelException;
import net.rptools.maptool.client.AppConstants;
import net.rptools.maptool.client.MapTool;
import net.rptools.maptool.client.ui.themes.AahLAF;
import net.rptools.maptool.client.ui.themes.AahLAF_LP;
import net.rptools.maptool.client.ui.themes.AahLAF_SP;
import net.rptools.maptool.client.ui.themes.AahLAF_VLP;
import net.rptools.maptool.events.MapToolEventBus;

/** Class used to implement Theme support for MapTool. */
Expand Down Expand Up @@ -96,7 +99,6 @@ public enum ThemeColor {
this.lightIconColor = lightIconColor;
this.darkIconColor = darkIconColor;
}
;

String getPropertyName() {
return propertyName;
Expand Down Expand Up @@ -135,10 +137,7 @@ public static void setUseThemeColorsForChat(boolean useThemeColorsForChat) {
* @param imagePath the path to an example image of the theme
*/
public record ThemeDetails(
String name,
Class<? extends IntelliJTheme.ThemeLaf> themeClass,
String imagePath,
boolean dark) {}
String name, Class<? extends FlatLaf> themeClass, String imagePath, boolean dark) {}

/** The list of themes that are available. */
public static final ThemeDetails[] THEMES =
Expand Down Expand Up @@ -475,6 +474,10 @@ public record ThemeDetails(
com.formdev.flatlaf.intellijthemes.FlatXcodeDarkIJTheme.class,
"Xcode-Dark.png",
true),
new ThemeDetails("Aah", AahLAF.class, "Aah.png", false),
new ThemeDetails("Aah(Large Print)", AahLAF_LP.class, "Aah-LP.png", false),
new ThemeDetails("Aah(Small Print)", AahLAF_SP.class, "Aah-SP.png", false),
new ThemeDetails("Aah(Very Large Print)", AahLAF_VLP.class, "Aah-VLP.png", false),
};

/** The current theme being used. */
Expand All @@ -484,7 +487,7 @@ public record ThemeDetails(
private static ThemeDetails pendingThemeDetails = currentThemeDetails;

/** The current look and feel in use. */
private static IntelliJTheme.ThemeLaf currentLaf;
private static FlatLaf currentLaf;

/** Should the chat window use the colors from the theme. */
private static boolean useThemeColorsForChat = false;
Expand Down Expand Up @@ -533,7 +536,7 @@ public static void loadTheme()
*
* @param laf the look and feel to use.
*/
private static void setLaf(ThemeLaf laf) {
private static void setLaf(FlatLaf laf) {
currentLaf = laf;
}

Expand Down
34 changes: 34 additions & 0 deletions src/main/java/net/rptools/maptool/client/ui/themes/AahLAF.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* This software Copyright by the RPTools.net development team, and
* licensed under the Affero GPL Version 3 or, at your option, any later
* version.
*
* MapTool Source Code is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public
* License * along with this source Code. If not, please visit
* <http://www.gnu.org/licenses/> and specifically the Affero license
* text at <http://www.gnu.org/licenses/agpl.html>.
*/
package net.rptools.maptool.client.ui.themes;

import com.formdev.flatlaf.FlatLightLaf;

public class AahLAF extends FlatLightLaf {
public static final String NAME = "Aah";

public static boolean setup() {
return setup(new AahLAF());
}

public static void installLafInfo() {
installLafInfo(NAME, AahLAF.class);
}

@Override
public String getName() {
return NAME;
}
}
32 changes: 32 additions & 0 deletions src/main/java/net/rptools/maptool/client/ui/themes/AahLAF_LP.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* This software Copyright by the RPTools.net development team, and
* licensed under the Affero GPL Version 3 or, at your option, any later
* version.
*
* MapTool Source Code is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public
* License * along with this source Code. If not, please visit
* <http://www.gnu.org/licenses/> and specifically the Affero license
* text at <http://www.gnu.org/licenses/agpl.html>.
*/
package net.rptools.maptool.client.ui.themes;

public class AahLAF_LP extends AahLAF {
public static final String NAME = "Aah(Large Print)";

public static boolean setup() {
return setup(new AahLAF_LP());
}

public static void installLafInfo() {
installLafInfo(NAME, AahLAF_LP.class);
}

@Override
public String getName() {
return NAME;
}
}
32 changes: 32 additions & 0 deletions src/main/java/net/rptools/maptool/client/ui/themes/AahLAF_SP.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* This software Copyright by the RPTools.net development team, and
* licensed under the Affero GPL Version 3 or, at your option, any later
* version.
*
* MapTool Source Code is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public
* License * along with this source Code. If not, please visit
* <http://www.gnu.org/licenses/> and specifically the Affero license
* text at <http://www.gnu.org/licenses/agpl.html>.
*/
package net.rptools.maptool.client.ui.themes;

public class AahLAF_SP extends AahLAF {
public static final String NAME = "Aah(Small Print)";

public static boolean setup() {
return setup(new AahLAF_SP());
}

public static void installLafInfo() {
installLafInfo(NAME, AahLAF_SP.class);
}

@Override
public String getName() {
return NAME;
}
}
32 changes: 32 additions & 0 deletions src/main/java/net/rptools/maptool/client/ui/themes/AahLAF_VLP.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* This software Copyright by the RPTools.net development team, and
* licensed under the Affero GPL Version 3 or, at your option, any later
* version.
*
* MapTool Source Code is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public
* License * along with this source Code. If not, please visit
* <http://www.gnu.org/licenses/> and specifically the Affero license
* text at <http://www.gnu.org/licenses/agpl.html>.
*/
package net.rptools.maptool.client.ui.themes;

public class AahLAF_VLP extends AahLAF {
public static final String NAME = "Aah(Very Large Print)";

public static boolean setup() {
return setup(new AahLAF_VLP());
}

public static void installLafInfo() {
installLafInfo(NAME, AahLAF_VLP.class);
}

@Override
public String getName() {
return NAME;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public InitiativePanel() {
toolBar.add(Box.createHorizontalStrut(8));

// ensure that the preferred width is enough to show the round counter in fullscreen
round.setText(I18N.getText("initPanel.round") + " 99");
round.setText(I18N.getText("initPanel.round") + "WWW");
round.setPreferredSize(round.getMinimumSize());
round.setText("");

Expand Down
Loading