Close window on script stop

This commit is contained in:
RedSparr0w
2019-10-14 21:36:06 +13:00
parent af836edf20
commit 11d980b408
2 changed files with 2 additions and 23 deletions
-21
View File
@@ -3,28 +3,7 @@
<component name="ChangeListManager">
<list default="true" id="3ab8e8a0-ccfd-4b0b-9547-98173085dc38" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ParaScript.iml" beforeDir="false" afterPath="$PROJECT_DIR$/ParaScript.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/Main.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/data/Variables.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/data/Variables.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/ui/UI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/ui/UI.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/data/Variables.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/data/variables/Ores.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/data/variables/Trees.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/data/variables/Zone.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/strategies/Bank.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/strategies/HandleLogin$1.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/strategies/HandleLogin.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/strategies/MakeArrowShafts.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/strategies/Mine.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/strategies/ScriptState.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/strategies/Thieving.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/strategies/Walk.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/strategies/WoodcutTree.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/ui/UI$1.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/ui/UI$2.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/ui/UI$3.class" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ParaScript/ui/UI.class" beforeDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
+2 -2
View File
@@ -19,11 +19,10 @@ import java.util.ArrayList;
public class Main extends Script implements MessageListener, Paintable {
private final ArrayList<Strategy> strategies = new ArrayList<Strategy>();
private UI ui = new UI();
@Override
public boolean onExecute() {
UI ui = new UI();
ui.setVisible(true);
while (!Variables.running) {
Time.sleep(300);
@@ -50,6 +49,7 @@ public class Main extends Script implements MessageListener, Paintable {
@Override
public void onFinish() {
ui.dispose();
System.out.println("Script Stopped");
}