JS console / Scripting tweaks
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
const print = function(obj){
|
const log = function(context, obj){
|
||||||
java.lang.System.out.println(obj ? String(obj) : "null")
|
Vars.mods.getScripts().log(context, obj ? String(obj) : "null")
|
||||||
}
|
}
|
||||||
|
|
||||||
const extendContent = function(classType, name, params){
|
const extendContent = function(classType, name, params){
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//Generated class. Do not modify.
|
//Generated class. Do not modify.
|
||||||
|
|
||||||
const print = function(obj){
|
const log = function(context, obj){
|
||||||
java.lang.System.out.println(obj ? String(obj) : "null")
|
Vars.mods.getScripts().log(context, obj ? String(obj) : "null")
|
||||||
}
|
}
|
||||||
|
|
||||||
const extendContent = function(classType, name, params){
|
const extendContent = function(classType, name, params){
|
||||||
|
|||||||
@@ -1,2 +1,10 @@
|
|||||||
modName = "$MOD_NAME$"
|
modName = "$MOD_NAME$"
|
||||||
|
|
||||||
|
!function(){
|
||||||
|
|
||||||
|
const scriptName = "$SCRIPT_NAME$"
|
||||||
|
const print = text => log(scriptName, text);
|
||||||
$CODE$
|
$CODE$
|
||||||
|
|
||||||
|
}();
|
||||||
|
|
||||||
|
|||||||
@@ -69,14 +69,12 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
|||||||
Musics.load();
|
Musics.load();
|
||||||
Sounds.load();
|
Sounds.load();
|
||||||
|
|
||||||
assets.loadRun("scriptinit", Scripts.class, () -> {}, () -> {
|
|
||||||
content.createContent(false);
|
|
||||||
mods.loadScripts();
|
|
||||||
});
|
|
||||||
|
|
||||||
assets.loadRun("contentcreate", Content.class, () -> {
|
assets.loadRun("contentcreate", Content.class, () -> {
|
||||||
content.createContent();
|
content.createBaseContent();
|
||||||
content.loadColors();
|
content.loadColors();
|
||||||
|
}, () -> {
|
||||||
|
mods.loadScripts();
|
||||||
|
content.createModContent();
|
||||||
});
|
});
|
||||||
|
|
||||||
add(logic = new Logic());
|
add(logic = new Logic());
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import static io.anuke.mindustry.Vars.mods;
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public class ContentLoader{
|
public class ContentLoader{
|
||||||
private boolean loaded = false;
|
|
||||||
private ObjectMap<String, MappableContent>[] contentNameMap = new ObjectMap[ContentType.values().length];
|
private ObjectMap<String, MappableContent>[] contentNameMap = new ObjectMap[ContentType.values().length];
|
||||||
private Array<Content>[] contentMap = new Array[ContentType.values().length];
|
private Array<Content>[] contentMap = new Array[ContentType.values().length];
|
||||||
private MappableContent[][] temporaryMapper;
|
private MappableContent[][] temporaryMapper;
|
||||||
@@ -43,59 +42,47 @@ public class ContentLoader{
|
|||||||
new LegacyColorMapper(),
|
new LegacyColorMapper(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public ContentLoader(){
|
||||||
|
for(ContentType type : ContentType.values()){
|
||||||
|
contentMap[type.ordinal()] = new Array<>();
|
||||||
|
contentNameMap[type.ordinal()] = new ObjectMap<>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Clears all initialized content.*/
|
/** Clears all initialized content.*/
|
||||||
public void clear(){
|
public void clear(){
|
||||||
contentNameMap = new ObjectMap[ContentType.values().length];
|
contentNameMap = new ObjectMap[ContentType.values().length];
|
||||||
contentMap = new Array[ContentType.values().length];
|
contentMap = new Array[ContentType.values().length];
|
||||||
initialization = new ObjectSet<>();
|
initialization = new ObjectSet<>();
|
||||||
loaded = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates all content types. */
|
|
||||||
public void createContent(){
|
/** Creates all base types. */
|
||||||
createContent(true);
|
public void createBaseContent(){
|
||||||
|
for(ContentList list : content){
|
||||||
|
list.load();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates all content types. */
|
/** Creates mod content, if applicable. */
|
||||||
public void createContent(boolean load){
|
public void createModContent(){
|
||||||
if(loaded){
|
if(mods != null){
|
||||||
Log.info("Content already loaded, skipping.");
|
mods.loadContent();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(contentMap[0] == null){
|
|
||||||
for(ContentType type : ContentType.values()){
|
|
||||||
contentMap[type.ordinal()] = new Array<>();
|
|
||||||
contentNameMap[type.ordinal()] = new ObjectMap<>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(load){
|
|
||||||
|
|
||||||
for(ContentList list : content){
|
|
||||||
list.load();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mods != null){
|
|
||||||
mods.loadContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
//check up ID mapping, make sure it's linear
|
|
||||||
for(Array<Content> arr : contentMap){
|
|
||||||
for(int i = 0; i < arr.size; i++){
|
|
||||||
int id = arr.get(i).id;
|
|
||||||
if(id != i){
|
|
||||||
throw new IllegalArgumentException("Out-of-order IDs for content '" + arr.get(i) + "' (expected " + i + " but got " + id + ")");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
loaded = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Logs content statistics.*/
|
/** Logs content statistics.*/
|
||||||
public void logContent(){
|
public void logContent(){
|
||||||
|
//check up ID mapping, make sure it's linear (debug only)
|
||||||
|
for(Array<Content> arr : contentMap){
|
||||||
|
for(int i = 0; i < arr.size; i++){
|
||||||
|
int id = arr.get(i).id;
|
||||||
|
if(id != i){
|
||||||
|
throw new IllegalArgumentException("Out-of-order IDs for content '" + arr.get(i) + "' (expected " + i + " but got " + id + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Log.info("--- CONTENT INFO ---");
|
Log.info("--- CONTENT INFO ---");
|
||||||
for(int k = 0; k < contentMap.length; k++){
|
for(int k = 0; k < contentMap.length; k++){
|
||||||
Log.info("[{0}]: loaded {1}", ContentType.values()[k].name(), contentMap[k].size);
|
Log.info("[{0}]: loaded {1}", ContentType.values()[k].name(), contentMap[k].size);
|
||||||
|
|||||||
@@ -451,12 +451,12 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
platform.updateRPC();
|
platform.updateRPC();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Core.input.keyTap(Binding.pause) && !scene.hasDialog() && !ui.restart.isShown() && (state.is(State.paused) || state.is(State.playing))){
|
if(Core.input.keyTap(Binding.pause) && !scene.hasDialog() && !scene.hasKeyboard() && !ui.restart.isShown() && (state.is(State.paused) || state.is(State.playing))){
|
||||||
state.set(state.is(State.playing) ? State.paused : State.playing);
|
state.set(state.is(State.playing) ? State.paused : State.playing);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Core.input.keyTap(Binding.menu) && !ui.restart.isShown()){
|
if(Core.input.keyTap(Binding.menu) && !ui.restart.isShown()){
|
||||||
if(ui.chatfrag.chatOpen()){
|
if(ui.chatfrag.shown()){
|
||||||
ui.chatfrag.hide();
|
ui.chatfrag.hide();
|
||||||
}else if(!ui.paused.isShown() && !scene.hasDialog()){
|
}else if(!ui.paused.isShown() && !scene.hasDialog()){
|
||||||
ui.paused.show();
|
ui.paused.show();
|
||||||
@@ -464,7 +464,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!mobile && Core.input.keyTap(Binding.screenshot) && !(scene.getKeyboardFocus() instanceof TextField) && !ui.chatfrag.chatOpen()){
|
if(!mobile && Core.input.keyTap(Binding.screenshot) && !(scene.getKeyboardFocus() instanceof TextField) && !scene.hasKeyboard()){
|
||||||
renderer.takeMapScreenshot();
|
renderer.takeMapScreenshot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ public class NetClient implements ApplicationListener{
|
|||||||
player.pointerX, player.pointerY, player.rotation, player.baseRotation,
|
player.pointerX, player.pointerY, player.rotation, player.baseRotation,
|
||||||
player.velocity().x, player.velocity().y,
|
player.velocity().x, player.velocity().y,
|
||||||
player.getMineTile(),
|
player.getMineTile(),
|
||||||
player.isBoosting, player.isShooting, ui.chatfrag.chatOpen(), player.isBuilding,
|
player.isBoosting, player.isShooting, ui.chatfrag.shown(), player.isBuilding,
|
||||||
requests,
|
requests,
|
||||||
Core.camera.position.x, Core.camera.position.y,
|
Core.camera.position.x, Core.camera.position.y,
|
||||||
Core.camera.width * viewScale, Core.camera.height * viewScale);
|
Core.camera.width * viewScale, Core.camera.height * viewScale);
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
public MenuFragment menufrag;
|
public MenuFragment menufrag;
|
||||||
public HudFragment hudfrag;
|
public HudFragment hudfrag;
|
||||||
public ChatFragment chatfrag;
|
public ChatFragment chatfrag;
|
||||||
|
public ScriptConsoleFragment scriptfrag;
|
||||||
public PlayerListFragment listfrag;
|
public PlayerListFragment listfrag;
|
||||||
public LoadingFragment loadfrag;
|
public LoadingFragment loadfrag;
|
||||||
|
|
||||||
@@ -211,6 +212,7 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
chatfrag = new ChatFragment();
|
chatfrag = new ChatFragment();
|
||||||
listfrag = new PlayerListFragment();
|
listfrag = new PlayerListFragment();
|
||||||
loadfrag = new LoadingFragment();
|
loadfrag = new LoadingFragment();
|
||||||
|
scriptfrag = new ScriptConsoleFragment();
|
||||||
|
|
||||||
picker = new ColorPicker();
|
picker = new ColorPicker();
|
||||||
editor = new MapEditorDialog();
|
editor = new MapEditorDialog();
|
||||||
@@ -253,6 +255,7 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
menufrag.build(menuGroup);
|
menufrag.build(menuGroup);
|
||||||
chatfrag.container().build(hudGroup);
|
chatfrag.container().build(hudGroup);
|
||||||
listfrag.build(hudGroup);
|
listfrag.build(hudGroup);
|
||||||
|
scriptfrag.container().build(hudGroup);
|
||||||
loadfrag.build(group);
|
loadfrag.build(group);
|
||||||
new FadeInFragment().build(group);
|
new FadeInFragment().build(group);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -556,7 +556,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
|||||||
updateKeyboard();
|
updateKeyboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
isTyping = ui.chatfrag.chatOpen();
|
isTyping = ui.chatfrag.shown();
|
||||||
|
|
||||||
updateMechanics();
|
updateMechanics();
|
||||||
|
|
||||||
@@ -604,7 +604,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
|||||||
|
|
||||||
movement.limit(speed).scl(Time.delta());
|
movement.limit(speed).scl(Time.delta());
|
||||||
|
|
||||||
if(!ui.chatfrag.chatOpen()){
|
if(!Core.scene.hasKeyboard()){
|
||||||
velocity.add(movement.x, movement.y);
|
velocity.add(movement.x, movement.y);
|
||||||
}else{
|
}else{
|
||||||
isShooting = false;
|
isShooting = false;
|
||||||
@@ -613,7 +613,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
|||||||
updateVelocityStatus();
|
updateVelocityStatus();
|
||||||
moved = dst(prex, prey) > 0.001f;
|
moved = dst(prex, prey) > 0.001f;
|
||||||
|
|
||||||
if(!ui.chatfrag.chatOpen()){
|
if(!Core.scene.hasKeyboard()){
|
||||||
float baseLerp = mech.getRotationAlpha(this);
|
float baseLerp = mech.getRotationAlpha(this);
|
||||||
if(!isShooting() || !mech.turnCursor){
|
if(!isShooting() || !mech.turnCursor){
|
||||||
if(!movement.isZero()){
|
if(!movement.isZero()){
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public enum Binding implements KeyBind{
|
|||||||
chat_history_prev(KeyCode.UP),
|
chat_history_prev(KeyCode.UP),
|
||||||
chat_history_next(KeyCode.DOWN),
|
chat_history_next(KeyCode.DOWN),
|
||||||
chat_scroll(new Axis(KeyCode.SCROLL)),
|
chat_scroll(new Axis(KeyCode.SCROLL)),
|
||||||
|
console(KeyCode.BACKTICK),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final KeybindValue defaultValue;
|
private final KeybindValue defaultValue;
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
drawSelected(sreq.x, sreq.y, sreq.block, getRequest(sreq.x, sreq.y, sreq.block.size, sreq) != null ? Pal.remove : Pal.accent);
|
drawSelected(sreq.x, sreq.y, sreq.block, getRequest(sreq.x, sreq.y, sreq.block.size, sreq) != null ? Pal.remove : Pal.accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Core.input.keyDown(Binding.schematic_select) && !ui.chatfrag.chatOpen()){
|
if(Core.input.keyDown(Binding.schematic_select) && !Core.scene.hasKeyboard()){
|
||||||
drawSelection(schemX, schemY, cursorX, cursorY, Vars.maxSchematicSize);
|
drawSelection(schemX, schemY, cursorX, cursorY, Vars.maxSchematicSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
player.isShooting = false;
|
player.isShooting = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!state.is(State.menu) && Core.input.keyTap(Binding.minimap) && (scene.getKeyboardFocus() == ui.minimap || !scene.hasDialog()) && !ui.chatfrag.chatOpen() && !(scene.getKeyboardFocus() instanceof TextField)){
|
if(!state.is(State.menu) && Core.input.keyTap(Binding.minimap) && (scene.getKeyboardFocus() == ui.minimap || !scene.hasDialog()) && !Core.scene.hasKeyboard() && !(scene.getKeyboardFocus() instanceof TextField)){
|
||||||
if(!ui.minimap.isShown()){
|
if(!ui.minimap.isShown()){
|
||||||
ui.minimap.show();
|
ui.minimap.show();
|
||||||
}else{
|
}else{
|
||||||
@@ -293,12 +293,12 @@ public class DesktopInput extends InputHandler{
|
|||||||
player.clearBuilding();
|
player.clearBuilding();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Core.input.keyTap(Binding.schematic_select) && !ui.chatfrag.chatOpen()){
|
if(Core.input.keyTap(Binding.schematic_select) && !Core.scene.hasKeyboard()){
|
||||||
schemX = rawCursorX;
|
schemX = rawCursorX;
|
||||||
schemY = rawCursorY;
|
schemY = rawCursorY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Core.input.keyTap(Binding.schematic_menu) && !ui.chatfrag.chatOpen()){
|
if(Core.input.keyTap(Binding.schematic_menu) && !Core.scene.hasKeyboard()){
|
||||||
if(ui.schematics.isShown()){
|
if(ui.schematics.isShown()){
|
||||||
ui.schematics.hide();
|
ui.schematics.hide();
|
||||||
}else{
|
}else{
|
||||||
@@ -311,7 +311,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
selectRequests.clear();
|
selectRequests.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Core.input.keyRelease(Binding.schematic_select) && !ui.chatfrag.chatOpen()){
|
if(Core.input.keyRelease(Binding.schematic_select) && !Core.scene.hasKeyboard()){
|
||||||
lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY);
|
lastSchematic = schematics.create(schemX, schemY, rawCursorX, rawCursorY);
|
||||||
useSchematic(lastSchematic);
|
useSchematic(lastSchematic);
|
||||||
if(selectRequests.isEmpty()){
|
if(selectRequests.isEmpty()){
|
||||||
@@ -371,10 +371,10 @@ public class DesktopInput extends InputHandler{
|
|||||||
}else if(selected != null){
|
}else if(selected != null){
|
||||||
//only begin shooting if there's no cursor event
|
//only begin shooting if there's no cursor event
|
||||||
if(!tileTapped(selected) && !tryTapPlayer(Core.input.mouseWorld().x, Core.input.mouseWorld().y) && (player.buildQueue().size == 0 || !player.isBuilding) && !droppingItem &&
|
if(!tileTapped(selected) && !tryTapPlayer(Core.input.mouseWorld().x, Core.input.mouseWorld().y) && (player.buildQueue().size == 0 || !player.isBuilding) && !droppingItem &&
|
||||||
!tryBeginMine(selected) && player.getMineTile() == null && !ui.chatfrag.chatOpen()){
|
!tryBeginMine(selected) && player.getMineTile() == null && !Core.scene.hasKeyboard()){
|
||||||
player.isShooting = true;
|
player.isShooting = true;
|
||||||
}
|
}
|
||||||
}else if(!ui.chatfrag.chatOpen()){ //if it's out of bounds, shooting is just fine
|
}else if(!Core.scene.hasKeyboard()){ //if it's out of bounds, shooting is just fine
|
||||||
player.isShooting = true;
|
player.isShooting = true;
|
||||||
}
|
}
|
||||||
}else if(Core.input.keyTap(Binding.deselect) && block != null){
|
}else if(Core.input.keyTap(Binding.deselect) && block != null){
|
||||||
|
|||||||
@@ -198,6 +198,16 @@ public class Mods implements Loadable{
|
|||||||
requiresReload = true;
|
requiresReload = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Scripts getScripts(){
|
||||||
|
if(scripts == null) scripts = platform.createScripts();
|
||||||
|
return scripts;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return whether the scripting engine has been initialized. */
|
||||||
|
public boolean hasScripts(){
|
||||||
|
return scripts != null;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean requiresReload(){
|
public boolean requiresReload(){
|
||||||
return requiresReload;
|
return requiresReload;
|
||||||
}
|
}
|
||||||
@@ -353,9 +363,10 @@ public class Mods implements Loadable{
|
|||||||
scripts = null;
|
scripts = null;
|
||||||
}
|
}
|
||||||
content.clear();
|
content.clear();
|
||||||
content.createContent(false);
|
content.createBaseContent();
|
||||||
|
content.loadColors();
|
||||||
loadScripts();
|
loadScripts();
|
||||||
content.createContent();
|
content.createModContent();
|
||||||
loadAsync();
|
loadAsync();
|
||||||
loadSync();
|
loadSync();
|
||||||
content.init();
|
content.init();
|
||||||
|
|||||||
@@ -1,24 +1,28 @@
|
|||||||
package io.anuke.mindustry.mod;
|
package io.anuke.mindustry.mod;
|
||||||
|
|
||||||
import io.anuke.arc.*;
|
import io.anuke.arc.*;
|
||||||
|
import io.anuke.arc.collection.*;
|
||||||
import io.anuke.arc.files.*;
|
import io.anuke.arc.files.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.*;
|
import io.anuke.mindustry.*;
|
||||||
import io.anuke.mindustry.mod.Mods.*;
|
import io.anuke.mindustry.mod.Mods.*;
|
||||||
import org.mozilla.javascript.*;
|
import org.mozilla.javascript.*;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class Scripts implements Disposable{
|
public class Scripts implements Disposable{
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final String wrapper;
|
private final String wrapper;
|
||||||
private Scriptable scope;
|
private Scriptable scope;
|
||||||
|
private Array<String> logBuffer = new Array<>();
|
||||||
|
|
||||||
public Scripts(){
|
public Scripts(){
|
||||||
Time.mark();
|
Time.mark();
|
||||||
|
|
||||||
context = Vars.platform.getScriptContext();
|
context = Vars.platform.getScriptContext();
|
||||||
context.setClassShutter(type -> ClassAccess.allowedClassNames.contains(type) || type.startsWith("adapter") || type.contains("PrintStream"));
|
context.setClassShutter(type -> (ClassAccess.allowedClassNames.contains(type) || type.startsWith("adapter") || type.contains("PrintStream") || type.startsWith("io.anuke.mindustry")) && !type.equals("io.anuke.mindustry.mod.ClassAccess"));
|
||||||
|
|
||||||
scope = new ImporterTopLevel(context);//context.initStandardObjects();
|
scope = new ImporterTopLevel(context);
|
||||||
wrapper = Core.files.internal("scripts/wrapper.js").readString();
|
wrapper = Core.files.internal("scripts/wrapper.js").readString();
|
||||||
|
|
||||||
run(Core.files.internal("scripts/global.js").readString(), "global.js");
|
run(Core.files.internal("scripts/global.js").readString(), "global.js");
|
||||||
@@ -27,18 +31,51 @@ public class Scripts implements Disposable{
|
|||||||
|
|
||||||
public String runConsole(String text){
|
public String runConsole(String text){
|
||||||
try{
|
try{
|
||||||
return String.valueOf(context.evaluateString(scope, text, "console.js", 1, null));
|
Object o = context.evaluateString(scope, text, "console.js", 1, null);
|
||||||
|
if(o instanceof NativeJavaObject){
|
||||||
|
o = ((NativeJavaObject)o).unwrap();
|
||||||
|
}
|
||||||
|
if(o instanceof Undefined){
|
||||||
|
o = "undefined";
|
||||||
|
}
|
||||||
|
return String.valueOf(o);
|
||||||
}catch(Throwable t){
|
}catch(Throwable t){
|
||||||
return t.getClass().getSimpleName() + (t.getMessage() == null ? "" : ": " + t.getMessage());
|
return getError(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getError(Throwable t){
|
||||||
|
if(t instanceof EcmaError && t.getCause() != null){
|
||||||
|
t = t.getCause();
|
||||||
|
}
|
||||||
|
return t.getClass().getSimpleName() + (t.getMessage() == null ? "" : ": " + t.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void log(String source, String message){
|
||||||
|
Log.info("[{0}]: {1}", source, message);
|
||||||
|
logBuffer.add("[accent][" + source + "]:[] " + message);
|
||||||
|
if(!headless & ui.scriptfrag != null){
|
||||||
|
onLoad();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLoad(){
|
||||||
|
if(!headless){
|
||||||
|
logBuffer.each(ui.scriptfrag::addMessage);
|
||||||
|
}
|
||||||
|
logBuffer.clear();
|
||||||
|
}
|
||||||
|
|
||||||
public void run(LoadedMod mod, FileHandle file){
|
public void run(LoadedMod mod, FileHandle file){
|
||||||
run(wrapper.replace("$SCRIPT_NAME$", mod.name + "_" + file.nameWithoutExtension().replace("-", "_").replace(" ", "_")).replace("$CODE$", file.readString()).replace("$MOD_NAME$", mod.name), file.name());
|
run(wrapper.replace("$SCRIPT_NAME$", mod.name + "/" + file.nameWithoutExtension()).replace("$CODE$", file.readString()).replace("$MOD_NAME$", mod.name), file.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void run(String script, String file){
|
private void run(String script, String file){
|
||||||
context.evaluateString(scope, script, file, 1, null);
|
try{
|
||||||
|
context.evaluateString(scope, script, file, 1, null);
|
||||||
|
}catch(Throwable t){
|
||||||
|
log(file, getError(t));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class ChatFragment extends Table{
|
|||||||
private final static int messagesShown = 10;
|
private final static int messagesShown = 10;
|
||||||
private Array<ChatMessage> messages = new Array<>();
|
private Array<ChatMessage> messages = new Array<>();
|
||||||
private float fadetime;
|
private float fadetime;
|
||||||
private boolean chatOpen = false;
|
private boolean shown = false;
|
||||||
private TextField chatfield;
|
private TextField chatfield;
|
||||||
private Label fieldlabel = new Label(">");
|
private Label fieldlabel = new Label(">");
|
||||||
private BitmapFont font;
|
private BitmapFont font;
|
||||||
@@ -52,7 +52,7 @@ public class ChatFragment extends Table{
|
|||||||
if(!net.active() && messages.size > 0){
|
if(!net.active() && messages.size > 0){
|
||||||
clearMessages();
|
clearMessages();
|
||||||
|
|
||||||
if(chatOpen){
|
if(shown){
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ public class ChatFragment extends Table{
|
|||||||
toggle();
|
toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(chatOpen){
|
if(shown){
|
||||||
if(input.keyTap(Binding.chat_history_prev) && historyPos < history.size - 1){
|
if(input.keyTap(Binding.chat_history_prev) && historyPos < history.size - 1){
|
||||||
if(historyPos == 0) history.set(0, chatfield.getText());
|
if(historyPos == 0) history.set(0, chatfield.getText());
|
||||||
historyPos++;
|
historyPos++;
|
||||||
@@ -123,7 +123,7 @@ public class ChatFragment extends Table{
|
|||||||
|
|
||||||
Draw.color(shadowColor);
|
Draw.color(shadowColor);
|
||||||
|
|
||||||
if(chatOpen){
|
if(shown){
|
||||||
Fill.crect(offsetx, chatfield.getY(), chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
|
Fill.crect(offsetx, chatfield.getY(), chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,14 +131,14 @@ public class ChatFragment extends Table{
|
|||||||
|
|
||||||
float spacing = chatspace;
|
float spacing = chatspace;
|
||||||
|
|
||||||
chatfield.visible(chatOpen);
|
chatfield.visible(shown);
|
||||||
fieldlabel.visible(chatOpen);
|
fieldlabel.visible(shown);
|
||||||
|
|
||||||
Draw.color(shadowColor);
|
Draw.color(shadowColor);
|
||||||
Draw.alpha(shadowColor.a * opacity);
|
Draw.alpha(shadowColor.a * opacity);
|
||||||
|
|
||||||
float theight = offsety + spacing + getMarginBottom();
|
float theight = offsety + spacing + getMarginBottom();
|
||||||
for(int i = scrollPos; i < messages.size && i < messagesShown + scrollPos && (i < fadetime || chatOpen); i++){
|
for(int i = scrollPos; i < messages.size && i < messagesShown + scrollPos && (i < fadetime || shown); i++){
|
||||||
|
|
||||||
layout.setText(font, messages.get(i).formattedMessage, Color.white, textWidth, Align.bottomLeft, true);
|
layout.setText(font, messages.get(i).formattedMessage, Color.white, textWidth, Align.bottomLeft, true);
|
||||||
theight += layout.height + textspacing;
|
theight += layout.height + textspacing;
|
||||||
@@ -147,7 +147,7 @@ public class ChatFragment extends Table{
|
|||||||
font.getCache().clear();
|
font.getCache().clear();
|
||||||
font.getCache().addText(messages.get(i).formattedMessage, fontoffsetx + offsetx, offsety + theight, textWidth, Align.bottomLeft, true);
|
font.getCache().addText(messages.get(i).formattedMessage, fontoffsetx + offsetx, offsety + theight, textWidth, Align.bottomLeft, true);
|
||||||
|
|
||||||
if(!chatOpen && fadetime - i < 1f && fadetime - i >= 0f){
|
if(!shown && fadetime - i < 1f && fadetime - i >= 0f){
|
||||||
font.getCache().setAlphas((fadetime - i) * opacity);
|
font.getCache().setAlphas((fadetime - i) * opacity);
|
||||||
Draw.color(0, 0, 0, shadowColor.a * (fadetime - i) * opacity);
|
Draw.color(0, 0, 0, shadowColor.a * (fadetime - i) * opacity);
|
||||||
}else{
|
}else{
|
||||||
@@ -163,7 +163,7 @@ public class ChatFragment extends Table{
|
|||||||
|
|
||||||
Draw.color();
|
Draw.color();
|
||||||
|
|
||||||
if(fadetime > 0 && !chatOpen)
|
if(fadetime > 0 && !shown)
|
||||||
fadetime -= Time.delta() / 180f;
|
fadetime -= Time.delta() / 180f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,9 +180,9 @@ public class ChatFragment extends Table{
|
|||||||
|
|
||||||
public void toggle(){
|
public void toggle(){
|
||||||
|
|
||||||
if(!chatOpen){
|
if(!shown){
|
||||||
scene.setKeyboardFocus(chatfield);
|
scene.setKeyboardFocus(chatfield);
|
||||||
chatOpen = !chatOpen;
|
shown = !shown;
|
||||||
if(mobile){
|
if(mobile){
|
||||||
TextInput input = new TextInput();
|
TextInput input = new TextInput();
|
||||||
input.maxLength = maxTextLength;
|
input.maxLength = maxTextLength;
|
||||||
@@ -199,7 +199,7 @@ public class ChatFragment extends Table{
|
|||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
scene.setKeyboardFocus(null);
|
scene.setKeyboardFocus(null);
|
||||||
chatOpen = !chatOpen;
|
shown = !shown;
|
||||||
scrollPos = 0;
|
scrollPos = 0;
|
||||||
sendMessage();
|
sendMessage();
|
||||||
}
|
}
|
||||||
@@ -207,7 +207,7 @@ public class ChatFragment extends Table{
|
|||||||
|
|
||||||
public void hide(){
|
public void hide(){
|
||||||
scene.setKeyboardFocus(null);
|
scene.setKeyboardFocus(null);
|
||||||
chatOpen = false;
|
shown = false;
|
||||||
clearChatInput();
|
clearChatInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,12 +222,8 @@ public class ChatFragment extends Table{
|
|||||||
chatfield.setText("");
|
chatfield.setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean chatOpen(){
|
public boolean shown(){
|
||||||
return chatOpen;
|
return shown;
|
||||||
}
|
|
||||||
|
|
||||||
public int getMessagesSize(){
|
|
||||||
return messages.size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addMessage(String message, String sender){
|
public void addMessage(String message, String sender){
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class HudFragment extends Fragment{
|
|||||||
|
|
||||||
select.addImageButton(Icon.chatSmall, style,() -> {
|
select.addImageButton(Icon.chatSmall, style,() -> {
|
||||||
if(net.active() && mobile){
|
if(net.active() && mobile){
|
||||||
if(ui.chatfrag.chatOpen()){
|
if(ui.chatfrag.shown()){
|
||||||
ui.chatfrag.hide();
|
ui.chatfrag.hide();
|
||||||
}else{
|
}else{
|
||||||
ui.chatfrag.toggle();
|
ui.chatfrag.toggle();
|
||||||
@@ -131,7 +131,7 @@ public class HudFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
cont.update(() -> {
|
cont.update(() -> {
|
||||||
if(Core.input.keyTap(Binding.toggle_menus) && !ui.chatfrag.chatOpen() && !Core.scene.hasDialog() && !(Core.scene.getKeyboardFocus() instanceof TextField)){
|
if(Core.input.keyTap(Binding.toggle_menus) && !ui.chatfrag.shown() && !Core.scene.hasDialog() && !(Core.scene.getKeyboardFocus() instanceof TextField)){
|
||||||
toggleMenus();
|
toggleMenus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ public class PlacementFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ui.chatfrag.chatOpen()) return false;
|
if(ui.chatfrag.shown() || Core.scene.hasKeyboard()) return false;
|
||||||
|
|
||||||
for(int i = 0; i < blockSelect.length; i++){
|
for(int i = 0; i < blockSelect.length; i++){
|
||||||
if(Core.input.keyTap(blockSelect[i])){
|
if(Core.input.keyTap(blockSelect[i])){
|
||||||
if(i > 9) { //select block directionally
|
if(i > 9) { //select block directionally
|
||||||
|
|||||||
@@ -1,11 +1,231 @@
|
|||||||
package io.anuke.mindustry.ui.fragments;
|
package io.anuke.mindustry.ui.fragments;
|
||||||
|
|
||||||
|
import io.anuke.arc.*;
|
||||||
|
import io.anuke.arc.Input.*;
|
||||||
|
import io.anuke.arc.collection.*;
|
||||||
|
import io.anuke.arc.graphics.*;
|
||||||
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
|
import io.anuke.arc.math.*;
|
||||||
import io.anuke.arc.scene.*;
|
import io.anuke.arc.scene.*;
|
||||||
|
import io.anuke.arc.scene.ui.*;
|
||||||
|
import io.anuke.arc.scene.ui.Label.*;
|
||||||
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
|
import io.anuke.arc.util.*;
|
||||||
|
import io.anuke.mindustry.*;
|
||||||
|
import io.anuke.mindustry.input.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
|
|
||||||
public class ScriptConsoleFragment extends Fragment{
|
import static io.anuke.arc.Core.*;
|
||||||
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
|
public class ScriptConsoleFragment extends Table{
|
||||||
|
private final static int messagesShown = 14;
|
||||||
|
private Array<String> messages = new Array<>();
|
||||||
|
private float fadetime;
|
||||||
|
private boolean open = false, shown;
|
||||||
|
private TextField chatfield;
|
||||||
|
private Label fieldlabel = new Label(">");
|
||||||
|
private BitmapFont font;
|
||||||
|
private GlyphLayout layout = new GlyphLayout();
|
||||||
|
private float offsetx = Scl.scl(4), offsety = Scl.scl(4), fontoffsetx = Scl.scl(2), chatspace = Scl.scl(50);
|
||||||
|
private Color shadowColor = new Color(0, 0, 0, 0.4f);
|
||||||
|
private float textspacing = Scl.scl(10);
|
||||||
|
private Array<String> history = new Array<>();
|
||||||
|
private int historyPos = 0;
|
||||||
|
private int scrollPos = 0;
|
||||||
|
private Fragment container = new Fragment(){
|
||||||
|
@Override
|
||||||
|
public void build(Group parent){
|
||||||
|
scene.add(ScriptConsoleFragment.this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public ScriptConsoleFragment(){
|
||||||
|
|
||||||
|
setFillParent(true);
|
||||||
|
font = Fonts.def;
|
||||||
|
|
||||||
|
visible(() -> {
|
||||||
|
if(input.keyTap(Binding.console) && !Vars.net.client() && (scene.getKeyboardFocus() == chatfield || scene.getKeyboardFocus() == null)){
|
||||||
|
shown = !shown;
|
||||||
|
if(shown && !open){
|
||||||
|
toggle();
|
||||||
|
}
|
||||||
|
clearChatInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
return shown && !Vars.net.client();
|
||||||
|
});
|
||||||
|
|
||||||
|
update(() -> {
|
||||||
|
if(input.keyTap(Binding.chat) && (scene.getKeyboardFocus() == chatfield || scene.getKeyboardFocus() == null)){
|
||||||
|
toggle();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(open){
|
||||||
|
if(input.keyTap(Binding.chat_history_prev) && historyPos < history.size - 1){
|
||||||
|
if(historyPos == 0) history.set(0, chatfield.getText());
|
||||||
|
historyPos++;
|
||||||
|
updateChat();
|
||||||
|
}
|
||||||
|
if(input.keyTap(Binding.chat_history_next) && historyPos > 0){
|
||||||
|
historyPos--;
|
||||||
|
updateChat();
|
||||||
|
}
|
||||||
|
scrollPos = (int)Mathf.clamp(scrollPos + input.axis(Binding.chat_scroll), 0, Math.max(0, messages.size - messagesShown));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
history.insert(0, "");
|
||||||
|
setup();
|
||||||
|
|
||||||
|
if(mods.hasScripts()){
|
||||||
|
app.post(() -> mods.getScripts().onLoad());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Fragment container(){
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearMessages(){
|
||||||
|
messages.clear();
|
||||||
|
history.clear();
|
||||||
|
history.insert(0, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setup(){
|
||||||
|
fieldlabel.setStyle(new LabelStyle(fieldlabel.getStyle()));
|
||||||
|
fieldlabel.getStyle().font = font;
|
||||||
|
fieldlabel.setStyle(fieldlabel.getStyle());
|
||||||
|
|
||||||
|
chatfield = new TextField("", new TextField.TextFieldStyle(scene.getStyle(TextField.TextFieldStyle.class)));
|
||||||
|
chatfield.setMaxLength(Vars.maxTextLength);
|
||||||
|
chatfield.getStyle().background = null;
|
||||||
|
chatfield.getStyle().font = Fonts.chat;
|
||||||
|
chatfield.getStyle().fontColor = Color.white;
|
||||||
|
chatfield.setStyle(chatfield.getStyle());
|
||||||
|
|
||||||
|
bottom().left().marginBottom(offsety).marginLeft(offsetx * 2).add(fieldlabel).padBottom(6f);
|
||||||
|
|
||||||
|
add(chatfield).padBottom(offsety).padLeft(offsetx).growX().padRight(offsetx).height(28);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void build(Group parent){
|
public void draw(){
|
||||||
|
float opacity = 1f;
|
||||||
|
float textWidth = graphics.getWidth() - offsetx*2f;
|
||||||
|
|
||||||
|
Draw.color(shadowColor);
|
||||||
|
|
||||||
|
if(open){
|
||||||
|
Fill.crect(offsetx, chatfield.getY(), chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
super.draw();
|
||||||
|
|
||||||
|
float spacing = chatspace;
|
||||||
|
|
||||||
|
chatfield.visible(open);
|
||||||
|
fieldlabel.visible(open);
|
||||||
|
|
||||||
|
Draw.color(shadowColor);
|
||||||
|
Draw.alpha(shadowColor.a * opacity);
|
||||||
|
|
||||||
|
float theight = offsety + spacing + getMarginBottom();
|
||||||
|
for(int i = scrollPos; i < messages.size && i < messagesShown + scrollPos && (i < fadetime || open); i++){
|
||||||
|
|
||||||
|
layout.setText(font, messages.get(i), Color.white, textWidth, Align.bottomLeft, true);
|
||||||
|
theight += layout.height + textspacing;
|
||||||
|
if(i - scrollPos == 0) theight -= textspacing + 1;
|
||||||
|
|
||||||
|
font.getCache().clear();
|
||||||
|
font.getCache().addText(messages.get(i), fontoffsetx + offsetx, offsety + theight, textWidth, Align.bottomLeft, true);
|
||||||
|
|
||||||
|
if(!open && fadetime - i < 1f && fadetime - i >= 0f){
|
||||||
|
font.getCache().setAlphas((fadetime - i) * opacity);
|
||||||
|
Draw.color(0, 0, 0, shadowColor.a * (fadetime - i) * opacity);
|
||||||
|
}else{
|
||||||
|
font.getCache().setAlphas(opacity);
|
||||||
|
}
|
||||||
|
|
||||||
|
Fill.crect(offsetx, theight - layout.height - 2, textWidth + Scl.scl(4f), layout.height + textspacing);
|
||||||
|
Draw.color(shadowColor);
|
||||||
|
Draw.alpha(opacity * shadowColor.a);
|
||||||
|
|
||||||
|
font.getCache().draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
Draw.color();
|
||||||
|
|
||||||
|
if(fadetime > 0 && !open)
|
||||||
|
fadetime -= Time.delta() / 180f;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendMessage(){
|
||||||
|
String message = chatfield.getText();
|
||||||
|
clearChatInput();
|
||||||
|
|
||||||
|
if(message.replaceAll(" ", "").isEmpty()) return;
|
||||||
|
|
||||||
|
history.insert(1, message);
|
||||||
|
|
||||||
|
addMessage("[lightgray]> " + message);
|
||||||
|
addMessage(mods.getScripts().runConsole(message));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toggle(){
|
||||||
|
|
||||||
|
if(!open){
|
||||||
|
scene.setKeyboardFocus(chatfield);
|
||||||
|
open = !open;
|
||||||
|
if(mobile){
|
||||||
|
TextInput input = new TextInput();
|
||||||
|
input.maxLength = maxTextLength;
|
||||||
|
input.accepted = text -> {
|
||||||
|
chatfield.setText(text);
|
||||||
|
sendMessage();
|
||||||
|
hide();
|
||||||
|
Core.input.setOnscreenKeyboardVisible(false);
|
||||||
|
};
|
||||||
|
input.canceled = this::hide;
|
||||||
|
Core.input.getTextInput(input);
|
||||||
|
}else{
|
||||||
|
chatfield.fireClick();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
scene.setKeyboardFocus(null);
|
||||||
|
open = !open;
|
||||||
|
scrollPos = 0;
|
||||||
|
sendMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void hide(){
|
||||||
|
scene.setKeyboardFocus(null);
|
||||||
|
open = false;
|
||||||
|
clearChatInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateChat(){
|
||||||
|
chatfield.setText(history.get(historyPos));
|
||||||
|
chatfield.setCursorPosition(chatfield.getText().length());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearChatInput(){
|
||||||
|
historyPos = 0;
|
||||||
|
history.set(0, "");
|
||||||
|
chatfield.setText("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean open(){
|
||||||
|
return open;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addMessage(String message){
|
||||||
|
messages.insert(0, message);
|
||||||
|
|
||||||
|
fadetime += 1f;
|
||||||
|
fadetime = Math.min(fadetime, messagesShown) + 1f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=ef6d1485c36346e008ac6818ec972e7781f9ba8d
|
archash=6d310772fec1f69efeae2e487cab3bd64728ae05
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ public class MindustryServer implements ApplicationListener{
|
|||||||
|
|
||||||
Vars.loadSettings();
|
Vars.loadSettings();
|
||||||
Vars.init();
|
Vars.init();
|
||||||
content.createContent();
|
content.createBaseContent();
|
||||||
|
mods.loadScripts();
|
||||||
|
content.createModContent();
|
||||||
content.init();
|
content.init();
|
||||||
|
|
||||||
Core.app.addListener(logic = new Logic());
|
Core.app.addListener(logic = new Logic());
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class ApplicationTests{
|
|||||||
net = new Net(null);
|
net = new Net(null);
|
||||||
tree = new FileTree();
|
tree = new FileTree();
|
||||||
Vars.init();
|
Vars.init();
|
||||||
content.createContent();
|
content.createBaseContent();
|
||||||
|
|
||||||
add(logic = new Logic());
|
add(logic = new Logic());
|
||||||
add(netServer = new NetServer());
|
add(netServer = new NetServer());
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class PowerTestFixture{
|
|||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
content.createContent();
|
content.createBaseContent();
|
||||||
Log.setUseColors(false);
|
Log.setUseColors(false);
|
||||||
Time.setDeltaProvider(() -> 0.5f);
|
Time.setDeltaProvider(() -> 0.5f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class ImagePacker{
|
|||||||
|
|
||||||
Log.setLogger(new NoopLogHandler());
|
Log.setLogger(new NoopLogHandler());
|
||||||
Vars.content = new ContentLoader();
|
Vars.content = new ContentLoader();
|
||||||
Vars.content.createContent();
|
Vars.content.createBaseContent();
|
||||||
Log.setLogger(new LogHandler());
|
Log.setLogger(new LogHandler());
|
||||||
|
|
||||||
Files.walk(Paths.get("../../../assets-raw/sprites_out")).forEach(path -> {
|
Files.walk(Paths.get("../../../assets-raw/sprites_out")).forEach(path -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user