refactor module to map-editor, add gdx particle editor
@@ -7,41 +7,21 @@
|
|||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>forge-adventure</artifactId>
|
<artifactId>adventure-editor</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>Forge Adventure</name>
|
<name>Map Editor</name>
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>4thline-repo</id>
|
|
||||||
<url>http://4thline.org/m2</url>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>false</enabled>
|
|
||||||
</snapshots>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>jitpack.io</id>
|
|
||||||
<url>https://jitpack.io</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>src/main/java</sourceDirectory>
|
<sourceDirectory>src/main/java</sourceDirectory>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
<directory>${project.basedir}</directory>
|
<directory>${project.basedir}</directory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>**/*.vert</include>
|
<include>**/gear.gif</include>
|
||||||
<include>**/*.frag</include>
|
|
||||||
<include>**/title_bg_lq.png</include>
|
|
||||||
<include>**/title_bg_lq_portrait.png</include>
|
|
||||||
<include>**/transition.png</include>
|
|
||||||
<include>**/adv_bg_texture.jpg</include>
|
|
||||||
<include>**/adv_bg_splash.png</include>
|
|
||||||
<include>**/bg_splash.png</include>
|
|
||||||
<include>**/bg_texture.jpg</include>
|
|
||||||
<include>**/font1.ttf</include>
|
|
||||||
</includes>
|
</includes>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
|
<finalName>adventure-editor</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
@@ -64,7 +44,7 @@
|
|||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<basedir>${basedir}/${configSourceDirectory}</basedir>
|
<basedir>${basedir}/${configSourceDirectory}</basedir>
|
||||||
<filesToInclude>forge-adventure-editor.sh, forge-adventure-editor-mac.sh, forge-adventure-editor.command, forge-adventure-editor.cmd</filesToInclude>
|
<filesToInclude>adventure-editor.sh, adventure-editor.command, adventure-editor.cmd</filesToInclude>
|
||||||
<outputBasedir>${project.build.directory}</outputBasedir>
|
<outputBasedir>${project.build.directory}</outputBasedir>
|
||||||
<outputDir>.</outputDir>
|
<outputDir>.</outputDir>
|
||||||
<regex>false</regex>
|
<regex>false</regex>
|
||||||
@@ -89,6 +69,9 @@
|
|||||||
<mainClass>forge.adventure.Main</mainClass>
|
<mainClass>forge.adventure.Main</mainClass>
|
||||||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
<manifestEntries>
|
||||||
|
<SplashScreen-Image>splash/gear.gif</SplashScreen-Image>
|
||||||
|
</manifestEntries>
|
||||||
</archive>
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
@@ -106,56 +89,6 @@
|
|||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
|
||||||
<artifactId>gdx</artifactId>
|
|
||||||
<version>1.13.0</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
|
||||||
<artifactId>gdx-platform</artifactId>
|
|
||||||
<version>1.13.0</version>
|
|
||||||
<classifier>natives-desktop</classifier>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
|
||||||
<artifactId>gdx-freetype</artifactId>
|
|
||||||
<version>1.13.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
|
||||||
<artifactId>gdx-backend-lwjgl</artifactId>
|
|
||||||
<version>1.13.0</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
|
||||||
<artifactId>gdx-tools</artifactId>
|
|
||||||
<version>1.13.0</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
|
||||||
<artifactId>gdx-freetype-platform</artifactId>
|
|
||||||
<version>1.13.0</version>
|
|
||||||
<classifier>natives-desktop</classifier>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>forge</groupId>
|
|
||||||
<artifactId>forge-core</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>forge</groupId>
|
|
||||||
<artifactId>forge-gui</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>forge</groupId>
|
|
||||||
<artifactId>forge-gui-mobile</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jetbrains</groupId>
|
<groupId>org.jetbrains</groupId>
|
||||||
<artifactId>annotations</artifactId>
|
<artifactId>annotations</artifactId>
|
||||||
@@ -163,21 +96,22 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.badlogicgames.gdx-controllers</groupId>
|
<groupId>forge</groupId>
|
||||||
<artifactId>gdx-controllers-desktop</artifactId>
|
<artifactId>forge-gui</artifactId>
|
||||||
<version>2.2.3</version>
|
<version>2.0.00-SNAPSHOT</version>
|
||||||
<exclusions>
|
<scope>compile</scope>
|
||||||
<exclusion>
|
</dependency>
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
<dependency>
|
||||||
<artifactId>gdx</artifactId>
|
<groupId>forge</groupId>
|
||||||
</exclusion>
|
<artifactId>forge-gui-mobile</artifactId>
|
||||||
</exclusions>
|
<version>2.0.00-SNAPSHOT</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
BIN
adventure-editor/splash/gear.gif
Normal file
|
After Width: | Height: | Size: 414 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 222 KiB After Width: | Height: | Size: 222 KiB |
@@ -16,7 +16,6 @@ public class Main {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
GuiBase.setInterface(new GuiMobile(Files.exists(Paths.get("./res"))?"./":"../forge-gui/"));
|
GuiBase.setInterface(new GuiMobile(Files.exists(Paths.get("./res"))?"./":"../forge-gui/"));
|
||||||
GuiBase.setDeviceInfo("", "", 0, 0);
|
GuiBase.setDeviceInfo("", "", 0, 0);
|
||||||
Config.instance();
|
new EditorMainWindow(Config.instance());
|
||||||
new EditorMainWindow();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package forge.adventure.editor;
|
||||||
|
|
||||||
|
import forge.adventure.util.Config;
|
||||||
|
|
||||||
|
import javax.swing.JButton;
|
||||||
|
import javax.swing.JDialog;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.JTabbedPane;
|
||||||
|
import javax.swing.JToolBar;
|
||||||
|
import javax.swing.UIManager;
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Desktop;
|
||||||
|
import java.awt.EventQueue;
|
||||||
|
import java.awt.event.WindowAdapter;
|
||||||
|
import java.awt.event.WindowEvent;
|
||||||
|
import java.io.File;
|
||||||
|
import java.security.CodeSource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Editor class to edit configuration, maybe moved or removed
|
||||||
|
*/
|
||||||
|
public class EditorMainWindow extends JFrame {
|
||||||
|
public final static WorldEditor worldEditor = new WorldEditor();
|
||||||
|
JTabbedPane tabs = new JTabbedPane();
|
||||||
|
|
||||||
|
public EditorMainWindow(Config config) {
|
||||||
|
UIManager.LookAndFeelInfo[] var1 = UIManager.getInstalledLookAndFeels();
|
||||||
|
|
||||||
|
for (UIManager.LookAndFeelInfo info : var1) {
|
||||||
|
if ("Nimbus".equals(info.getName())) {
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel(info.getClassName());
|
||||||
|
} catch (Throwable ignored) {
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||||
|
this.addWindowListener(new WindowAdapter() {
|
||||||
|
@Override
|
||||||
|
public void windowClosing(WindowEvent e) {
|
||||||
|
setVisible(false);
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
BorderLayout layout = new BorderLayout();
|
||||||
|
JToolBar toolBar = new JToolBar("toolbar");
|
||||||
|
JButton newButton = new JButton("GDX Particle Editor Tool");
|
||||||
|
newButton.addActionListener(e -> EventQueue.invokeLater(() -> {
|
||||||
|
newButton.setEnabled(false);
|
||||||
|
try {
|
||||||
|
CodeSource codeSource = EditorMainWindow.class.getProtectionDomain().getCodeSource();
|
||||||
|
File jarFile = new File(codeSource.getLocation().toURI().getPath());
|
||||||
|
String jarDir = jarFile.getParentFile().getPath();
|
||||||
|
Desktop.getDesktop().open(new File(jarDir + "/gdx-particle-editor.jar"));
|
||||||
|
} catch (Exception ex) {
|
||||||
|
new ErrorDialog("Error", ex.getMessage());
|
||||||
|
newButton.setEnabled(true);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
JButton quit = new JButton("Quit");
|
||||||
|
quit.addActionListener(e -> System.exit(0));
|
||||||
|
toolBar.add(newButton);
|
||||||
|
toolBar.add(quit);
|
||||||
|
setLayout(layout);
|
||||||
|
toolBar.setFloatable(false);
|
||||||
|
add(toolBar, BorderLayout.NORTH);
|
||||||
|
add(tabs, BorderLayout.CENTER);
|
||||||
|
tabs.addTab("World", worldEditor);
|
||||||
|
tabs.addTab("POI", new PointOfInterestEditor());
|
||||||
|
tabs.addTab("Items", new ItemsEditor());
|
||||||
|
tabs.addTab("Enemies", new EnemyEditor());
|
||||||
|
tabs.addTab("Quests", new QuestEditor());
|
||||||
|
setSize(config.getSettingData().width, config.getSettingData().height);
|
||||||
|
setLocationRelativeTo(null);
|
||||||
|
setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
static class ErrorDialog {
|
||||||
|
public ErrorDialog(String title, String message) {
|
||||||
|
List<Object> options = new ArrayList<>();
|
||||||
|
JButton ok = new JButton("OK");
|
||||||
|
options.add(ok);
|
||||||
|
JOptionPane pane = new JOptionPane(message, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, options.toArray());
|
||||||
|
JDialog dlg = pane.createDialog(JOptionPane.getRootFrame(), title);
|
||||||
|
ok.addActionListener(e -> {
|
||||||
|
dlg.setVisible(false);
|
||||||
|
System.exit(0);
|
||||||
|
});
|
||||||
|
dlg.setResizable(false);
|
||||||
|
dlg.setVisible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
adventure-editor/tools/gdx-particle-editor.jar
Normal file
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 364 KiB |
|
Before Width: | Height: | Size: 300 KiB |
|
Before Width: | Height: | Size: 11 KiB |
@@ -1,16 +0,0 @@
|
|||||||
#ifdef GL_ES
|
|
||||||
precision mediump float;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
varying vec4 v_color;
|
|
||||||
varying vec2 v_texCoords;
|
|
||||||
uniform sampler2D u_texture;
|
|
||||||
uniform float u_grayness;
|
|
||||||
uniform float u_bias;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
vec4 c = v_color * texture2D(u_texture, v_texCoords);
|
|
||||||
float grey = dot( c.rgb, vec3(0.22, 0.707, 0.071) );
|
|
||||||
vec3 blendedColor = mix(c.rgb, vec3(grey), u_grayness);
|
|
||||||
gl_FragColor = mix(vec4(0.0, 0.0, 0.0, 1.0), vec4(blendedColor.rgb, c.a), u_bias);
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
attribute vec4 a_position;
|
|
||||||
attribute vec4 a_color;
|
|
||||||
attribute vec2 a_texCoord0;
|
|
||||||
|
|
||||||
uniform mat4 u_projTrans;
|
|
||||||
|
|
||||||
varying vec4 v_color;
|
|
||||||
varying vec2 v_texCoords;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
v_color = a_color;
|
|
||||||
v_texCoords = a_texCoord0;
|
|
||||||
gl_Position = u_projTrans * a_position;
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
#ifdef GL_ES
|
|
||||||
precision mediump float;
|
|
||||||
precision mediump int;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uniform sampler2D u_texture;
|
|
||||||
uniform vec2 u_viewportInverse;
|
|
||||||
uniform vec3 u_color;
|
|
||||||
uniform float u_offset;
|
|
||||||
uniform float u_step;
|
|
||||||
|
|
||||||
varying vec4 v_color;
|
|
||||||
varying vec2 v_texCoord;
|
|
||||||
|
|
||||||
#define ALPHA_VALUE_BORDER 0.5
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
vec2 T = v_texCoord.xy;
|
|
||||||
|
|
||||||
float alpha = 0.0;
|
|
||||||
bool allin = true;
|
|
||||||
for( float ix = -u_offset; ix < u_offset; ix += u_step )
|
|
||||||
{
|
|
||||||
for( float iy = -u_offset; iy < u_offset; iy += u_step )
|
|
||||||
{
|
|
||||||
float newAlpha = texture2D(u_texture, T + vec2(ix, iy) * u_viewportInverse).a;
|
|
||||||
allin = allin && newAlpha > ALPHA_VALUE_BORDER;
|
|
||||||
if (newAlpha > ALPHA_VALUE_BORDER && newAlpha >= alpha)
|
|
||||||
{
|
|
||||||
alpha = newAlpha;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (allin)
|
|
||||||
{
|
|
||||||
alpha = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
gl_FragColor = vec4(u_color,alpha);
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
uniform mat4 u_projTrans;
|
|
||||||
|
|
||||||
attribute vec4 a_position;
|
|
||||||
attribute vec2 a_texCoord0;
|
|
||||||
attribute vec4 a_color;
|
|
||||||
|
|
||||||
varying vec4 v_color;
|
|
||||||
varying vec2 v_texCoord;
|
|
||||||
|
|
||||||
uniform vec2 u_viewportInverse;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
gl_Position = u_projTrans * a_position;
|
|
||||||
v_texCoord = a_texCoord0;
|
|
||||||
v_color = a_color;
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#ifdef GL_ES
|
|
||||||
#define PRECISION mediump
|
|
||||||
precision PRECISION float;
|
|
||||||
precision PRECISION int;
|
|
||||||
#else
|
|
||||||
#define PRECISION
|
|
||||||
#endif
|
|
||||||
|
|
||||||
varying vec2 v_texCoords;
|
|
||||||
uniform sampler2D u_texture;
|
|
||||||
uniform float u_amount;
|
|
||||||
uniform float u_speed;
|
|
||||||
uniform float u_time;
|
|
||||||
uniform float u_bias;
|
|
||||||
|
|
||||||
void main () {
|
|
||||||
vec2 uv = v_texCoords;
|
|
||||||
|
|
||||||
uv.y += (cos((uv.y + (u_time * 0.04 * u_speed)) * 45.0) * 0.0019 * u_amount) + (cos((uv.y + (u_time * 0.1 * u_speed)) * 10.0) * 0.002 * u_amount);
|
|
||||||
|
|
||||||
uv.x += (sin((uv.y + (u_time * 0.07 * u_speed)) * 15.0) * 0.0029 * u_amount) + (sin((uv.y + (u_time * 0.1 * u_speed)) * 15.0) * 0.002 * u_amount);
|
|
||||||
|
|
||||||
vec4 texColor = texture2D(u_texture, uv);
|
|
||||||
|
|
||||||
gl_FragColor = mix(vec4(0.0, 0.0, 0.0, 1.0), texColor, u_bias);
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
#ifdef GL_ES
|
|
||||||
precision mediump float;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
varying vec2 v_texCoords;
|
|
||||||
uniform sampler2D u_texture;
|
|
||||||
|
|
||||||
uniform float u_time;
|
|
||||||
uniform float u_speed;
|
|
||||||
uniform float u_amount;
|
|
||||||
uniform vec2 u_viewport;
|
|
||||||
uniform vec2 u_position;
|
|
||||||
|
|
||||||
float random2d(vec2 n) {
|
|
||||||
return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);
|
|
||||||
}
|
|
||||||
|
|
||||||
float randomRange (in vec2 seed, in float min, in float max) {
|
|
||||||
return min + random2d(seed) * (max - min);
|
|
||||||
}
|
|
||||||
|
|
||||||
float insideRange(float v, float bottom, float top) {
|
|
||||||
return step(bottom, v) - step(top, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
float time = floor(u_time * u_speed * 60.0);
|
|
||||||
|
|
||||||
vec3 outCol = texture2D(u_texture, v_texCoords).rgb;
|
|
||||||
|
|
||||||
float maxOffset = u_amount/2.0;
|
|
||||||
for (float i = 0.0; i < 2.0; i += 1.0) {
|
|
||||||
float sliceY = random2d(vec2(time, 2345.0 + float(i)));
|
|
||||||
float sliceH = random2d(vec2(time, 9035.0 + float(i))) * 0.25;
|
|
||||||
float hOffset = randomRange(vec2(time, 9625.0 + float(i)), -maxOffset, maxOffset);
|
|
||||||
vec2 uvOff = v_texCoords;
|
|
||||||
uvOff.x += hOffset;
|
|
||||||
if (insideRange(v_texCoords.y, sliceY, fract(sliceY+sliceH)) == 1.0){
|
|
||||||
outCol = texture2D(u_texture, uvOff).rgb;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float maxColOffset = u_amount / 6.0;
|
|
||||||
float rnd = random2d(vec2(time , 9545.0));
|
|
||||||
vec2 colOffset = vec2(randomRange(vec2(time , 9545.0), -maxColOffset, maxColOffset),
|
|
||||||
randomRange(vec2(time , 7205.0), -maxColOffset, maxColOffset));
|
|
||||||
if (rnd < 0.33) {
|
|
||||||
outCol.r = texture2D(u_texture, v_texCoords + colOffset).r;
|
|
||||||
} else if (rnd < 0.66) {
|
|
||||||
outCol.g = texture2D(u_texture, v_texCoords + colOffset).g;
|
|
||||||
} else {
|
|
||||||
outCol.b = texture2D(u_texture, v_texCoords + colOffset).b;
|
|
||||||
}
|
|
||||||
|
|
||||||
gl_FragColor = vec4(outCol, 1.0);
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
cd $(dirname "${0}")
|
|
||||||
java -XstartOnFirstThread -Xmx4096m -Dfile.encoding=UTF-8 -jar $project.build.finalName$
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
package forge.adventure.editor;
|
|
||||||
|
|
||||||
import forge.localinstance.properties.ForgeConstants;
|
|
||||||
import forge.localinstance.properties.ForgePreferences;
|
|
||||||
import forge.model.FModel;
|
|
||||||
import forge.util.Lang;
|
|
||||||
import forge.util.Localizer;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Editor class to edit configuration, maybe moved or removed
|
|
||||||
*/
|
|
||||||
public class EditorMainWindow extends JFrame {
|
|
||||||
public final static WorldEditor worldEditor = new WorldEditor();
|
|
||||||
JTabbedPane tabs =new JTabbedPane();
|
|
||||||
|
|
||||||
public EditorMainWindow()
|
|
||||||
{
|
|
||||||
UIManager.LookAndFeelInfo[] var1 = UIManager.getInstalledLookAndFeels();
|
|
||||||
FModel.initialize(null, preferences -> {
|
|
||||||
preferences.setPref(ForgePreferences.FPref.LOAD_CARD_SCRIPTS_LAZILY, true);
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
Lang.createInstance(FModel.getPreferences().getPref(ForgePreferences.FPref.UI_LANGUAGE));
|
|
||||||
Localizer.getInstance().initialize(FModel.getPreferences().getPref(ForgePreferences.FPref.UI_LANGUAGE), ForgeConstants.LANG_DIR);
|
|
||||||
int var2 = var1.length;
|
|
||||||
|
|
||||||
for (UIManager.LookAndFeelInfo info : var1) {
|
|
||||||
if ("Nimbus".equals(info.getName())) {
|
|
||||||
try {
|
|
||||||
UIManager.setLookAndFeel(info.getClassName());
|
|
||||||
} catch (Throwable var6) {
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BorderLayout layout=new BorderLayout();
|
|
||||||
JToolBar toolBar = new JToolBar("toolbar");
|
|
||||||
// refer to removal of Swing Particle Editor: https://github.com/libgdx/libgdx/issues/7285
|
|
||||||
//todo add New Particle Editor here (needs Java 11+): https://github.com/libgdx/gdx-particle-editor
|
|
||||||
//JButton newButton=new JButton("open ParticleEditor");
|
|
||||||
//newButton.addActionListener(e -> EventQueue.invokeLater(ParticleEditor::new));
|
|
||||||
JButton quit = new JButton("Quit");
|
|
||||||
quit.addActionListener(e-> System.exit(0));
|
|
||||||
//toolBar.add(newButton);
|
|
||||||
toolBar.add(quit);
|
|
||||||
setLayout(layout);
|
|
||||||
toolBar.setFloatable(false);
|
|
||||||
add(toolBar, BorderLayout.NORTH);
|
|
||||||
add(tabs, BorderLayout.CENTER);
|
|
||||||
tabs.addTab("World",worldEditor);
|
|
||||||
tabs.addTab("POI",new PointOfInterestEditor());
|
|
||||||
tabs.addTab("Items",new ItemsEditor());
|
|
||||||
tabs.addTab("Enemies",new EnemyEditor());
|
|
||||||
tabs.addTab("Quests",new QuestEditor());
|
|
||||||
|
|
||||||
setVisible(true);
|
|
||||||
setSize(800,600);
|
|
||||||
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow( this );
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -616,12 +616,12 @@
|
|||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${project.build.directory}" includes="forge.exe" />
|
<fileset dir="${project.build.directory}" includes="forge.exe" />
|
||||||
<fileset dir="${project.build.directory}" includes="${project.build.finalName}-jar-with-dependencies.jar" />
|
<fileset dir="${project.build.directory}" includes="${project.build.finalName}-jar-with-dependencies.jar" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-editor.exe" />
|
<fileset dir="${project.build.directory}/../../adventure-editor/tools" includes="gdx-particle-editor.jar" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-editor.sh" />
|
<fileset dir="${project.build.directory}/../../adventure-editor/target" includes="adventure-editor.exe" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-editor-mac.sh" />
|
<fileset dir="${project.build.directory}/../../adventure-editor/target" includes="adventure-editor.sh" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-editor.command" />
|
<fileset dir="${project.build.directory}/../../adventure-editor/target" includes="adventure-editor.command" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-editor.cmd" />
|
<fileset dir="${project.build.directory}/../../adventure-editor/target" includes="adventure-editor.cmd" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-adventure/target" includes="forge-adventure-${project.version}-jar-with-dependencies.jar" />
|
<fileset dir="${project.build.directory}/../../adventure-editor/target" includes="adventure-editor-jar-with-dependencies.jar" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.exe" />
|
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.exe" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.sh" />
|
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure.sh" />
|
||||||
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure-mac.sh" />
|
<fileset dir="${project.build.directory}/../../forge-gui-mobile-dev/target" includes="forge-adventure-mac.sh" />
|
||||||
@@ -639,10 +639,9 @@
|
|||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-mac.sh" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-mac.sh" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.command" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.command" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.cmd" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.cmd" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-editor.sh" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/adventure-editor.sh" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-editor-mac.sh" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/adventure-editor.command" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-editor.command" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/adventure-editor.cmd" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-editor.cmd" perm="a+rx" />
|
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge.exe" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge.exe" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.exe" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure.exe" perm="a+rx" />
|
||||||
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-editor.exe" perm="a+rx" />
|
<chmod file="${project.build.directory}/${project.build.finalName}/forge-adventure-editor.exe" perm="a+rx" />
|
||||||
@@ -657,12 +656,12 @@
|
|||||||
<include name="forge-adventure.command" />
|
<include name="forge-adventure.command" />
|
||||||
<include name="forge-adventure.cmd" />
|
<include name="forge-adventure.cmd" />
|
||||||
<include name="forge-adventure.exe" />
|
<include name="forge-adventure.exe" />
|
||||||
<include name="forge-adventure-editor.sh" />
|
<include name="adventure-editor.sh" />
|
||||||
<include name="forge-adventure-editor.command" />
|
<include name="adventure-editor.command" />
|
||||||
<include name="forge-adventure-editor.cmd" />
|
<include name="adventure-editor.cmd" />
|
||||||
<include name="forge-adventure-editor.exe" />
|
<include name="adventure-editor.exe" />
|
||||||
</tarfileset>
|
</zipfileset>
|
||||||
<tarfileset dir="${project.build.directory}/${project.build.finalName}">
|
<zipfileset dir="${project.build.directory}/${project.build.finalName}">
|
||||||
<include name="**" />
|
<include name="**" />
|
||||||
<exclude name="forge.sh" />
|
<exclude name="forge.sh" />
|
||||||
<exclude name="forge.command" />
|
<exclude name="forge.command" />
|
||||||
@@ -672,12 +671,12 @@
|
|||||||
<exclude name="forge-adventure.command" />
|
<exclude name="forge-adventure.command" />
|
||||||
<exclude name="forge-adventure.cmd" />
|
<exclude name="forge-adventure.cmd" />
|
||||||
<exclude name="forge-adventure.exe" />
|
<exclude name="forge-adventure.exe" />
|
||||||
<exclude name="forge-adventure-editor.sh" />
|
<exclude name="adventure-editor.sh" />
|
||||||
<exclude name="forge-adventure-editor.command" />
|
<exclude name="adventure-editor.command" />
|
||||||
<exclude name="forge-adventure-editor.cmd" />
|
<exclude name="adventure-editor.cmd" />
|
||||||
<exclude name="forge-adventure-editor.exe" />
|
<exclude name="adventure-editor.exe" />
|
||||||
</tarfileset>
|
</zipfileset>
|
||||||
</tar>
|
</zip>
|
||||||
</target>
|
</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
<goals>
|
<goals>
|
||||||
|
|||||||
2
pom.xml
@@ -70,8 +70,8 @@
|
|||||||
<module>forge-gui-mobile-dev</module>
|
<module>forge-gui-mobile-dev</module>
|
||||||
<module>forge-gui-desktop</module>
|
<module>forge-gui-desktop</module>
|
||||||
<module>forge-gui-ios</module>
|
<module>forge-gui-ios</module>
|
||||||
<module>forge-adventure</module>
|
|
||||||
<module>forge-lda</module>
|
<module>forge-lda</module>
|
||||||
|
<module>adventure-editor</module>
|
||||||
<module>forge-gui-android</module>
|
<module>forge-gui-android</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|||||||