Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix/3426-restore-multi-range-auras
Browse files Browse the repository at this point in the history
  • Loading branch information
kwvanderlinde authored Apr 12, 2023
2 parents 8c2e368 + abcaefd commit 129a68d
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class TokenPropertyFunctions extends AbstractFunction {
private TokenPropertyFunctions() {
super(
0,
4,
5,
"getPropertyNames",
"getAllPropertyNames",
"getPropertyNamesRaw",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,20 +354,18 @@ private JsonArray childEvaluateGetTokenTopology(
if (token == null) {
throw new ParserException(
I18N.getText(
"macro.function.general.unknownToken",
"getTokenVBL",
parameters.get(0).toString()));
"macro.function.general.unknownToken", functionName, parameters.get(0).toString()));
}
} else if (parameters.size() == 0) {
MapToolVariableResolver res = (MapToolVariableResolver) resolver;
token = res.getTokenInContext();
if (token == null) {
throw new ParserException(
I18N.getText("macro.function.general.noImpersonated", "getTokenVBL"));
I18N.getText("macro.function.general.noImpersonated", functionName));
}
} else {
throw new ParserException(
I18N.getText("macro.function.general.tooManyParam", "getTokenVBL", 1, parameters.size()));
I18N.getText("macro.function.general.tooManyParam", functionName, 1, parameters.size()));
}

JsonArray allShapes = new JsonArray();
Expand Down Expand Up @@ -437,7 +435,7 @@ private int childEvaluateSetTokenTopology(
}
if (token == null) {
throw new ParserException(
I18N.getText("macro.function.general.noImpersonated", "getTokenVBL"));
I18N.getText("macro.function.general.noImpersonated", functionName));
}

Area tokenTopology = new Area();
Expand Down Expand Up @@ -525,9 +523,7 @@ private void childEvaluateTransferTopology(
if (token == null) {
throw new ParserException(
I18N.getText(
"macro.function.general.unknownToken",
"getTokenVBL",
parameters.get(0).toString()));
"macro.function.general.unknownToken", functionName, parameters.get(0).toString()));
}
} else {
MapToolVariableResolver res = (MapToolVariableResolver) resolver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,7 @@ public void showFullScreenTools() {
});

initiativeButton.setBorder(btn.getBorder());
initiativeButton.setToolTipText(I18N.getText("tools.initiative.tooltip"));
fullScreenToolPanel.add(initiativeButton);

// set buttons to uniform size
Expand Down
25 changes: 15 additions & 10 deletions src/main/java/net/rptools/maptool/client/ui/theme/ThemeSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.jidesoft.plaf.LookAndFeelFactory;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.*;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import javax.swing.ImageIcon;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.*;
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;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/** Class used to implement Theme support for MapTool. */
public class ThemeSupport {

private static final Logger log = LogManager.getLogger(ThemeSupport.class);

public enum ThemeColor {
RED(
"ColorPalette.red",
Expand Down Expand Up @@ -643,10 +643,15 @@ public static ImageIcon getExampleImageIcon(String themeName, Dimension dimensio
|| themeDetails.imagePath.isEmpty()) {
return new ImageIcon();
} else {
var imageIcon =
new ImageIcon(
ThemeSupport.class.getResource(IMAGE_PATH + themeDetails.imagePath),
themeDetails.name);
var imageLocation = IMAGE_PATH + themeDetails.imagePath;
log.info("Retrieving resource for theme name={} from location={}", themeName, imageLocation);
var imageURL = ThemeSupport.class.getResource(imageLocation);
if (imageURL == null) {
log.warn(
"Failed to retrieve resource for theme name={} from url={}, using empty ImageIcon");
return new ImageIcon();
}
var imageIcon = new ImageIcon(imageURL, themeDetails.name);
if (dimension != null && dimension.width > 0 && dimension.height > 0) {
imageIcon.setImage(
imageIcon
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/rptools/maptool/model/LightSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public enum Type {

// Lumens are now in the individual Lights. This field is only here for backwards compatibility
// and should not otherwise be used.
@Deprecated private final int lumens = Integer.MIN_VALUE;
@Deprecated private int lumens = Integer.MIN_VALUE;

/**
* Constructs a personal light source.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
import net.rptools.maptool.model.drawing.Drawable;
import net.rptools.maptool.model.drawing.DrawnElement;
import net.rptools.maptool.model.drawing.Pen;
import net.rptools.maptool.model.zones.TokensAdded;
import net.rptools.maptool.model.zones.TokensRemoved;
import net.rptools.maptool.model.zones.ZoneAdded;
import net.rptools.maptool.model.zones.ZoneRemoved;
import net.rptools.maptool.server.proto.*;
import net.rptools.maptool.transfer.AssetProducer;
Expand Down Expand Up @@ -461,8 +463,8 @@ private void handle(PutZoneMsg msg) {
server.getCampaign().putZone(zone);

// Now we have fire off adding the tokens in the zone
new MapToolEventBus().getMainEventBus().post(new TokensRemoved(zone, zone.getTokens()));
new MapToolEventBus().getMainEventBus().post(new ZoneRemoved(zone));
new MapToolEventBus().getMainEventBus().post(new ZoneAdded(zone));
new MapToolEventBus().getMainEventBus().post(new TokensAdded(zone, zone.getTokens()));
}

private void handle(PutLabelMsg msg) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1583,6 +1583,7 @@ initiative.menu.remove = Remove
initiative.menu.resume = Resume
initiative.menu.setState = Set Initiative...


layer.token = Token
layer.gm = Hidden
layer.object = Object
Expand Down Expand Up @@ -2496,6 +2497,7 @@ tools.token.fow.npc.tooltip = Show FoW for NPC Tokens you explicitly own or are
tools.token.fow.pc.tooltip = Show FoW for PC Tokens you explicitly own or are owned by all.
tools.topo.tooltip = Vision Blocking Layer (VBL) Tools
tools.zoneselector.tooltip = Select Map
tools.initiative.tooltip = Initiative Tools

undefinedmacro.unknownCommand = Unknown command: "{0}". Try <b>/help</b> for a list of commands.

Expand Down

0 comments on commit 129a68d

Please sign in to comment.