mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-03 00:37:55 +00:00
Merge branch 'development' into issue-244/clear-cache-on-provider-update
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>org.parabot</groupId>
|
<groupId>org.parabot</groupId>
|
||||||
<artifactId>client</artifactId>
|
<artifactId>client</artifactId>
|
||||||
<version>2.7</version>
|
<version>2.7.1</version>
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.parabot</groupId>
|
<groupId>org.parabot</groupId>
|
||||||
<artifactId>internal-api</artifactId>
|
<artifactId>internal-api</artifactId>
|
||||||
<version>1.52.1</version>
|
<version>1.53.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package org.parabot.core.ui;
|
package org.parabot.core.ui;
|
||||||
|
|
||||||
import javafx.application.Application;
|
|
||||||
import org.parabot.core.Configuration;
|
import org.parabot.core.Configuration;
|
||||||
import org.parabot.core.Context;
|
import org.parabot.core.Context;
|
||||||
import org.parabot.core.Directories;
|
import org.parabot.core.Directories;
|
||||||
@@ -248,7 +247,7 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
|||||||
Directories.clearCache();
|
Directories.clearCache();
|
||||||
break;
|
break;
|
||||||
case "Notifications":
|
case "Notifications":
|
||||||
Application.launch(NotificationUI.class);
|
NotificationUI.create();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
System.out.println("Invalid command: " + command);
|
System.out.println("Invalid command: " + command);
|
||||||
|
|||||||
@@ -1,20 +1,56 @@
|
|||||||
package org.parabot.core.ui.components.notifications;
|
package org.parabot.core.ui.components.notifications;
|
||||||
|
|
||||||
import javafx.application.Application;
|
import org.parabot.api.Configuration;
|
||||||
import javafx.fxml.FXMLLoader;
|
import org.parabot.api.output.Verboser;
|
||||||
import javafx.scene.Scene;
|
import org.parabot.api.ui.JavaFxUtil;
|
||||||
import javafx.scene.layout.BorderPane;
|
|
||||||
import javafx.stage.Stage;
|
|
||||||
import org.parabot.core.Configuration;
|
|
||||||
|
|
||||||
public class NotificationUI extends Application {
|
import java.awt.event.WindowAdapter;
|
||||||
|
import java.awt.event.WindowEvent;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A JavaFX Panel embedded into a Swing JFrame - handles notification settings
|
||||||
|
*
|
||||||
|
* @author Shadowrs
|
||||||
|
*/
|
||||||
|
public class NotificationUI extends JavaFxUtil {
|
||||||
|
|
||||||
|
final NotificationUI n;
|
||||||
|
|
||||||
|
private NotificationUI() throws URISyntaxException, MalformedURLException {
|
||||||
|
super(Configuration.class.getClass().getResource("/storage/ui/notifications.fxml").toURI().toURL(), NotificationUIController.class);
|
||||||
|
this.n = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void create() {
|
||||||
|
try {
|
||||||
|
new NotificationUI();
|
||||||
|
} catch (URISyntaxException | MalformedURLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage stage) throws Exception {
|
public WindowAdapter getWindowAdapter() {
|
||||||
//noinspection RedundantCast
|
return new WindowAdapter() {
|
||||||
BorderPane root = (BorderPane) FXMLLoader.load(this.getClass().getResource("/storage/ui/notifications.fxml"));
|
@Override
|
||||||
stage.setTitle(Configuration.BOT_TITLE);
|
public void windowClosed(WindowEvent e) {
|
||||||
stage.setScene(new Scene(root));
|
Verboser.verbose("NotificationUI closed " + e);
|
||||||
stage.show();
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void windowClosing(WindowEvent e) {
|
||||||
|
// Anything here. JFrame hides on exit.
|
||||||
|
Verboser.verbose("NotificationUI closing " + e);
|
||||||
|
n.getFrame().dispose();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onLaunched() {
|
||||||
|
n.getFrame().setTitle("Notifications");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ public class Environment extends org.parabot.api.io.libraries.Environment {
|
|||||||
loadLibrary(lib, true);
|
loadLibrary(lib, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Core.verbose("Loading server: " + desc.toString() + "...");
|
Core.verbose("[Environment] Loading server: " + desc.toString() + "...");
|
||||||
|
|
||||||
ServerParser.SERVER_CACHE.get(desc).run();
|
ServerParser.SERVER_CACHE.get(desc).run();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
<?import javafx.scene.control.*?>
|
<?import javafx.scene.control.*?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="231.0"
|
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="231.0"
|
||||||
prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1"
|
prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
fx:controller="org.parabot.core.ui.components.notifications.NotificationUIController">
|
|
||||||
<bottom>
|
<bottom>
|
||||||
<Button mnemonicParsing="false" text="Save" BorderPane.alignment="CENTER" onAction="#save">
|
<Button mnemonicParsing="false" text="Save" BorderPane.alignment="CENTER" onAction="#save">
|
||||||
<BorderPane.margin>
|
<BorderPane.margin>
|
||||||
|
|||||||
Reference in New Issue
Block a user