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

MTScript Drawing functions #5158

Merged
merged 45 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5e5c628
Function to get parameter as JSON Object, converting from StrProp if …
bubblobill Jan 28, 2025
844d924
Initial implementation of MTScript functions;
bubblobill Jan 28, 2025
c45a019
New macro error strings
bubblobill Jan 28, 2025
15f5f2f
Spotless
bubblobill Jan 28, 2025
58e31c0
Icons for drawing types
bubblobill Jan 31, 2025
ac10426
Icons for drawing types
bubblobill Jan 31, 2025
f702a30
Just a copy of ExtendedGeneralPath that deals in doubles instead of f…
bubblobill Jan 31, 2025
330905d
Added toString that produces StrProp of fields
bubblobill Jan 31, 2025
76ba3eb
Added Drawing shapes;
bubblobill Jan 31, 2025
bf31593
Text for draw explorer
bubblobill Jan 31, 2025
a65c211
Explicit permissions to allow campaigns to load with ExtendedGeneralP…
bubblobill Jan 31, 2025
7513402
Edit
bubblobill Jan 31, 2025
14b239c
First run at the ribbon
bubblobill Jan 31, 2025
0228873
Fooking Spotless
bubblobill Jan 31, 2025
6803d73
Seriously complaining because the comment is too long?
bubblobill Jan 31, 2025
92b789c
make up your mind
bubblobill Jan 31, 2025
100eebf
make up your mind
bubblobill Jan 31, 2025
45d3848
make up your mind
bubblobill Jan 31, 2025
8bd4887
make up your mind
bubblobill Jan 31, 2025
8b1d2eb
swapped images
bubblobill Feb 1, 2025
1a0f84c
Added macro error message
bubblobill Feb 1, 2025
b34c9bf
rewrite and add delimiter parameter to paramFromStrPropOrJsonAsJsonOb…
bubblobill Feb 1, 2025
717f499
Rewrite to include spurious delimiter parameters
bubblobill Feb 1, 2025
ed7f58e
Spotless
bubblobill Feb 2, 2025
2985fd9
Spotless
bubblobill Feb 2, 2025
87213b4
Spotless
bubblobill Feb 2, 2025
8105d78
Spotless
bubblobill Feb 2, 2025
4e4558e
Spotless
bubblobill Feb 2, 2025
2be7fcf
Spotless
bubblobill Feb 2, 2025
9f208f1
Spotless
bubblobill Feb 2, 2025
d8b763b
Spotless
bubblobill Feb 2, 2025
dbad878
Spotless
bubblobill Feb 2, 2025
828ecca
Spotless
bubblobill Feb 2, 2025
49c8683
Non GM created shapes are now forced to use the Token Layer.
bubblobill Feb 2, 2025
cec517b
Non GM created shapes are now forced to use the Token Layer.
bubblobill Feb 2, 2025
dea954f
Added warning image
bubblobill Feb 3, 2025
025354d
Added FunctionUtil.experimentalWarning().
bubblobill Feb 3, 2025
9806cd4
message edit
bubblobill Feb 3, 2025
8860ba0
Drawings now propogate to server when drawn.
bubblobill Feb 3, 2025
a985723
Spotless
bubblobill Feb 3, 2025
e459c8f
Spotless
bubblobill Feb 3, 2025
9323f9b
Spotless
bubblobill Feb 3, 2025
de435f8
Spotless
bubblobill Feb 3, 2025
c66af93
Spotless
bubblobill Feb 3, 2025
ab81be9
Spotless
bubblobill Feb 3, 2025
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
29 changes: 8 additions & 21 deletions src/main/java/net/rptools/lib/io/PackedFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,13 @@

import com.google.common.io.CharStreams;
import com.thoughtworks.xstream.XStream;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.StringReader;
import com.thoughtworks.xstream.security.ExplicitTypePermission;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
import java.util.zip.Deflater;
import java.util.zip.ZipEntry;
Expand All @@ -55,6 +37,8 @@
import net.rptools.maptool.model.Asset;
import net.rptools.maptool.model.AssetManager;
import net.rptools.maptool.model.GUID;
import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
import org.apache.batik.ext.awt.geom.Polygon2D;
import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -551,6 +535,9 @@ public Object getFileObject(String path) throws IOException {
try (r) {
xstream
.ignoreUnknownElements(); // Jamz: Should we use this? This will ignore new classes/fields
xstream.addPermission(
new ExplicitTypePermission(new Class[] {ExtendedGeneralPath.class, Polygon2D.class}));

// added.
var obj = xstream.fromXML(r);
return obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import net.rptools.dicelib.expression.ExpressionParser;
import net.rptools.maptool.client.functions.*;
import net.rptools.maptool.client.functions.json.JSONMacroFunctions;
import net.rptools.maptool.client.script.javascript.*;
import net.rptools.maptool.client.script.javascript.JSMacro;
import net.rptools.parser.Expression;
import net.rptools.parser.Parser;
import net.rptools.parser.ParserException;
Expand Down Expand Up @@ -95,6 +95,7 @@ public class MapToolExpressionParser extends ExpressionParser {
DrawingGetterFunctions.getInstance(),
DrawingSetterFunctions.getInstance(),
DrawingMiscFunctions.getInstance(),
ShapeFunctions.getInstance(),
ExportDataFunctions.getInstance(),
RESTfulFunctions.getInstance(),
HeroLabFunctions.getInstance(),
Expand Down
Loading