From f8bb98daaded55740bd28cff580a6683933f297d Mon Sep 17 00:00:00 2001 From: way-zer Date: Sun, 4 Aug 2024 16:02:09 +0800 Subject: [PATCH] sync 2024/8/4 --- patches/client/0023-C-StatExt.patch | 19 +- patches/client/0034-FC-Loader-Mod.patch | 456 +++++++++++-- patches/client/0038-API-VarsX.isLoader.patch | 4 +- patches/client/0039-UI-Settings.patch | 36 +- .../client/0040-ARC-bundle-and-settings.patch | 31 +- patches/client/0059-OC-Batch.patch | 42 +- patches/client/0063-UI-Mod-Mod.patch | 2 +- ...UI-HudSettingsTable-AdvanceBuildTool.patch | 4 +- patches/client/0072-C-Editor.patch | 4 +- patches/client/0074-C.patch | 28 +- ...tch => 0078-ARC-bundle-and-settings.patch} | 26 +- patches/client/0081-PICK.patch | 8 +- patches/client/0084-API-FuncX-drawText.patch | 28 +- .../0085-C-RenderExt-playerEffectColor.patch | 6 +- .../client/0087-UI-ARC-logic-Support.patch | 53 +- patches/client/0088-C-Portable-Data-Dir.patch | 6 +- patches/client/0091-OC-Fonts.patch | 119 ++++ .../0092-FC-RenderExt-payloadPreview.patch | 138 ++++ .../0093-FC-RenderExt-deadOverlay.patch | 52 ++ .../0094-FC-LogicExt-invertMapClick.patch | 107 +++ ...-OC-speedup-SchematicsDialog-showing.patch | 53 ++ ...ARC-merged.patch => 0096-ARC-merged.patch} | 608 +++++++----------- ...ease.patch => 0097-BUILD-BE-release.patch} | 28 +- 23 files changed, 1266 insertions(+), 592 deletions(-) rename patches/client/{0078-C-RenderExt-drawBars.patch => 0078-ARC-bundle-and-settings.patch} (87%) create mode 100644 patches/client/0091-OC-Fonts.patch create mode 100644 patches/client/0092-FC-RenderExt-payloadPreview.patch create mode 100644 patches/client/0093-FC-RenderExt-deadOverlay.patch create mode 100644 patches/client/0094-FC-LogicExt-invertMapClick.patch create mode 100644 patches/client/0095-OC-speedup-SchematicsDialog-showing.patch rename patches/client/{0091-ARC-merged.patch => 0096-ARC-merged.patch} (94%) rename patches/client/{0092-BUILD-BE-release.patch => 0097-BUILD-BE-release.patch} (73%) diff --git a/patches/client/0023-C-StatExt.patch b/patches/client/0023-C-StatExt.patch index 49140872706b..e18dad2fd799 100644 --- a/patches/client/0023-C-StatExt.patch +++ b/patches/client/0023-C-StatExt.patch @@ -15,7 +15,7 @@ way-zer on 2024/5/4 at 22:17 core/src/mindustry/type/StatusEffect.java | 2 + core/src/mindustry/type/UnitType.java | 40 ++- core/src/mindustry/type/Weapon.java | 22 +- - core/src/mindustry/ui/ItemImage.java | 22 ++ + core/src/mindustry/ui/ItemImage.java | 13 + core/src/mindustry/world/Block.java | 4 +- .../world/blocks/defense/ForceProjector.java | 7 +- .../world/blocks/defense/MendProjector.java | 6 +- @@ -38,7 +38,7 @@ way-zer on 2024/5/4 at 22:17 core/src/mindustry/world/meta/StatCat.java | 5 +- core/src/mindustry/world/meta/StatValues.java | 254 ++++++++++++++---- core/src/mindustryX/features/StatExt.java | 96 +++++++ - 29 files changed, 503 insertions(+), 91 deletions(-) + 29 files changed, 494 insertions(+), 91 deletions(-) create mode 100644 core/src/mindustryX/features/StatExt.java diff --git a/core/assets/bundles/bundle-mdtx.properties b/core/assets/bundles/bundle-mdtx.properties @@ -284,7 +284,7 @@ index d67a1ca03202019648a65863d0114c96fb21cd78..f9ec8feac6e944e76b5e2309da9b78e9 StatValues.ammo(ObjectMap.of(u, bullet)).display(t); diff --git a/core/src/mindustry/ui/ItemImage.java b/core/src/mindustry/ui/ItemImage.java -index 874fa6ceff4c1ea412db02eb2adfb4e491771b19..6f20b9cd229a15a67d629e56762d86df3ec97012 100644 +index 874fa6ceff4c1ea412db02eb2adfb4e491771b19..728b0d8423dfc2e09f5a8d4ca74fca047dccf368 100644 --- a/core/src/mindustry/ui/ItemImage.java +++ b/core/src/mindustry/ui/ItemImage.java @@ -1,11 +1,15 @@ @@ -303,21 +303,12 @@ index 874fa6ceff4c1ea412db02eb2adfb4e491771b19..6f20b9cd229a15a67d629e56762d86df public class ItemImage extends Stack{ -@@ -25,6 +29,24 @@ public class ItemImage extends Stack{ +@@ -25,6 +29,15 @@ public class ItemImage extends Stack{ } } + public ItemImage(TextureRegion region, int reqAmount, Intp curAmount){ -+ add(new Table(o -> { -+ o.left(); -+ o.add(new Image(region)).size(32f).scaling(Scaling.fit); -+ })); -+ -+ add(new Table(t -> { -+ t.left().bottom(); -+ t.add(String.valueOf(reqAmount)).get().setFontScale(1f); -+ t.pack(); -+ })); ++ this(region, reqAmount); + add(new Table(t -> { + t.left().top(); + t.label(() -> String.valueOf(curAmount.get())).get().setFontScale(0.6f); diff --git a/patches/client/0034-FC-Loader-Mod.patch b/patches/client/0034-FC-Loader-Mod.patch index 38a33b7e6875..ee4630608dfd 100644 --- a/patches/client/0034-FC-Loader-Mod.patch +++ b/patches/client/0034-FC-Loader-Mod.patch @@ -8,23 +8,28 @@ Content-Transfer-Encoding: 8bit 添加`icon.png` way-zer on 2024/6/9 + +更好的Desktop适配 +way-zer on 2024/8/3 --- - .../src/mindustryX/loader/AndroidImpl.java | 277 ++++++++++++++++++ - core/src/mindustryX/loader/DesktopImpl.java | 131 +++++++++ - .../src/mindustryX/loader/LoaderPlatform.java | 45 +++ - core/src/mindustryX/loader/Main.java | 134 +++++++++ - 4 files changed, 587 insertions(+) + .../src/mindustryX/loader/AndroidImpl.java | 273 ++++++++++++++ + core/src/mindustryX/loader/DesktopImpl.java | 136 +++++++ + .../src/mindustryX/loader/LoaderPlatform.java | 46 +++ + core/src/mindustryX/loader/Main.java | 116 ++++++ + .../src/arc/backend/sdl/SdlApplication.java | 355 ++++++++++++++++++ + 5 files changed, 926 insertions(+) create mode 100644 android/src/mindustryX/loader/AndroidImpl.java create mode 100644 core/src/mindustryX/loader/DesktopImpl.java create mode 100644 core/src/mindustryX/loader/LoaderPlatform.java create mode 100644 core/src/mindustryX/loader/Main.java + create mode 100644 desktop/src/arc/backend/sdl/SdlApplication.java diff --git a/android/src/mindustryX/loader/AndroidImpl.java b/android/src/mindustryX/loader/AndroidImpl.java new file mode 100644 -index 0000000000000000000000000000000000000000..7e9a04a89c63b8f6d7408eedf7cfb98e120a8314 +index 0000000000000000000000000000000000000000..b940ea6d550cc1d7e47c3c82573d8945bfc24836 --- /dev/null +++ b/android/src/mindustryX/loader/AndroidImpl.java -@@ -0,0 +1,277 @@ +@@ -0,0 +1,273 @@ +package mindustryX.loader; + +import android.app.*; @@ -297,17 +302,13 @@ index 0000000000000000000000000000000000000000..7e9a04a89c63b8f6d7408eedf7cfb98e + cb = cb.getSuperclass(); + } + } -+ -+ @Override -+ public void cleanup(){ -+ } +} diff --git a/core/src/mindustryX/loader/DesktopImpl.java b/core/src/mindustryX/loader/DesktopImpl.java new file mode 100644 -index 0000000000000000000000000000000000000000..899cc211a839ccbcae714654d15e1e22fc8d6dd5 +index 0000000000000000000000000000000000000000..436debef14096ac48c4532f472d3c057365da296 --- /dev/null +++ b/core/src/mindustryX/loader/DesktopImpl.java -@@ -0,0 +1,131 @@ +@@ -0,0 +1,136 @@ +package mindustryX.loader; + +import arc.*; @@ -333,7 +334,7 @@ index 0000000000000000000000000000000000000000..899cc211a839ccbcae714654d15e1e22 + } + + @Override -+ public void cleanup(){ ++ public void beforeLaunch(){ + //fix steam + //noinspection unchecked + Seq listeners = ((ObjectMap>)Reflect.get(Events.class, "events")).get(EventType.DisposeEvent.class); @@ -348,13 +349,18 @@ index 0000000000000000000000000000000000000000..899cc211a839ccbcae714654d15e1e22 + } + } + Core.app.dispose(); -+ try{ -+ Class sdl = Class.forName("arc.backend.sdl.jni.SDL"); -+ Reflect.invoke(sdl, "SDL_DestroyWindow", new Object[]{Reflect.get(Core.app, "window")}, long.class); -+// Reflect.invoke(sdl, "SDL_Quit"); -+ }catch(Throwable e){ -+ throw new RuntimeException(e); -+ } ++// try{ ++// Class sdl = Class.forName("arc.backend.sdl.jni.SDL"); ++// Reflect.invoke(sdl, "SDL_DestroyWindow", new Object[]{Reflect.get(Core.app, "window")}, long.class); ++//// Reflect.invoke(sdl, "SDL_Quit"); ++// }catch(Throwable e){ ++// throw new RuntimeException(e); ++// } ++ ++ System.setProperty("MDTX-SDL-width", "" + Core.graphics.getWidth()); ++ System.setProperty("MDTX-SDL-height", "" + Core.graphics.getHeight()); ++ System.setProperty("MDTX-SDL-window", Reflect.get(Core.app, "window").toString()); ++ System.setProperty("MDTX-SDL-context", Reflect.get(Core.app, "context").toString()); + } + + @Override @@ -441,10 +447,10 @@ index 0000000000000000000000000000000000000000..899cc211a839ccbcae714654d15e1e22 +} diff --git a/core/src/mindustryX/loader/LoaderPlatform.java b/core/src/mindustryX/loader/LoaderPlatform.java new file mode 100644 -index 0000000000000000000000000000000000000000..7214a64cd3d4e93503c1ed50e1514db90260fc5a +index 0000000000000000000000000000000000000000..ae7a1740e384f49f7b85c84d4268c68f51b63840 --- /dev/null +++ b/core/src/mindustryX/loader/LoaderPlatform.java -@@ -0,0 +1,45 @@ +@@ -0,0 +1,46 @@ +package mindustryX.loader; + +import java.net.*; @@ -453,10 +459,11 @@ index 0000000000000000000000000000000000000000..7214a64cd3d4e93503c1ed50e1514db9 +interface LoaderPlatform{ + void withSafeClassloader(String method); + -+ void cleanup(); -+ + ClassLoader createClassloader(); + ++ default void beforeLaunch(){ ++ } ++ + void launch(ClassLoader loader) throws Exception; + + final class CompoundURLEnumeration implements Enumeration{ @@ -492,10 +499,10 @@ index 0000000000000000000000000000000000000000..7214a64cd3d4e93503c1ed50e1514db9 +} diff --git a/core/src/mindustryX/loader/Main.java b/core/src/mindustryX/loader/Main.java new file mode 100644 -index 0000000000000000000000000000000000000000..47a2c48e09d85b8e919026b2ea72384999b36d0d +index 0000000000000000000000000000000000000000..ffe311d2a8e095c1e3262cdd2ede50ff42235c61 --- /dev/null +++ b/core/src/mindustryX/loader/Main.java -@@ -0,0 +1,134 @@ +@@ -0,0 +1,116 @@ +package mindustryX.loader; + +import arc.*; @@ -538,18 +545,11 @@ index 0000000000000000000000000000000000000000..47a2c48e09d85b8e919026b2ea723849 + } + impl.withSafeClassloader("preload"); + }else{ -+ Log.infoTag("MindustryX", "Already inside MindustryX, cleanup outside"); -+ try{ -+ Class mod = Core.class.getClassLoader().loadClass(Main.class.getName()); -+ Reflect.invoke(mod, "cleanup"); -+ }catch(Exception e){ -+ Log.err(e); -+ } ++ Log.infoTag("MindustryX", "Already inside MindustryX."); + } + } + + private static LoaderPlatform impl; -+ private static boolean needClear = false; + + private static void loadError(String msg){ + Log.errTag("MindustryX", msg); @@ -580,6 +580,11 @@ index 0000000000000000000000000000000000000000..47a2c48e09d85b8e919026b2ea723849 + return false; + }catch(Exception e){/*ignore*/} + ++ try{ ++ loadError("Detected FOO client, skip: " + Reflect.get(Version.class, "clientVersion")); ++ return false; ++ }catch(Exception e){/*ignore*/} ++ + ModMeta meta = null; + @SuppressWarnings("unchecked") + var metas = ((ObjectMap, ModMeta>)Reflect.get(Vars.mods, "metas")); @@ -598,27 +603,11 @@ index 0000000000000000000000000000000000000000..47a2c48e09d85b8e919026b2ea723849 + return true; + } + -+ @SuppressWarnings("unused")//reflect -+ public static void cleanup(){ -+ if(!needClear) return; -+ needClear = false; -+ impl.cleanup(); -+ Log.info("END cleanup"); -+ } -+ + static void load(){ + ClassLoader classLoader = impl.createClassloader(); -+ Log.info("=========== Start mindustryX client ==============="); -+ needClear = true; -+ Threads.daemon(() -> { -+ try{ -+ Thread.sleep(5000); -+ cleanup(); -+ }catch(InterruptedException e){ -+ throw new RuntimeException(e); -+ } -+ }); ++ impl.beforeLaunch(); + Vars.finishLaunch();//mark a successful launch ++ Log.info("=========== Start mindustryX client ==============="); + Log.logger = new NoopLogHandler(); + try{ + Thread.currentThread().setContextClassLoader(classLoader); @@ -630,3 +619,364 @@ index 0000000000000000000000000000000000000000..47a2c48e09d85b8e919026b2ea723849 + } + } +} +diff --git a/desktop/src/arc/backend/sdl/SdlApplication.java b/desktop/src/arc/backend/sdl/SdlApplication.java +new file mode 100644 +index 0000000000000000000000000000000000000000..bb63fa602677dfaa7b838e43d5c7f183968fab22 +--- /dev/null ++++ b/desktop/src/arc/backend/sdl/SdlApplication.java +@@ -0,0 +1,355 @@ ++package arc.backend.sdl; ++ ++import arc.*; ++import arc.audio.*; ++import arc.files.*; ++import arc.func.*; ++import arc.graphics.*; ++import arc.math.geom.*; ++import arc.scene.ui.*; ++import arc.struct.*; ++import arc.util.TaskQueue; ++import arc.util.*; ++import mindustryX.*; ++ ++import java.io.*; ++import java.net.*; ++import java.util.*; ++ ++import static arc.backend.sdl.jni.SDL.*; ++ ++public class SdlApplication implements Application{ ++ private final Seq listeners = new Seq<>(); ++ private final TaskQueue runnables = new TaskQueue(); ++ private final int[] inputs = new int[64]; ++ ++ final SdlGraphics graphics; ++ final SdlInput input; ++ final SdlConfig config; ++ ++ boolean running = true; ++ long window, context; ++ ++ public SdlApplication(ApplicationListener listener, SdlConfig config){ ++ this.config = config; ++ this.listeners.add(listener); ++ ++ init(); ++ ++ Core.app = this; ++ Core.files = new SdlFiles(); ++ Core.graphics = this.graphics = new SdlGraphics(this); ++ Core.input = this.input = new SdlInput(); ++ Core.settings = new Settings(); ++ Core.audio = new Audio(!config.disableAudio); ++ ++ initIcon(); ++ ++ graphics.updateSize(config.width, config.height); ++ ++ //can't be bothered to recompile arc for mac ++ if(!OS.isMac){ ++ addTextInputListener(); ++ } ++ ++ try{ ++ loop(); ++ listen(ApplicationListener::exit); ++ }finally{ ++ try{ ++ cleanup(); ++ }catch(Throwable error){ ++ error.printStackTrace(); ++ } ++ } ++ } ++ ++ /** Used for Scene text fields. */ ++ private void addTextInputListener(){ ++ addListener(new ApplicationListener(){ ++ TextField lastFocus; ++ ++ @Override ++ public void update(){ ++ if(Core.scene != null && Core.scene.getKeyboardFocus() instanceof TextField){ ++ TextField next = (TextField)Core.scene.getKeyboardFocus(); ++ if(lastFocus == null){ ++ SDL_StartTextInput(); ++ } ++ lastFocus = next; ++ }else if(lastFocus != null){ ++ SDL_StopTextInput(); ++ lastFocus = null; ++ } ++ ++ if(lastFocus != null){ ++ Vec2 pos = lastFocus.localToStageCoordinates(Tmp.v1.setZero()); ++ SDL_SetTextInputRect((int)pos.x, Core.graphics.getHeight() - 1 - (int)(pos.y + lastFocus.getHeight()), (int)lastFocus.getWidth(), (int)lastFocus.getHeight()); ++ } ++ } ++ }); ++ } ++ ++ private void initIcon(){ ++ if(config.windowIconPaths != null && config.windowIconPaths.length > 0){ ++ String path = config.windowIconPaths[0]; ++ try{ ++ Pixmap p = new Pixmap(Core.files.get(path, config.windowIconFileType)); ++ long surface = SDL_CreateRGBSurfaceFrom(p.pixels, p.width, p.height); ++ SDL_SetWindowIcon(window, surface); ++ SDL_FreeSurface(surface); ++ p.dispose(); ++ }catch(Exception e){ ++ e.printStackTrace(); ++ } ++ } ++ } ++ ++ private void init(){ ++ ArcNativesLoader.load(); ++ ++ if(OS.isMac) restartMac(); ++ ++ if(VarsX.isLoader){ ++ Log.info("[Core] Initialize reusing window and context."); ++ window = Long.parseLong(System.getProperty("MDTX-SDL-window")); ++ context = Long.parseLong(System.getProperty("MDTX-SDL-context")); ++ ++ config.width = Integer.parseInt(System.getProperty("MDTX-SDL-width")); ++ config.height = Integer.parseInt(System.getProperty("MDTX-SDL-height")); ++ ++ int[] ver = new int[3]; ++ SDL_GetVersion(ver); ++ Log.info("[Core] Initialized SDL v@.@.@", ver[0], ver[1], ver[2]); ++ return; ++ } ++ ++ check(() -> SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS)); ++ ++ //show native IME candidate UI ++ SDL_SetHint("SDL_IME_SHOW_UI", "1"); ++ SDL_SetHint("SDL_WINDOWS_DPI_SCALING", "1"); ++ ++ //set up openGL 2.0 profile ++ check(() -> SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, config.gl30 ? config.gl30Major : 2)); ++ check(() -> SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, config.gl30 ? config.gl30Minor : 0)); ++ ++// if(config.gl30 && (OS.isMac || config.coreProfile)){ ++// check(() -> SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE)); ++// } ++ ++ check(() -> SDL_GL_SetAttribute(SDL_GL_RED_SIZE, config.r)); ++ check(() -> SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, config.g)); ++ check(() -> SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, config.b)); ++ check(() -> SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, config.depth)); ++ check(() -> SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, config.stencil)); ++ check(() -> SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1)); ++ ++ //this doesn't seem to do anything, but at least I tried ++ if(config.samples > 0){ ++ check(() -> SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1)); ++ check(() -> SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, config.samples)); ++ } ++ ++ int flags = SDL_WINDOW_OPENGL; ++ if(config.initialVisible) flags |= SDL_WINDOW_SHOWN; ++ if(!config.decorated) flags |= SDL_WINDOW_BORDERLESS; ++ if(config.resizable) flags |= SDL_WINDOW_RESIZABLE; ++ if(config.maximized) flags |= SDL_WINDOW_MAXIMIZED; ++ if(config.fullscreen) flags |= SDL_WINDOW_FULLSCREEN; ++ ++ window = SDL_CreateWindow(config.title, config.width, config.height, flags); ++ if(window == 0) throw new SdlError(); ++ ++ context = SDL_GL_CreateContext(window); ++ if(context == 0) throw new SdlError(); ++ ++ if(config.vSyncEnabled){ ++ SDL_GL_SetSwapInterval(1); ++ } ++ ++ int[] ver = new int[3]; ++ SDL_GetVersion(ver); ++ Log.info("[Core] Initialized SDL v@.@.@", ver[0], ver[1], ver[2]); ++ } ++ ++ private void loop(){ ++ ++ listen(ApplicationListener::init); ++ ++ while(running){ ++ while(SDL_PollEvent(inputs)){ ++ if(inputs[0] == SDL_EVENT_QUIT){ ++ running = false; ++ }else if(inputs[0] == SDL_EVENT_WINDOW){ ++ int type = inputs[1]; ++ if(type == SDL_WINDOWEVENT_SIZE_CHANGED){ ++ graphics.updateSize(inputs[2], inputs[3]); ++ listen(l -> l.resize(inputs[2], inputs[3])); ++ }else if(type == SDL_WINDOWEVENT_FOCUS_GAINED){ ++ listen(ApplicationListener::resume); ++ }else if(type == SDL_WINDOWEVENT_FOCUS_LOST){ ++ listen(ApplicationListener::pause); ++ } ++ }else if(inputs[0] == SDL_EVENT_MOUSE_MOTION || ++ inputs[0] == SDL_EVENT_MOUSE_BUTTON || ++ inputs[0] == SDL_EVENT_MOUSE_WHEEL || ++ inputs[0] == SDL_EVENT_KEYBOARD || ++ inputs[0] == SDL_EVENT_TEXT_INPUT || ++ inputs[0] == SDL_EVENT_TEXT_EDIT){ ++ input.handleInput(inputs); ++ } ++ } ++ ++ graphics.update(); ++ input.update(); ++ defaultUpdate(); ++ ++ listen(ApplicationListener::update); ++ ++ runnables.run(); ++ ++ SDL_GL_SwapWindow(window); ++ input.postUpdate(); ++ } ++ } ++ ++ private void listen(Cons cons){ ++ synchronized(listeners){ ++ for(ApplicationListener l : listeners){ ++ cons.get(l); ++ } ++ } ++ } ++ ++ private void cleanup(){ ++ listen(l -> { ++ l.pause(); ++ try{ ++ l.dispose(); ++ }catch(Throwable t){ ++ t.printStackTrace(); ++ } ++ }); ++ dispose(); ++ ++ SDL_DestroyWindow(window); ++ SDL_Quit(); ++ } ++ ++ private void check(Intp run){ ++ if(run.get() != 0){ ++ throw new SdlError(); ++ } ++ } ++ ++ public long getWindow(){ ++ return window; ++ } ++ ++ @Override ++ public boolean openFolder(String file){ ++ Threads.daemon(() -> { ++ if(OS.isWindows){ ++ OS.execSafe("explorer.exe /select," + file.replace("/", "\\")); ++ }else if(OS.isLinux){ ++ OS.execSafe("xdg-open", file); ++ }else if(OS.isMac){ ++ OS.execSafe("open", file); ++ } ++ }); ++ return true; ++ } ++ ++ @Override ++ public boolean openURI(String url){ ++ ++ //make sure it's a valid URI ++ try{ ++ URI.create(url); ++ }catch(Exception wrong){ ++ return false; ++ } ++ ++ Threads.daemon(() -> { ++ if(OS.isMac){ ++ OS.execSafe("open", url); ++ }else if(OS.isLinux){ ++ OS.execSafe("xdg-open", url); ++ }else if(OS.isWindows){ ++ OS.execSafe("rundll32", "url.dll,FileProtocolHandler", url); ++ } ++ }); ++ return true; ++ } ++ ++ @Override ++ public Seq getListeners(){ ++ return listeners; ++ } ++ ++ @Override ++ public ApplicationType getType(){ ++ return ApplicationType.desktop; ++ } ++ ++ @Override ++ public String getClipboardText(){ ++ return SDL_GetClipboardText(); ++ } ++ ++ @Override ++ public void setClipboardText(String text){ ++ SDL_SetClipboardText(text); ++ } ++ ++ @Override ++ public void post(Runnable runnable){ ++ runnables.post(runnable); ++ } ++ ++ @Override ++ public void exit(){ ++ running = false; ++ } ++ ++ public static class SdlError extends RuntimeException{ ++ public SdlError(){ ++ super(SDL_GetError()); ++ } ++ } ++ ++ /** MacOS doesn't work when -XstartOnFirstThread is not passed, this will restart the program with that argument if it isn't already present. */ ++ @SuppressWarnings("unchecked") ++ private void restartMac(){ ++ try{ ++ Class mgmt = Class.forName("java.lang.management.ManagementFactory"); ++ Class beanClass = Class.forName("java.lang.management.RuntimeMXBean"); ++ Object bean = Reflect.invoke(mgmt, "getRuntimeMXBean"); ++ String id = ((String)beanClass.getMethod("getName").invoke(bean)).split("@")[0]; ++ ++ if(!OS.hasEnv("JAVA_STARTED_ON_FIRST_THREAD_" + id) || OS.env("JAVA_STARTED_ON_FIRST_THREAD_" + id).equals("0")){ //check if equal to 0 just in case ++ Log.warn("Applying -XstartOnFirstThread for macOS support."); ++ String javaPath = //attempt to locate java ++ new Fi(OS.prop("java.home")).child("bin/java").exists() ? new Fi(OS.prop("java.home")).child("bin/java").absolutePath() : ++ Core.files.local("jre/bin/java").exists() ? Core.files.local("jre/bin/java").absolutePath() : ++ "java"; ++ try{ ++ Fi jar = Fi.get(SdlApplication.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()); ++ Seq launchOptions = Seq.with(javaPath); ++ launchOptions.addAll((List)beanClass.getMethod("getInputArguments").invoke(bean)); ++ launchOptions.addAll(System.getProperties().entrySet().stream().map(it -> "-D" + it).toArray(String[]::new)); ++ launchOptions.addAll("-XstartOnFirstThread", "-jar", jar.absolutePath(), "-firstThread"); ++ ++ Process proc = new ProcessBuilder(launchOptions.toArray(String.class)).inheritIO().start(); ++ System.exit(proc.waitFor()); ++ }catch(IOException | URISyntaxException e){ //some part of this failed, likely failed to find java ++ Log.err(e); ++ Log.err("Failed to apply the -XstartOnFirstThread argument, it is required in order to work on mac."); ++ }catch(InterruptedException ignored){ ++ } ++ } ++ }catch(Exception ignored){ ++ } //likely using bundled java, do nothing as the arg is already added ++ } ++} diff --git a/patches/client/0038-API-VarsX.isLoader.patch b/patches/client/0038-API-VarsX.isLoader.patch index 25b88b86af5d..97f5e0002002 100644 --- a/patches/client/0038-API-VarsX.isLoader.patch +++ b/patches/client/0038-API-VarsX.isLoader.patch @@ -21,10 +21,10 @@ index 0000000000000000000000000000000000000000..69a28133bf43daa1b1e507ff5e2de415 + public static boolean isLoader = false; +} diff --git a/core/src/mindustryX/loader/Main.java b/core/src/mindustryX/loader/Main.java -index 47a2c48e09d85b8e919026b2ea72384999b36d0d..75f1eef377fc44f68733df95c8ddf554dd37d9bd 100644 +index ffe311d2a8e095c1e3262cdd2ede50ff42235c61..13344f03b3dd53e5de64b3bf2af376e6178614b3 100644 --- a/core/src/mindustryX/loader/Main.java +++ b/core/src/mindustryX/loader/Main.java -@@ -124,6 +124,7 @@ public class Main extends Mod{ +@@ -106,6 +106,7 @@ public class Main extends Mod{ Log.logger = new NoopLogHandler(); try{ Thread.currentThread().setContextClassLoader(classLoader); diff --git a/patches/client/0039-UI-Settings.patch b/patches/client/0039-UI-Settings.patch index 4eca835d4c7b..d44d601973e0 100644 --- a/patches/client/0039-UI-Settings.patch +++ b/patches/client/0039-UI-Settings.patch @@ -15,18 +15,18 @@ way-zer on 2024/5/3 API(Settings) toggle and cycle way-zer on 2024/7/1 --- - core/assets/bundles/bundle-mdtx.properties | 27 ++++++ - .../ui/dialogs/SettingsMenuDialog.java | 87 ++++++++++++++----- + core/assets/bundles/bundle-mdtx.properties | 37 ++++++++ + .../ui/dialogs/SettingsMenuDialog.java | 87 +++++++++++++----- core/src/mindustryX/Hooks.java | 2 + - core/src/mindustryX/features/Settings.java | 80 +++++++++++++++++ - 4 files changed, 172 insertions(+), 24 deletions(-) + core/src/mindustryX/features/Settings.java | 90 +++++++++++++++++++ + 4 files changed, 192 insertions(+), 24 deletions(-) create mode 100644 core/src/mindustryX/features/Settings.java diff --git a/core/assets/bundles/bundle-mdtx.properties b/core/assets/bundles/bundle-mdtx.properties -index 0cb666446175aa5e952ceaa07669e10a3a023d10..cc639cd1a79b62e9ac252efee35f01f10bfcdff7 100644 +index 0cb666446175aa5e952ceaa07669e10a3a023d10..623d778207282303a60e9efc99981131a99eb253 100644 --- a/core/assets/bundles/bundle-mdtx.properties +++ b/core/assets/bundles/bundle-mdtx.properties -@@ -40,3 +40,30 @@ stat.ammo_type = 子弹类型 +@@ -40,3 +40,40 @@ stat.ammo_type = 子弹类型 stat.ammo_capacity = 子弹容量 #end StatExt @@ -36,6 +36,10 @@ index 0cb666446175aa5e952ceaa07669e10a3a023d10..cc639cd1a79b62e9ac252efee35f01f1 +setting.showUpdateDialog.name = 检测到新版MindustryX时提示 +setting.githubMirror.name = GitHub镜像加速(WZ镜像) [gray]优化全球服务器列表及Mod浏览器功能 + ++category.gameSettings.name = 游戏界面或操作 ++setting.deadOverlay.name = 死亡时(观战)显示界面 ++setting.invertMapClick.name = 反转小地图的左右键点击 ++ +category.arcReWork.name = Arc功能重置 +setting.replayRecord.name = 多人游戏录像 [gray]自动录制游玩过程,输出在saves文件夹 +setting.menuFloatText.name = 首页悬浮文字 @@ -56,6 +60,12 @@ index 0cb666446175aa5e952ceaa07669e10a3a023d10..cc639cd1a79b62e9ac252efee35f01f1 +category.entitySettings.name = 实体相关设置 +setting.bulletShow.name = 显示子弹 +setting.showminebeam.name = 显示单位挖掘光束 ++setting.noPlayerHitBox.name = 取消玩家自身的碰撞 [gray]轻微作弊 ++setting.payloadpreview.name = 载荷单位拾起预览 ++ ++category.developerMode.name = 特殊设置 ++setting.renderMerge.name = 顶点合并渲染 [grey]实验性功能,可以减少Draws总数 ++setting.renderSort.name = 渲染排序 [grey]多图集(Mod较多)情况下能够提升50%渲染性能,但可能造成渲染错误 +#end Settings diff --git a/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java b/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java index 01f7c05a53a570163a1fd83dfd8783c80142ad8c..b93dced65be5c1eea38adc80f8dc2d84c2b3864d 100644 @@ -301,10 +311,10 @@ index 01d7b62ec79aaef21c2bd0bd7dfcc1dc072b057c..a1f9e743989ef91d28eb1dc17dc607e1 /** invoke after loading, just before `Mod::init` */ diff --git a/core/src/mindustryX/features/Settings.java b/core/src/mindustryX/features/Settings.java new file mode 100644 -index 0000000000000000000000000000000000000000..4c68c9f8d75a897dd636ac96b9d7a1b1a73cbf44 +index 0000000000000000000000000000000000000000..16e86681d53afc40025ca4376d490d1cb574b786 --- /dev/null +++ b/core/src/mindustryX/features/Settings.java -@@ -0,0 +1,80 @@ +@@ -0,0 +1,90 @@ +package mindustryX.features; + +import arc.*; @@ -339,6 +349,10 @@ index 0000000000000000000000000000000000000000..4c68c9f8d75a897dd636ac96b9d7a1b1 + c.checkPref("showUpdateDialog", true); + c.checkPref("githubMirror", false); + ++ c.addCategory("gameSettings"); ++ c.checkPref("deadOverlay", false); ++ c.checkPref("invertMapClick", false); ++ + c.addCategory("arcReWork"); + c.checkPref("replayRecord", false); + c.checkPref("menuFloatText", true); @@ -370,6 +384,12 @@ index 0000000000000000000000000000000000000000..4c68c9f8d75a897dd636ac96b9d7a1b1 + c.addCategory("entitySettings"); + c.checkPref("bulletShow", true); + c.checkPref("showMineBeam".toLowerCase(), true); ++ c.checkPref("noPlayerHitBox", false); ++ c.checkPref("payloadpreview", true); ++ ++ c.addCategory("developerMode"); ++ c.checkPref("renderMerge", true); ++ c.checkPref("renderSort", false); + })); + Events.on(ClientLoadEvent.class, e -> { + categories.each(LazySettingsCategory::init); diff --git a/patches/client/0040-ARC-bundle-and-settings.patch b/patches/client/0040-ARC-bundle-and-settings.patch index 690df3f12f6f..d6262a82c120 100644 --- a/patches/client/0040-ARC-bundle-and-settings.patch +++ b/patches/client/0040-ARC-bundle-and-settings.patch @@ -9,20 +9,20 @@ Content-Transfer-Encoding: 8bit 移除一些无效设置 way-zer on 2024/4/20 at 21:59 --- - core/assets/bundles/bundle-mdtx.properties | 239 ++++++++++++++++++ - .../ui/dialogs/SettingsMenuDialog.java | 28 +- - core/src/mindustryX/features/ArcOld.java | 222 ++++++++++++++++ + core/assets/bundles/bundle-mdtx.properties | 237 ++++++++++++++++++ + .../ui/dialogs/SettingsMenuDialog.java | 28 +-- + core/src/mindustryX/features/ArcOld.java | 221 ++++++++++++++++ core/src/mindustryX/features/Settings.java | 1 + - 4 files changed, 475 insertions(+), 15 deletions(-) + 4 files changed, 472 insertions(+), 15 deletions(-) create mode 100644 core/src/mindustryX/features/ArcOld.java diff --git a/core/assets/bundles/bundle-mdtx.properties b/core/assets/bundles/bundle-mdtx.properties -index cc639cd1a79b62e9ac252efee35f01f10bfcdff7..f08dd5fe6ce27c8cfbd277ecea0cb933542ec4a4 100644 +index 623d778207282303a60e9efc99981131a99eb253..70ed79fdf385216999a98244f5128f6c47e29d78 100644 --- a/core/assets/bundles/bundle-mdtx.properties +++ b/core/assets/bundles/bundle-mdtx.properties -@@ -67,3 +67,242 @@ category.entitySettings.name = 实体相关设置 - setting.bulletShow.name = 显示子弹 - setting.showminebeam.name = 显示单位挖掘光束 +@@ -77,3 +77,240 @@ category.developerMode.name = 特殊设置 + setting.renderMerge.name = 顶点合并渲染 [grey]实验性功能,可以减少Draws总数 + setting.renderSort.name = 渲染排序 [grey]多图集(Mod较多)情况下能够提升50%渲染性能,但可能造成渲染错误 #end Settings + +bar.reloadDetail = 装填:{0}% @@ -126,7 +126,6 @@ index cc639cd1a79b62e9ac252efee35f01f10bfcdff7..f08dd5fe6ce27c8cfbd277ecea0cb933 +category.arcStrongCheat.name = [red]强作弊功能 +category.arcWeakCheat.name = 弱作弊功能 +category.combat = 战斗 -+category.developerMode.name = 特殊设置 +category.moreContent.name = 更多内容适配 +category.movement = 移动 +category.personalized.name = 自定义客户端 [需要重启] @@ -168,7 +167,6 @@ index cc639cd1a79b62e9ac252efee35f01f10bfcdff7..f08dd5fe6ce27c8cfbd277ecea0cb933 +setting.arcCoreItemsCol.name = [acid]arc核心物资列数 +setting.arcDisableModWarning.name = [orange]我已知晓且同意学术端的mod使用原则 +setting.arcDrillProgress.name = [acid]钻头[white]:显示挖掘进度 [gray]只推荐mod下使用 -+setting.arcPlayerList.name = [acid]简化玩家列表 +setting.arcSelfName.name = [acid]显示自身名字 +setting.arcShareWaveInfo.name = [acid]游戏信息交流[gray](标记物品) [red]请勿刷屏 +setting.arcSpecificTable.name = [acid]学术端特制界面 [orange][重启生效] @@ -332,10 +330,10 @@ index b93dced65be5c1eea38adc80f8dc2d84c2b3864d..b71452eca5b3527f0c2ee15edd8d6ef0 diff --git a/core/src/mindustryX/features/ArcOld.java b/core/src/mindustryX/features/ArcOld.java new file mode 100644 -index 0000000000000000000000000000000000000000..bdae0373b7a37c73f60a5d9a6ad19285ad68a9f5 +index 0000000000000000000000000000000000000000..ad69511c62759552d9611ed901d0ef8bc4accbc8 --- /dev/null +++ b/core/src/mindustryX/features/ArcOld.java -@@ -0,0 +1,222 @@ +@@ -0,0 +1,221 @@ +package mindustryX.features; + +import arc.func.*; @@ -492,7 +490,6 @@ index 0000000000000000000000000000000000000000..bdae0373b7a37c73f60a5d9a6ad19285 + case 3 -> "全部记录"; + default -> s + ""; + }); -+ c.checkPref("arcPlayerList", true); + c.checkPref("ShowInfoPopup", true); + c.checkPref("arcShareWaveInfo", false); + c.checkPref("arcAlwaysTeamColor", false); @@ -559,12 +556,12 @@ index 0000000000000000000000000000000000000000..bdae0373b7a37c73f60a5d9a6ad19285 + } +} diff --git a/core/src/mindustryX/features/Settings.java b/core/src/mindustryX/features/Settings.java -index 4c68c9f8d75a897dd636ac96b9d7a1b1a73cbf44..02cb18ab5655c14c33680a50388e42d33fd2212f 100644 +index 16e86681d53afc40025ca4376d490d1cb574b786..e39fe4572259cc157de0351765ff7b6f75ad1696 100644 --- a/core/src/mindustryX/features/Settings.java +++ b/core/src/mindustryX/features/Settings.java -@@ -64,6 +64,7 @@ public class Settings{ - c.checkPref("bulletShow", true); - c.checkPref("showMineBeam".toLowerCase(), true); +@@ -74,6 +74,7 @@ public class Settings{ + c.checkPref("renderMerge", true); + c.checkPref("renderSort", false); })); + ArcOld.init(categories); Events.on(ClientLoadEvent.class, e -> { diff --git a/patches/client/0059-OC-Batch.patch b/patches/client/0059-OC-Batch.patch index 7b3af703b8c3..afe0956257eb 100644 --- a/patches/client/0059-OC-Batch.patch +++ b/patches/client/0059-OC-Batch.patch @@ -19,38 +19,13 @@ way-zer on 2024/5/28 新功能:顶点合并 way-zer on 2024/7/23 --- - core/assets/bundles/bundle-mdtx.properties | 5 +- .../arc/graphics/g2d/MySortedSpriteBatch.java | 237 ++++++- .../arc/graphics/g2d/SortedSpriteBatch2.java | 668 ++++++++++++++++++ core/src/mindustry/graphics/MultiPacker.java | 2 +- core/src/mindustryX/features/RenderExt.java | 3 + - core/src/mindustryX/features/Settings.java | 4 + - 6 files changed, 915 insertions(+), 4 deletions(-) + 4 files changed, 907 insertions(+), 3 deletions(-) create mode 100644 core/src/arc/graphics/g2d/SortedSpriteBatch2.java -diff --git a/core/assets/bundles/bundle-mdtx.properties b/core/assets/bundles/bundle-mdtx.properties -index f08dd5fe6ce27c8cfbd277ecea0cb933542ec4a4..b7f9b825de0e7b5b0ba72b5fcb294552523bcf50 100644 ---- a/core/assets/bundles/bundle-mdtx.properties -+++ b/core/assets/bundles/bundle-mdtx.properties -@@ -66,6 +66,10 @@ setting.blockRenderLevel.name = [cyan]建筑渲染等级 - category.entitySettings.name = 实体相关设置 - setting.bulletShow.name = 显示子弹 - setting.showminebeam.name = 显示单位挖掘光束 -+ -+category.developerMode.name = 特殊设置 -+setting.renderMerge.name = 顶点合并渲染 [grey]实验性功能,可以减少Draws总数 -+setting.renderSort.name = 渲染排序 [grey]多图集(Mod较多)情况下能够提升50%渲染性能,但可能造成渲染错误 - #end Settings - - bar.reloadDetail = 装填:{0}% -@@ -169,7 +173,6 @@ category.arcShareinfo.name = 多人游玩设置 - category.arcStrongCheat.name = [red]强作弊功能 - category.arcWeakCheat.name = 弱作弊功能 - category.combat = 战斗 --category.developerMode.name = 特殊设置 - category.moreContent.name = 更多内容适配 - category.movement = 移动 - category.personalized.name = 自定义客户端 [需要重启] diff --git a/core/src/arc/graphics/g2d/MySortedSpriteBatch.java b/core/src/arc/graphics/g2d/MySortedSpriteBatch.java index feca84a8eec0f7d514f9aa6be6f82134d8622721..9f56c24264dcb7d0ccc5db464d6d6deaa1d08f20 100644 --- a/core/src/arc/graphics/g2d/MySortedSpriteBatch.java @@ -1022,18 +997,3 @@ index 7b5d21f77cd8d15d0541cd70a051aad660c21e1d..e3721adf4c7e215ef3b944512d460892 }); Events.run(Trigger.draw, RenderExt::draw); Events.on(TileChangeEvent.class, RenderExt::onSetBlock); -diff --git a/core/src/mindustryX/features/Settings.java b/core/src/mindustryX/features/Settings.java -index 02cb18ab5655c14c33680a50388e42d33fd2212f..5d9c0d3a96c0cce4ffec16b8eadf1d8d9c3f6541 100644 ---- a/core/src/mindustryX/features/Settings.java -+++ b/core/src/mindustryX/features/Settings.java -@@ -63,6 +63,10 @@ public class Settings{ - c.addCategory("entitySettings"); - c.checkPref("bulletShow", true); - c.checkPref("showMineBeam".toLowerCase(), true); -+ -+ c.addCategory("developerMode"); -+ c.checkPref("renderMerge", true); -+ c.checkPref("renderSort", false); - })); - ArcOld.init(categories); - Events.on(ClientLoadEvent.class, e -> { diff --git a/patches/client/0063-UI-Mod-Mod.patch b/patches/client/0063-UI-Mod-Mod.patch index e3b7f64ce24e..4d4b2a67a755 100644 --- a/patches/client/0063-UI-Mod-Mod.patch +++ b/patches/client/0063-UI-Mod-Mod.patch @@ -18,7 +18,7 @@ Content-Transfer-Encoding: 8bit create mode 100644 core/src/mindustryX/features/ui/ModsRecommendDialog.java diff --git a/core/assets/bundles/bundle-mdtx.properties b/core/assets/bundles/bundle-mdtx.properties -index b7f9b825de0e7b5b0ba72b5fcb294552523bcf50..7e2e9c0bb009a9a6360427178fd7f2c3759481ca 100644 +index 70ed79fdf385216999a98244f5128f6c47e29d78..989e676d2245033c74693fe84e91ad6876ebd6d4 100644 --- a/core/assets/bundles/bundle-mdtx.properties +++ b/core/assets/bundles/bundle-mdtx.properties @@ -1,3 +1,22 @@ diff --git a/patches/client/0066-UI-HudSettingsTable-AdvanceBuildTool.patch b/patches/client/0066-UI-HudSettingsTable-AdvanceBuildTool.patch index b2fa94ddf4d4..b0bf035aca5b 100644 --- a/patches/client/0066-UI-HudSettingsTable-AdvanceBuildTool.patch +++ b/patches/client/0066-UI-HudSettingsTable-AdvanceBuildTool.patch @@ -52,7 +52,7 @@ index 7664e5cd240e9e933373cbd1a3eeb382886e94f8..1a33e4f6c9509d0b34422eb360687ffc public static void buildPositionRow(Table tt, Vec2 vec){ diff --git a/core/src/mindustryX/features/ui/AdvanceBuildTool.java b/core/src/mindustryX/features/ui/AdvanceBuildTool.java new file mode 100644 -index 0000000000000000000000000000000000000000..7ba0a9616e783872f93fb28e4d7a366071db0b6c +index 0000000000000000000000000000000000000000..1a8bcf05dc875853598e50841f1558a9d41733a3 --- /dev/null +++ b/core/src/mindustryX/features/ui/AdvanceBuildTool.java @@ -0,0 +1,377 @@ @@ -131,7 +131,7 @@ index 0000000000000000000000000000000000000000..7ba0a9616e783872f93fb28e4d7a3660 + }).tooltip("[cyan]玩家建造区").size(30f); + tt.update(() -> { + if(placement != BuildRange.zone) return; -+ FuncX.drawText(selection.getCenter(Tmp.v1).scl(tilesize), "建造区域", Scl.scl(1.25f), Color.white, Align.bottom); ++ FuncX.drawText(selection.getCenter(Tmp.v1).scl(tilesize), "建造区域", Scl.scl(1.25f), Color.white); + Draw.color(Pal.stat, 0.7f); + Draw.z(Layer.effect - 1f); + Lines.stroke(Math.min(Math.abs(width), Math.abs(height)) / tilesize / 10f); diff --git a/patches/client/0072-C-Editor.patch b/patches/client/0072-C-Editor.patch index 8f5b41a76e03..96aa29c7fc7e 100644 --- a/patches/client/0072-C-Editor.patch +++ b/patches/client/0072-C-Editor.patch @@ -18,10 +18,10 @@ Content-Transfer-Encoding: 8bit 7 files changed, 64 insertions(+), 22 deletions(-) diff --git a/core/assets/bundles/bundle-mdtx.properties b/core/assets/bundles/bundle-mdtx.properties -index 7e2e9c0bb009a9a6360427178fd7f2c3759481ca..4b2dfebc198217e2ae699c405edfa501b5f15a19 100644 +index 989e676d2245033c74693fe84e91ad6876ebd6d4..d18879584d2b1e32b0de38b8a3ff783f3a1a7bd8 100644 --- a/core/assets/bundles/bundle-mdtx.properties +++ b/core/assets/bundles/bundle-mdtx.properties -@@ -91,6 +91,11 @@ setting.renderMerge.name = 顶点合并渲染 [grey]实验性功能,可以减 +@@ -97,6 +97,11 @@ setting.renderMerge.name = 顶点合并渲染 [grey]实验性功能,可以减 setting.renderSort.name = 渲染排序 [grey]多图集(Mod较多)情况下能够提升50%渲染性能,但可能造成渲染错误 #end Settings diff --git a/patches/client/0074-C.patch b/patches/client/0074-C.patch index 788beea9e467..55d8288dc696 100644 --- a/patches/client/0074-C.patch +++ b/patches/client/0074-C.patch @@ -8,23 +8,9 @@ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- - core/assets/bundles/bundle-mdtx.properties | 1 + core/src/mindustry/async/PhysicsProcess.java | 3 +++ - core/src/mindustryX/features/Settings.java | 1 + - 3 files changed, 5 insertions(+) + 1 file changed, 3 insertions(+) -diff --git a/core/assets/bundles/bundle-mdtx.properties b/core/assets/bundles/bundle-mdtx.properties -index 4b2dfebc198217e2ae699c405edfa501b5f15a19..c76acc18976cedb47ca58b75cdf2074ec7224f4f 100644 ---- a/core/assets/bundles/bundle-mdtx.properties -+++ b/core/assets/bundles/bundle-mdtx.properties -@@ -85,6 +85,7 @@ setting.blockRenderLevel.name = [cyan]建筑渲染等级 - category.entitySettings.name = 实体相关设置 - setting.bulletShow.name = 显示子弹 - setting.showminebeam.name = 显示单位挖掘光束 -+setting.noPlayerHitBox.name = 取消玩家自身的碰撞 [gray]轻微作弊 - - category.developerMode.name = 特殊设置 - setting.renderMerge.name = 顶点合并渲染 [grey]实验性功能,可以减少Draws总数 diff --git a/core/src/mindustry/async/PhysicsProcess.java b/core/src/mindustry/async/PhysicsProcess.java index 183d1262177761cb378642575c9c35851d84eef4..8c73d7de9c79561d83b5261fa91692aef1eff361 100644 --- a/core/src/mindustry/async/PhysicsProcess.java @@ -45,15 +31,3 @@ index 183d1262177761cb378642575c9c35851d84eef4..8c73d7de9c79561d83b5261fa91692ae //move by delta entity.move(ref.body.x - ref.x, ref.body.y - ref.y); } -diff --git a/core/src/mindustryX/features/Settings.java b/core/src/mindustryX/features/Settings.java -index 5d9c0d3a96c0cce4ffec16b8eadf1d8d9c3f6541..0de45982c600cbd45ca33f964a7b8e21aa7b7115 100644 ---- a/core/src/mindustryX/features/Settings.java -+++ b/core/src/mindustryX/features/Settings.java -@@ -63,6 +63,7 @@ public class Settings{ - c.addCategory("entitySettings"); - c.checkPref("bulletShow", true); - c.checkPref("showMineBeam".toLowerCase(), true); -+ c.checkPref("noPlayerHitBox", false); - - c.addCategory("developerMode"); - c.checkPref("renderMerge", true); diff --git a/patches/client/0078-C-RenderExt-drawBars.patch b/patches/client/0078-ARC-bundle-and-settings.patch similarity index 87% rename from patches/client/0078-C-RenderExt-drawBars.patch rename to patches/client/0078-ARC-bundle-and-settings.patch index 16f68d8d8d2a..5c1a15b35c73 100644 --- a/patches/client/0078-C-RenderExt-drawBars.patch +++ b/patches/client/0078-ARC-bundle-and-settings.patch @@ -1,26 +1,30 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: way-zer Date: Wed, 5 Jun 2024 23:26:51 +0800 -Subject: [PATCH] C(RenderExt) drawBars +Subject: [PATCH] ARC bundle and settings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +移除一些无效设置 +way-zer on 2024/4/20 at 21:59 --- - core/src/mindustryX/features/RenderExt.java | 56 +++++++++++++++++++++ - 1 file changed, 56 insertions(+) + core/src/mindustryX/features/RenderExt.java | 55 +++++++++++++++++++++ + 1 file changed, 55 insertions(+) diff --git a/core/src/mindustryX/features/RenderExt.java b/core/src/mindustryX/features/RenderExt.java -index d4a39291133a960b3dc42e76d77d881ee2cf5539..6095f9a83f0d5ed190d5f814972570dfa2678b98 100644 +index d4a39291133a960b3dc42e76d77d881ee2cf5539..038ce925395842f49a603c6b226c3210b0370543 100644 --- a/core/src/mindustryX/features/RenderExt.java +++ b/core/src/mindustryX/features/RenderExt.java -@@ -6,6 +6,8 @@ import arc.graphics.g2d.*; +@@ -6,6 +6,7 @@ import arc.graphics.g2d.*; import arc.math.*; import arc.math.geom.*; import arc.util.*; +import mindustry.*; -+import mindustry.arcModule.draw.*; import mindustry.entities.*; import mindustry.game.EventType.*; import mindustry.gen.*; -@@ -19,6 +21,7 @@ import mindustry.world.blocks.logic.*; +@@ -19,6 +20,7 @@ import mindustry.world.blocks.logic.*; import mindustry.world.blocks.logic.MessageBlock.*; import mindustry.world.blocks.production.Drill.*; import mindustry.world.blocks.storage.*; @@ -28,7 +32,7 @@ index d4a39291133a960b3dc42e76d77d881ee2cf5539..6095f9a83f0d5ed190d5f814972570df import static mindustry.Vars.tilesize; -@@ -35,6 +38,8 @@ public class RenderExt{ +@@ -35,6 +37,8 @@ public class RenderExt{ public static boolean renderSort, renderMerge; public static boolean massDriverLine; public static int massDriverLineInterval; @@ -37,7 +41,7 @@ index d4a39291133a960b3dc42e76d77d881ee2cf5539..6095f9a83f0d5ed190d5f814972570df public static boolean unitHide = false; public static Color massDriverLineColor = Color.clear; -@@ -71,6 +76,9 @@ public class RenderExt{ +@@ -71,6 +75,9 @@ public class RenderExt{ renderMerge = Core.settings.getBool("renderMerge"); massDriverLine = Core.settings.getBool("mass_driver_line"); massDriverLineInterval = Core.settings.getInt("mass_driver_line_interval"); @@ -47,7 +51,7 @@ index d4a39291133a960b3dc42e76d77d881ee2cf5539..6095f9a83f0d5ed190d5f814972570df }); Events.run(Trigger.draw, RenderExt::draw); Events.on(TileChangeEvent.class, RenderExt::onSetBlock); -@@ -94,6 +102,8 @@ public class RenderExt{ +@@ -94,6 +101,8 @@ public class RenderExt{ arcDrillModeDraw(block, drill); if(massDriverLine && build instanceof MassDriverBuild b) drawMassDriverLine(b); @@ -56,7 +60,7 @@ index d4a39291133a960b3dc42e76d77d881ee2cf5539..6095f9a83f0d5ed190d5f814972570df } private static void placementEffect(float x, float y, float lifetime, float range, Color color){ -@@ -154,4 +164,50 @@ public class RenderExt{ +@@ -154,4 +163,50 @@ public class RenderExt{ } } } diff --git a/patches/client/0081-PICK.patch b/patches/client/0081-PICK.patch index a4866967197d..a25bf80dac04 100644 --- a/patches/client/0081-PICK.patch +++ b/patches/client/0081-PICK.patch @@ -11,10 +11,10 @@ Content-Transfer-Encoding: 8bit 1 file changed, 167 insertions(+), 31 deletions(-) diff --git a/core/assets/bundles/bundle-mdtx.properties b/core/assets/bundles/bundle-mdtx.properties -index c76acc18976cedb47ca58b75cdf2074ec7224f4f..c9d85c54a4f34c997dee0bfa6f5de208be290b52 100644 +index d18879584d2b1e32b0de38b8a3ff783f3a1a7bd8..a1929a161bc6f75df101c80e99975824b102fa81 100644 --- a/core/assets/bundles/bundle-mdtx.properties +++ b/core/assets/bundles/bundle-mdtx.properties -@@ -97,6 +97,172 @@ toolmode.square2 = 方形(直径) +@@ -102,6 +102,172 @@ toolmode.square2 = 方形(直径) toolmode.square2.description = 同2方形。但大小为直径(延续学术端功能) #end editor增强 @@ -187,7 +187,7 @@ index c76acc18976cedb47ca58b75cdf2074ec7224f4f..c9d85c54a4f34c997dee0bfa6f5de208 bar.reloadDetail = 装填:{0}% bar.warmupDetail = 充能:{0}% bar.ammoDetail = 弹药:{0}/{1} -@@ -115,7 +281,6 @@ keybind.toggle_unit.name = 切换单位显示 +@@ -120,7 +286,6 @@ keybind.toggle_unit.name = 切换单位显示 # 学术特色翻译 ability.energyfield.maxtargets = [lightgray]最大目标: [white]{0} ability.energyfield.sametypehealmultiplier = [lightgray]同类回复: [white]{0}% @@ -195,7 +195,7 @@ index c76acc18976cedb47ca58b75cdf2074ec7224f4f..c9d85c54a4f34c997dee0bfa6f5de208 bar.drilltierreq = 需要{0}级的钻头(当前{1}级) bar.heatpercent = 热量: {0} [lightgray]({1}%) bar.powerbalance = 电力:{0}/s -@@ -132,50 +297,21 @@ block.reinforced-liquid-router.name = 强化液体路由器 +@@ -137,50 +302,21 @@ block.reinforced-liquid-router.name = 强化液体路由器 block.reinforced-liquid-tank.name = 强化储液罐 block.shield-projector.name = 护盾投影 block.underflow-duct.name = 反溢运输管 diff --git a/patches/client/0084-API-FuncX-drawText.patch b/patches/client/0084-API-FuncX-drawText.patch index b75b898650b6..2666884eb4ef 100644 --- a/patches/client/0084-API-FuncX-drawText.patch +++ b/patches/client/0084-API-FuncX-drawText.patch @@ -4,16 +4,16 @@ Date: Sat, 15 Jun 2024 20:22:04 +0800 Subject: [PATCH] API(FuncX) drawText --- - core/src/mindustryX/features/func/drawText.kt | 55 +++++++++++++++++++ - 1 file changed, 55 insertions(+) + core/src/mindustryX/features/func/drawText.kt | 59 +++++++++++++++++++ + 1 file changed, 59 insertions(+) create mode 100644 core/src/mindustryX/features/func/drawText.kt diff --git a/core/src/mindustryX/features/func/drawText.kt b/core/src/mindustryX/features/func/drawText.kt new file mode 100644 -index 0000000000000000000000000000000000000000..c06cefa011eaf3eadecfa3decb0ace0150cfd81f +index 0000000000000000000000000000000000000000..8278810706e76db2054c2a51e58945d9dc057d46 --- /dev/null +++ b/core/src/mindustryX/features/func/drawText.kt -@@ -0,0 +1,55 @@ +@@ -0,0 +1,59 @@ +@file:JvmName("FuncX") + +package mindustryX.features.func @@ -38,12 +38,10 @@ index 0000000000000000000000000000000000000000..c06cefa011eaf3eadecfa3decb0ace01 +@JvmOverloads +fun drawText( + pos: Position, text: String, -+ fontScl: Float = 1f, color: Color = Color.white, align: Int = Align.center, ++ fontScl: Float = 1f, color: Color = Color.white, anchor: Int = Align.center, + font: Font = Fonts.outline, background: Boolean = false, +) { -+ Tmp.v1.set(pos) -+ val x = Tmp.v1.x -+ var y = Tmp.v1.y ++ val p = Tmp.v1.set(pos) + //参考来源 mindustry.gen.WorldLabel.drawAt + val z = Drawf.text() + val ints = font.usesIntegerPositions() @@ -53,15 +51,21 @@ index 0000000000000000000000000000000000000000..c06cefa011eaf3eadecfa3decb0ace01 + + Pools.obtain(GlyphLayout::class.java, ::GlyphLayout).apply { + setText(font, text) -+ if (Align.isTop(align)) y += height -+ else if (Align.isCenterVertical(align)) y += height / 2 ++ ++ if (Align.isCenterVertical(anchor)) p.y += height / 2 ++ else if (Align.isBottom(anchor)) p.y += height ++ var centerX = p.x ++ if (Align.isLeft(anchor)) centerX += width / 2 ++ else if (Align.isRight(anchor)) centerX -= width / 2 + if (background) { + Draw.color(Color.black, 0.3f) -+ Fill.rect(x, y - height / 2, width + 2, height + 3) ++ Fill.rect(centerX, p.y - height / 2, width + 2, height + 3) + Draw.color() + } + }.let(Pools::free) -+ font.draw(text, pos.x, pos.y, 0f, Align.center, false) ++ val align = if (Align.isCenterHorizontal(anchor)) anchor or Align.center else anchor ++ //此次x为绘制区域顶部 ++ font.draw(text, p.x, p.y, 0f, align, false) + Draw.reset() + + font.color.set(Color.white) diff --git a/patches/client/0085-C-RenderExt-playerEffectColor.patch b/patches/client/0085-C-RenderExt-playerEffectColor.patch index 8ff285c99471..230ce6782fa5 100644 --- a/patches/client/0085-C-RenderExt-playerEffectColor.patch +++ b/patches/client/0085-C-RenderExt-playerEffectColor.patch @@ -9,7 +9,7 @@ Subject: [PATCH] C(RenderExt) playerEffectColor 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/core/src/mindustryX/features/ArcOld.java b/core/src/mindustryX/features/ArcOld.java -index bdae0373b7a37c73f60a5d9a6ad19285ad68a9f5..d498b911575861c53dcefe39434c3593fa594a4c 100644 +index ad69511c62759552d9611ed901d0ef8bc4accbc8..17009f955dd1f407bdfa3c9731daba67df6388d2 100644 --- a/core/src/mindustryX/features/ArcOld.java +++ b/core/src/mindustryX/features/ArcOld.java @@ -127,7 +127,17 @@ public class ArcOld{ @@ -32,10 +32,10 @@ index bdae0373b7a37c73f60a5d9a6ad19285ad68a9f5..d498b911575861c53dcefe39434c3593 case 0 -> "关闭"; case 1 -> "虚圆"; diff --git a/core/src/mindustryX/features/RenderExt.java b/core/src/mindustryX/features/RenderExt.java -index 6095f9a83f0d5ed190d5f814972570dfa2678b98..f90dc699fdf4e83af3011322042315a081f9f2bc 100644 +index 038ce925395842f49a603c6b226c3210b0370543..e499bbee122b00d8a094df477924677a91b50323 100644 --- a/core/src/mindustryX/features/RenderExt.java +++ b/core/src/mindustryX/features/RenderExt.java -@@ -43,6 +43,7 @@ public class RenderExt{ +@@ -42,6 +42,7 @@ public class RenderExt{ public static boolean unitHide = false; public static Color massDriverLineColor = Color.clear; diff --git a/patches/client/0087-UI-ARC-logic-Support.patch b/patches/client/0087-UI-ARC-logic-Support.patch index f91dd0765722..f4ef6bf8ee41 100644 --- a/patches/client/0087-UI-ARC-logic-Support.patch +++ b/patches/client/0087-UI-ARC-logic-Support.patch @@ -19,9 +19,9 @@ way-zer on 2024/7/14 core/src/mindustry/logic/LExecutor.java | 19 +- core/src/mindustry/logic/LStatements.java | 12 + core/src/mindustry/logic/LogicDialog.java | 237 +++++++++++++++--- - .../world/blocks/logic/LogicBlock.java | 49 +++- + .../world/blocks/logic/LogicBlock.java | 55 +++- .../world/blocks/logic/MemoryBlock.java | 52 ++++ - 6 files changed, 371 insertions(+), 52 deletions(-) + 6 files changed, 374 insertions(+), 55 deletions(-) diff --git a/core/src/mindustry/logic/LCanvas.java b/core/src/mindustry/logic/LCanvas.java index 04871c02fbee810619980a87a36a5f60a9a5d43a..6f155e70c3a59c60517878d48372fe94da087dcc 100644 @@ -523,7 +523,7 @@ index d36a66ee6b5f32938f8f8e6e4cec2e3bf3103a37..0428aae26c9151b78ad3d4b2257300a6 canvas.rebuild(); canvas.privileged = privileged; diff --git a/core/src/mindustry/world/blocks/logic/LogicBlock.java b/core/src/mindustry/world/blocks/logic/LogicBlock.java -index 261b6374360c2cbae88f44aa441f55706c181936..b34e84904c0dff843f0d962c3661f0ddc961762f 100644 +index 261b6374360c2cbae88f44aa441f55706c181936..2ba5ec93717c2b50861da88513bbc5641f029d3a 100644 --- a/core/src/mindustry/world/blocks/logic/LogicBlock.java +++ b/core/src/mindustry/world/blocks/logic/LogicBlock.java @@ -27,6 +27,7 @@ import mindustry.world.blocks.ConstructBlock.*; @@ -534,15 +534,6 @@ index 261b6374360c2cbae88f44aa441f55706c181936..b34e84904c0dff843f0d962c3661f0dd import java.io.*; import java.util.zip.*; -@@ -114,7 +115,7 @@ public class LogicBlock extends Block{ - } - - public boolean accessible(){ -- return !privileged || state.rules.editor || state.playtestingMap != null; -+ return !privileged || state.rules.editor || state.playtestingMap != null || RenderExt.showOtherInfo; - } - - @Override @@ -260,6 +261,8 @@ public class LogicBlock extends Block{ public @Nullable String tag; public char iconTag; @@ -552,7 +543,25 @@ index 261b6374360c2cbae88f44aa441f55706c181936..b34e84904c0dff843f0d962c3661f0dd /** Block of code to run after load. */ public @Nullable Runnable loadBlock; -@@ -583,10 +586,12 @@ public class LogicBlock extends Block{ +@@ -424,7 +427,7 @@ public class LogicBlock extends Block{ + + @Override + public boolean displayable(){ +- return accessible(); ++ return accessible() || RenderExt.showOtherInfo; + } + + @Override +@@ -447,7 +450,7 @@ public class LogicBlock extends Block{ + + @Override + public Cursor getCursor(){ +- return !accessible() ? SystemCursor.arrow : super.getCursor(); ++ return !accessible() && !RenderExt.showOtherInfo ? SystemCursor.arrow : super.getCursor(); + } + + //logic blocks cause write problems when picked up +@@ -583,17 +586,19 @@ public class LogicBlock extends Block{ } //draw top text on separate layer @@ -566,7 +575,21 @@ index 261b6374360c2cbae88f44aa441f55706c181936..b34e84904c0dff843f0d962c3661f0dd } } } -@@ -645,7 +650,45 @@ public class LogicBlock extends Block{ + + @Override + public void drawSelect(){ +- if(!accessible()) return; ++ if(!accessible() && !RenderExt.showOtherInfo) return; + + Groups.unit.each(u -> u.controller() instanceof LogicAI ai && ai.controller == this, unit -> { + Drawf.square(unit.x, unit.y, unit.hitSize, unit.rotation + 45); +@@ -640,12 +645,50 @@ public class LogicBlock extends Block{ + + @Override + public boolean shouldShowConfigure(Player player){ +- return accessible(); ++ return accessible() || RenderExt.showOtherInfo; + } @Override public void buildConfiguration(Table table){ @@ -574,7 +597,7 @@ index 261b6374360c2cbae88f44aa441f55706c181936..b34e84904c0dff843f0d962c3661f0dd + table.setBackground(Styles.black3); + Table vars = new Table(); + table.table(t -> { -+ t.button(Icon.pencil, Styles.cleari, this::showEditDialog).size(40); ++ t.button(Icon.pencil, Styles.cleari, () -> showEditDialog(RenderExt.showOtherInfo)).size(40); + t.button(Icon.copy, Styles.cleari, () -> { + Core.app.setClipboardText(code); + UIExt.announce("已复制逻辑"); diff --git a/patches/client/0088-C-Portable-Data-Dir.patch b/patches/client/0088-C-Portable-Data-Dir.patch index 2c732efd7560..de4d6706e073 100644 --- a/patches/client/0088-C-Portable-Data-Dir.patch +++ b/patches/client/0088-C-Portable-Data-Dir.patch @@ -8,15 +8,15 @@ Subject: [PATCH] C: Portable Data Dir 1 file changed, 3 insertions(+) diff --git a/core/src/mindustry/ClientLauncher.java b/core/src/mindustry/ClientLauncher.java -index 7c897514ef279333ed007b17a7b4c242880d8b22..ddc6e4171a58f4b344b48934c16882606b6421ab 100644 +index 7c897514ef279333ed007b17a7b4c242880d8b22..cad052077f8431c7011cdddd4d4589ee39479de7 100644 --- a/core/src/mindustry/ClientLauncher.java +++ b/core/src/mindustry/ClientLauncher.java @@ -37,6 +37,9 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform @Override public void setup(){ String dataDir = OS.env("MINDUSTRY_DATA_DIR"); -+ if(app.isDesktop() && dataDir == null && Fi.get("config").isDirectory()){ -+ dataDir = "config"; ++ if(app.isDesktop() && dataDir == null && Fi.get("data").isDirectory()){ ++ dataDir = "data"; + } if(dataDir != null){ Core.settings.setDataDirectory(files.absolute(dataDir)); diff --git a/patches/client/0091-OC-Fonts.patch b/patches/client/0091-OC-Fonts.patch new file mode 100644 index 000000000000..057817b55c89 --- /dev/null +++ b/patches/client/0091-OC-Fonts.patch @@ -0,0 +1,119 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: way-zer +Date: Sun, 28 Jul 2024 14:16:29 +0800 +Subject: [PATCH] =?UTF-8?q?OC:=20=E6=95=B4=E7=90=86Fonts=E7=B1=BB?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +更好的字体包支持 +--- + core/src/mindustry/ClientLauncher.java | 6 ++---- + core/src/mindustry/core/UI.java | 4 ---- + core/src/mindustry/ui/Fonts.java | 30 ++++++++++++++------------ + 3 files changed, 18 insertions(+), 22 deletions(-) + +diff --git a/core/src/mindustry/ClientLauncher.java b/core/src/mindustry/ClientLauncher.java +index cad052077f8431c7011cdddd4d4589ee39479de7..5b2a85a3999ffe602e127a016497e683c5aea49e 100644 +--- a/core/src/mindustry/ClientLauncher.java ++++ b/core/src/mindustry/ClientLauncher.java +@@ -150,10 +150,8 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform + + assets.load(new Vars()); + +- Fonts.loadDefaultFont(); +- + //load fallback atlas if max texture size is below 4096 +- assets.load(new AssetDescriptor<>(maxTextureSize >= 4096 ? "sprites/sprites.aatls" : "sprites/fallback/sprites.aatls", TextureAtlas.class)).loaded = t -> atlas = t; ++ assets.load(maxTextureSize >= 4096 ? "sprites/sprites.aatls" : "sprites/fallback/sprites.aatls", TextureAtlas.class).loaded = t -> atlas = t; + assets.loadRun("maps", Map.class, () -> maps.loadPreviews()); + + Musics.load(); +@@ -168,11 +166,11 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform + }); + + assets.load(mods); +- assets.loadRun("mergeUI", PixmapPacker.class, () -> {}, () -> Fonts.mergeFontAtlas(atlas)); + + add(logic = new Logic()); + add(control = new Control()); + add(renderer = new Renderer()); ++ Fonts.loadFonts(); + add(ui = new UI()); + add(netServer = new NetServer()); + add(netClient = new NetClient()); +diff --git a/core/src/mindustry/core/UI.java b/core/src/mindustry/core/UI.java +index 34ac2770a91fb02b7500fe46ec12f47bc384a061..39deed997df547bf6fe986fe39643209ca99b0ce 100644 +--- a/core/src/mindustry/core/UI.java ++++ b/core/src/mindustry/core/UI.java +@@ -82,10 +82,6 @@ public class UI implements ApplicationListener, Loadable{ + + private @Nullable Element lastAnnouncement; + +- public UI(){ +- Fonts.loadFonts(); +- } +- + public static void loadColors(){ + Colors.put("accent", Pal.accent); + Colors.put("unlaunched", Color.valueOf("8982ed")); +diff --git a/core/src/mindustry/ui/Fonts.java b/core/src/mindustry/ui/Fonts.java +index c02e09ff53a80aaf540223828208ad86b96d4bec..916b2ba5102ef670704e64a1f058c477c992d6dc 100644 +--- a/core/src/mindustry/ui/Fonts.java ++++ b/core/src/mindustry/ui/Fonts.java +@@ -61,11 +61,25 @@ public class Fonts{ + } + + public static void loadFonts(){ ++ loadDefaultFont(); + largeIcons.clear(); + FreeTypeFontParameter param = fontParameter(); + + Core.assets.load("default", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = f -> Fonts.def = f; + ++ Core.assets.load("outline", Font.class, new FreeTypeFontLoaderParameter(mainFont, new FreeTypeFontParameter(){{ ++ borderColor = Color.darkGray; ++ incremental = true; ++ size = 18; ++ }})).loaded = t -> Fonts.outline = t; ++ ++ Core.assets.load("tech", Font.class, new FreeTypeFontLoaderParameter("fonts/tech.ttf", new FreeTypeFontParameter(){{ ++ size = 18; ++ }})).loaded = f -> { ++ Fonts.tech = f; ++ Fonts.tech.getData().down *= 1.5f; ++ }; ++ + Core.assets.load("icon", Font.class, new FreeTypeFontLoaderParameter("fonts/icon.ttf", new FreeTypeFontParameter(){{ + size = 30; + incremental = true; +@@ -87,6 +101,8 @@ public class Fonts{ + //ASCII only + characters = "\0ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\"!`?'.,;:()[]{}<>|/@\\^$€-%+=#_&~*"; + }})).loaded = f -> Fonts.logic = f; ++ ++ Core.assets.loadRun("mergeUI", PixmapPacker.class, () -> {}, () -> Fonts.mergeFontAtlas(Core.atlas)); + } + + public static @Nullable String unicodeToName(int unicode){ +@@ -209,20 +225,6 @@ public class Fonts{ + } + }); + +- FreeTypeFontParameter param = new FreeTypeFontParameter(){{ +- borderColor = Color.darkGray; +- incremental = true; +- size = 18; +- }}; +- +- Core.assets.load("outline", Font.class, new FreeTypeFontLoaderParameter(mainFont, param)).loaded = t -> Fonts.outline = t; +- +- Core.assets.load("tech", Font.class, new FreeTypeFontLoaderParameter("fonts/tech.ttf", new FreeTypeFontParameter(){{ +- size = 18; +- }})).loaded = f -> { +- Fonts.tech = f; +- Fonts.tech.getData().down *= 1.5f; +- }; + } + + /** Merges the UI and font atlas together for better performance. */ diff --git a/patches/client/0092-FC-RenderExt-payloadPreview.patch b/patches/client/0092-FC-RenderExt-payloadPreview.patch new file mode 100644 index 000000000000..1a94c5d58bec --- /dev/null +++ b/patches/client/0092-FC-RenderExt-payloadPreview.patch @@ -0,0 +1,138 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: way-zer +Date: Fri, 2 Aug 2024 23:32:56 +0800 +Subject: [PATCH] FC(RenderExt) payloadPreview + +--- + core/src/mindustryX/features/RenderExt.java | 7 +- + .../features/draw/PayloadDropHint.java | 81 +++++++++++++++++++ + 2 files changed, 86 insertions(+), 2 deletions(-) + create mode 100644 core/src/mindustryX/features/draw/PayloadDropHint.java + +diff --git a/core/src/mindustryX/features/RenderExt.java b/core/src/mindustryX/features/RenderExt.java +index e499bbee122b00d8a094df477924677a91b50323..65256e11a2cdfd785b96dcff619fac0a615ea0ac 100644 +--- a/core/src/mindustryX/features/RenderExt.java ++++ b/core/src/mindustryX/features/RenderExt.java +@@ -21,8 +21,9 @@ import mindustry.world.blocks.logic.MessageBlock.*; + import mindustry.world.blocks.production.Drill.*; + import mindustry.world.blocks.storage.*; + import mindustry.world.blocks.units.*; ++import mindustryX.features.draw.*; + +-import static mindustry.Vars.tilesize; ++import static mindustry.Vars.*; + + public class RenderExt{ + public static boolean bulletShow, showMineBeam, displayAllMessage; +@@ -39,6 +40,7 @@ public class RenderExt{ + public static int massDriverLineInterval; + public static boolean drawBars, drawBarsMend; + public static float healthBarMinHealth; ++ public static boolean payloadPreview; + + public static boolean unitHide = false; + public static Color massDriverLineColor = Color.clear; +@@ -79,13 +81,14 @@ public class RenderExt{ + drawBars = Core.settings.getBool("blockBars"); + drawBarsMend = Core.settings.getBool("blockBars_mend"); + healthBarMinHealth = Core.settings.getInt("blockbarminhealth"); ++ payloadPreview = Core.settings.getBool("payloadpreview"); + }); + Events.run(Trigger.draw, RenderExt::draw); + Events.on(TileChangeEvent.class, RenderExt::onSetBlock); + } + + private static void draw(){ +- ++ if(RenderExt.payloadPreview) PayloadDropHint.draw(player); + } + + public static void onGroupDraw(Drawc t){ +diff --git a/core/src/mindustryX/features/draw/PayloadDropHint.java b/core/src/mindustryX/features/draw/PayloadDropHint.java +new file mode 100644 +index 0000000000000000000000000000000000000000..b0da94c798af6477f9fe78d5979c1cd52b71087e +--- /dev/null ++++ b/core/src/mindustryX/features/draw/PayloadDropHint.java +@@ -0,0 +1,81 @@ ++package mindustryX.features.draw; ++ ++import arc.graphics.*; ++import arc.graphics.g2d.*; ++import mindustry.*; ++import mindustry.entities.*; ++import mindustry.gen.*; ++import mindustry.graphics.*; ++import mindustry.world.*; ++import mindustry.world.blocks.payloads.*; ++ ++// pick from https://github.com/MinRi2/MinerTools/blob/8ab2fe090cf24f0a5c8eaa0dcbea01f0a5447dd8/src/MinerTools/graphics/draw/player/PayloadDropHint.java ++public class PayloadDropHint{ ++ public static void draw(Player player){ ++ var unit = player.unit() instanceof Payloadc ? (Unit & Payloadc)player.unit() : null; ++ if(unit == null) return; ++ ++ Draw.z(Layer.flyingUnit + 0.1f); ++ if(unit.payloads().any()){ ++ Payload payload = unit.payloads().peek(); ++ if(payload instanceof BuildPayload p){ ++ buildDropHint(unit, p); ++ }else if(payload instanceof UnitPayload p){ ++ unitDropHint(unit, p); ++ } ++ } ++ ++ if(!unitPickUpHint(unit)){ ++ buildPickUpHint(unit); ++ } ++ } ++ ++ private static void buildPickUpHint(Payloadc unit){ ++ Tile tile = unit.tileOn(); ++ if(tile == null) return; ++ Building build = tile.build; ++ if(build == null || !unit.canPickup(build)) return; ++ ++ Block block = build.block; ++ float size = block.size * Vars.tilesize; ++ ++ Draw.color(Pal.accent, 0.6f); ++ Draw.rect(block.fullIcon, build.x, build.y, size, size, build.rotation * 90); ++ Lines.square(build.x, build.y, size * 0.9f, 20); ++ Draw.color(); ++ } ++ ++ private static boolean unitPickUpHint(T unit){ ++ Unit target = Units.closest(unit.team(), unit.x, unit.y, unit.type.hitSize * 2f, u -> u.isAI() && u.isGrounded() && unit.canPickup(u) && u.within(unit, u.hitSize + unit.hitSize)); ++ if(target == null) return false; ++ Draw.color(Pal.accent, 0.6f); ++ Draw.rect(target.type.fullIcon, target.x, target.y, target.rotation - 90); ++ Lines.square(target.x, target.y, target.type.hitSize, 20); ++ Draw.color(); ++ return true; ++ } ++ ++ private static void buildDropHint(Unit unit, BuildPayload payload){ ++ Building build = payload.build; ++ Block block = build.block; ++ Tile on = Vars.world.tileWorld(unit.x - block.offset, unit.y - block.offset); ++ if(on == null) return; ++ ++ boolean valid = Build.validPlace(block, build.team, on.x, on.y, build.rotation, false); ++ float size = block.size * Vars.tilesize; ++ int rot = block.rotate ? (int)((unit.rotation + 45f) / 90f) % 4 * 90 : 0; ++ ++ Draw.color(!valid ? Color.red : Pal.accent, 0.6f); ++ Draw.rect(block.fullIcon, on.x * Vars.tilesize, on.y * Vars.tilesize, size, size, rot); ++ Draw.color(); ++ } ++ ++ private static void unitDropHint(Unit unit, UnitPayload payload){ ++ Unit u = payload.unit; ++ boolean valid = u.canPass(unit.tileX(), unit.tileY()) && Units.count(unit.x, unit.y, u.physicSize(), Flyingc::isGrounded) <= 1; ++ ++ Draw.color(!valid ? Color.red : Pal.accent, 0.6f); ++ Draw.rect(u.type.fullIcon, unit.x, unit.y, unit.rotation - 90); ++ Draw.color(); ++ } ++} +\ No newline at end of file diff --git a/patches/client/0093-FC-RenderExt-deadOverlay.patch b/patches/client/0093-FC-RenderExt-deadOverlay.patch new file mode 100644 index 000000000000..3618c1d3f1e1 --- /dev/null +++ b/patches/client/0093-FC-RenderExt-deadOverlay.patch @@ -0,0 +1,52 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: way-zer +Date: Fri, 2 Aug 2024 23:36:02 +0800 +Subject: [PATCH] FC(RenderExt) deadOverlay + +--- + core/src/mindustry/graphics/OverlayRenderer.java | 4 ++-- + core/src/mindustryX/features/RenderExt.java | 2 ++ + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/core/src/mindustry/graphics/OverlayRenderer.java b/core/src/mindustry/graphics/OverlayRenderer.java +index 8346eb94d62f3d9cb57e4f63ed39ac34cb07c84d..fe8d7dc18df91b5f8484e87f0d37ab8dce06b54f 100644 +--- a/core/src/mindustry/graphics/OverlayRenderer.java ++++ b/core/src/mindustry/graphics/OverlayRenderer.java +@@ -71,7 +71,7 @@ public class OverlayRenderer{ + public void drawBottom(){ + InputHandler input = control.input; + +- if(player.dead()) return; ++ if(player.dead() && !RenderExt.deadOverlay) return; + + if(player.isBuilder()){ + player.unit().drawBuildPlans(); +@@ -113,7 +113,7 @@ public class OverlayRenderer{ + } + } + +- if(player.dead()) return; //dead players don't draw ++ if(player.dead() && !RenderExt.deadOverlay) return; //dead players don't draw + + InputHandler input = control.input; + +diff --git a/core/src/mindustryX/features/RenderExt.java b/core/src/mindustryX/features/RenderExt.java +index 65256e11a2cdfd785b96dcff619fac0a615ea0ac..269e2571a440517f257237920a5155a9eb5032a2 100644 +--- a/core/src/mindustryX/features/RenderExt.java ++++ b/core/src/mindustryX/features/RenderExt.java +@@ -41,6 +41,7 @@ public class RenderExt{ + public static boolean drawBars, drawBarsMend; + public static float healthBarMinHealth; + public static boolean payloadPreview; ++ public static boolean deadOverlay; + + public static boolean unitHide = false; + public static Color massDriverLineColor = Color.clear; +@@ -82,6 +83,7 @@ public class RenderExt{ + drawBarsMend = Core.settings.getBool("blockBars_mend"); + healthBarMinHealth = Core.settings.getInt("blockbarminhealth"); + payloadPreview = Core.settings.getBool("payloadpreview"); ++ deadOverlay = Core.settings.getBool("deadOverlay"); + }); + Events.run(Trigger.draw, RenderExt::draw); + Events.on(TileChangeEvent.class, RenderExt::onSetBlock); diff --git a/patches/client/0094-FC-LogicExt-invertMapClick.patch b/patches/client/0094-FC-LogicExt-invertMapClick.patch new file mode 100644 index 000000000000..8a0e619befb3 --- /dev/null +++ b/patches/client/0094-FC-LogicExt-invertMapClick.patch @@ -0,0 +1,107 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: way-zer +Date: Sat, 3 Aug 2024 00:17:31 +0800 +Subject: [PATCH] FC(LogicExt) invertMapClick + +--- + core/src/mindustry/ui/Minimap.java | 8 ++++++-- + core/src/mindustry/ui/fragments/MinimapFragment.java | 5 +++-- + core/src/mindustryX/features/LogicExt.java | 2 ++ + 3 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/core/src/mindustry/ui/Minimap.java b/core/src/mindustry/ui/Minimap.java +index adbc80fcd5cfb2b4e127603b1241b9c5b133e5e9..a5ac5e0375b524040d02c95c4a16f46ef0b2ac4d 100644 +--- a/core/src/mindustry/ui/Minimap.java ++++ b/core/src/mindustry/ui/Minimap.java +@@ -9,11 +9,13 @@ import arc.scene.event.*; + import arc.scene.ui.layout.*; + import arc.util.*; + import mindustry.gen.*; ++import mindustryX.features.*; + + import static mindustry.Vars.*; + + public class Minimap extends Table{ + private final Cell mapCell; ++ private ClickListener listener,listener2; + + public Minimap(){ + background(Tex.pane); +@@ -22,7 +24,7 @@ public class Minimap extends Table{ + + mapCell = add(new Element(){ + { +- addListener(new ClickListener(KeyCode.mouseRight){ ++ addListener(listener = new ClickListener(KeyCode.mouseRight){ + @Override + public void clicked(InputEvent event, float cx, float cy){ + var region = renderer.minimap.getRegion(); +@@ -45,6 +47,8 @@ public class Minimap extends Table{ + mapCell.size(size); + setSize(Scl.scl(size)); + setPosition(Scl.scl(margin), Scl.scl(margin)); ++ listener.setButton(LogicExt.invertMapClick ? KeyCode.mouseLeft : KeyCode.mouseRight); ++ listener2.setButton(LogicExt.invertMapClick ? KeyCode.mouseRight : KeyCode.mouseLeft); + + super.act(delta); + } +@@ -81,7 +85,7 @@ public class Minimap extends Table{ + } + }); + +- addListener(new ClickListener(){ ++ addListener(listener2 = new ClickListener(){ + { + tapSquareSize = Scl.scl(11f); + } +diff --git a/core/src/mindustry/ui/fragments/MinimapFragment.java b/core/src/mindustry/ui/fragments/MinimapFragment.java +index 2fe8df586eb0a3907334e45b1639b9534e4b292c..89e00d6356c65d1bff200857e3769583a78aa316 100644 +--- a/core/src/mindustry/ui/fragments/MinimapFragment.java ++++ b/core/src/mindustry/ui/fragments/MinimapFragment.java +@@ -13,6 +13,7 @@ import arc.util.*; + import mindustry.gen.*; + import mindustry.input.*; + import mindustry.ui.*; ++import mindustryX.features.*; + + import static mindustry.Vars.*; + +@@ -82,7 +83,7 @@ public class MinimapFragment{ + + @Override + public void pan(InputEvent event, float x, float y, float deltaX, float deltaY){ +- if(event.keyCode != KeyCode.mouseRight){ ++ if(event.keyCode !=(LogicExt.invertMapClick ? KeyCode.mouseLeft : KeyCode.mouseRight)){ + panx += deltaX / zoom; + pany += deltaY / zoom; + }else{ +@@ -93,7 +94,7 @@ public class MinimapFragment{ + @Override + public void touchDown(InputEvent event, float x, float y, int pointer, KeyCode button){ + super.touchDown(event, x, y, pointer, button); +- if(button == KeyCode.mouseRight){ ++ if(button == (LogicExt.invertMapClick ? KeyCode.mouseLeft : KeyCode.mouseRight)){ + panTo(x, y); + } + } +diff --git a/core/src/mindustryX/features/LogicExt.java b/core/src/mindustryX/features/LogicExt.java +index bdc81ee89e34a125a22f05096231a72fec2e3172..e4e044741a196b6cc046387d1bf115b6ec24f668 100644 +--- a/core/src/mindustryX/features/LogicExt.java ++++ b/core/src/mindustryX/features/LogicExt.java +@@ -8,6 +8,7 @@ public class LogicExt{ + public static boolean limitUpdate = false; + public static int limitDst = 0, limitTimer = 10; + public static boolean terrainSchematic = false; ++ public static boolean invertMapClick = false; + + public static void init(){ + Events.run(Trigger.update, () -> { +@@ -18,6 +19,7 @@ public class LogicExt{ + limitTimer = 10; + } + terrainSchematic = Core.settings.getBool("terrainSchematic"); ++ invertMapClick = Core.settings.getBool("invertMapClick"); + }); + } + } +\ No newline at end of file diff --git a/patches/client/0095-OC-speedup-SchematicsDialog-showing.patch b/patches/client/0095-OC-speedup-SchematicsDialog-showing.patch new file mode 100644 index 000000000000..ca60dc56d5c6 --- /dev/null +++ b/patches/client/0095-OC-speedup-SchematicsDialog-showing.patch @@ -0,0 +1,53 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: way-zer +Date: Sat, 3 Aug 2024 20:59:46 +0800 +Subject: [PATCH] OC: speedup SchematicsDialog showing. + +--- + build.gradle | 2 +- + core/src/mindustry/ui/dialogs/SchematicsDialog.java | 5 ++++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/build.gradle b/build.gradle +index 04c82d033d92261996863efee84d0a3f4a3faadb..3f59dbbf8e758567ecfdc46eec7fe38359761da6 100644 +--- a/build.gradle ++++ b/build.gradle +@@ -146,7 +146,7 @@ project(":core"){ + api "org.lz4:lz4-java:1.8.0" + api arcModule("arc-core") + api arcModule("extensions:flabel") +- api arcModule("extensions:freetype") ++ api "com.github.way-zer.Arc:freetype:fe9f23ae08" + api arcModule("extensions:g3d") + api arcModule("extensions:fx") + api arcModule("extensions:arcnet") +diff --git a/core/src/mindustry/ui/dialogs/SchematicsDialog.java b/core/src/mindustry/ui/dialogs/SchematicsDialog.java +index 3907f10dbee3695599e0f70bdfde13c34c53b50d..5095be6c1d92f1049829b96a34efabb9854f0e55 100644 +--- a/core/src/mindustry/ui/dialogs/SchematicsDialog.java ++++ b/core/src/mindustry/ui/dialogs/SchematicsDialog.java +@@ -676,6 +676,7 @@ public class SchematicsDialog extends BaseDialog{ + } + + public static class SchematicImage extends Image{ ++ private static boolean setLock = false; + public float scaling = 16f; + public float thickness = 4f; + public Color borderColor = Pal.gray; +@@ -701,7 +702,8 @@ public class SchematicsDialog extends BaseDialog{ + && ((Button)parent.parent).isOver(); + + boolean wasSet = set; +- if(!set){ ++ if(!set && !setLock){ ++ setLock = true; + Core.app.post(this::setPreview); + set = true; + }else if(lastTexture != null && lastTexture.isDisposed()){ +@@ -732,6 +734,7 @@ public class SchematicsDialog extends BaseDialog{ + } + + private void setPreview(){ ++ setLock = false; + TextureRegionDrawable draw = new TextureRegionDrawable(new TextureRegion(lastTexture = schematics.getPreview(schematic))); + setDrawable(draw); + setScaling(Scaling.fit); diff --git a/patches/client/0091-ARC-merged.patch b/patches/client/0096-ARC-merged.patch similarity index 94% rename from patches/client/0091-ARC-merged.patch rename to patches/client/0096-ARC-merged.patch index 9656c200d132..83245f5ddb8f 100644 --- a/patches/client/0091-ARC-merged.patch +++ b/patches/client/0096-ARC-merged.patch @@ -82,11 +82,15 @@ way-zer on 2024/7/13 * fix no uiIcon * remove menuFlyers way-zer on 2024/7/13 + +* 整理PlayerListFragment +* fix #CN-ARC/Mindustry-CN-ARC:85 +way-zer on 2024/7/28 --- core/src/mindustry/ai/BlockIndexer.java | 116 ++ core/src/mindustry/core/Renderer.java | 3 +- core/src/mindustry/core/UI.java | 3 + - core/src/mindustry/editor/MapInfoDialog.java | 141 ++- + core/src/mindustry/editor/MapInfoDialog.java | 139 +- .../mindustry/entities/comp/BuildingComp.java | 18 +- .../mindustry/entities/comp/PlayerComp.java | 22 +- .../mindustry/entities/comp/ShieldComp.java | 6 + @@ -98,7 +102,7 @@ way-zer on 2024/7/13 .../mindustry/graphics/OverlayRenderer.java | 84 +- core/src/mindustry/input/Binding.java | 12 +- core/src/mindustry/input/DesktopInput.java | 98 +- - core/src/mindustry/input/InputHandler.java | 56 +- + core/src/mindustry/input/InputHandler.java | 55 +- core/src/mindustry/input/MobileInput.java | 17 +- core/src/mindustry/type/UnitType.java | 162 ++- core/src/mindustry/type/Weapon.java | 25 +- @@ -114,7 +118,7 @@ way-zer on 2024/7/13 .../mindustry/ui/fragments/HudFragment.java | 229 +++- .../mindustry/ui/fragments/MenuFragment.java | 59 +- .../ui/fragments/PlacementFragment.java | 212 +++- - .../ui/fragments/PlayerListFragment.java | 202 ++- + .../ui/fragments/PlayerListFragment.java | 68 +- core/src/mindustry/world/Block.java | 18 +- core/src/mindustry/world/Build.java | 50 + .../world/blocks/ConstructBlock.java | 42 +- @@ -135,13 +139,14 @@ way-zer on 2024/7/13 .../mindustryX/features/ArcWaveSpawner.java | 258 ++++ core/src/mindustryX/features/MarkerType.java | 12 +- .../mindustryX/features/PicToMindustry.java | 343 +++++ - core/src/mindustryX/features/RenderExt.java | 13 +- + core/src/mindustryX/features/RenderExt.java | 12 +- core/src/mindustryX/features/UIExt.java | 1 + .../features/ui/ArcMessageDialog.java | 419 +++++++ .../mindustryX/features/ui/ArcPowerInfo.java | 70 ++ .../features/ui/ArcWaveInfoDialog.java | 1117 +++++++++++++++++ .../features/ui/BlockSelectDialog.java | 65 + - 58 files changed, 5433 insertions(+), 247 deletions(-) + .../features/ui/auxiliary/MapInfoTable.java | 14 +- + 59 files changed, 5332 insertions(+), 224 deletions(-) create mode 100644 core/src/mindustryX/features/ArcBuilds.java create mode 100644 core/src/mindustryX/features/ArcRadar.java create mode 100644 core/src/mindustryX/features/ArcUnits.java @@ -339,7 +344,7 @@ index d21aa28efe895c7d76dfd903a9942a03f5a012b9..9e28b63e85dff5119c43f7dd3b278536 if(landCore == null || landTime <= 0f) return; landCore.drawLanding(launching && launchCoreType != null ? launchCoreType : (CoreBlock)landCore.block); diff --git a/core/src/mindustry/core/UI.java b/core/src/mindustry/core/UI.java -index 34ac2770a91fb02b7500fe46ec12f47bc384a061..0502e5341aaf07020b87bd4ae06b83dfbf211f7a 100644 +index 39deed997df547bf6fe986fe39643209ca99b0ce..9de31563d7940d8cbb3ac345259c58b0006e1ea9 100644 --- a/core/src/mindustry/core/UI.java +++ b/core/src/mindustry/core/UI.java @@ -28,6 +28,7 @@ import mindustry.logic.*; @@ -350,7 +355,7 @@ index 34ac2770a91fb02b7500fe46ec12f47bc384a061..0502e5341aaf07020b87bd4ae06b83df import static arc.scene.actions.Actions.*; import static mindustry.Vars.*; -@@ -372,6 +373,7 @@ public class UI implements ApplicationListener, Loadable{ +@@ -368,6 +369,7 @@ public class UI implements ApplicationListener, Loadable{ /** Shows a fading label at the top of the screen. */ public void showInfoToast(String info, float duration){ @@ -358,7 +363,7 @@ index 34ac2770a91fb02b7500fe46ec12f47bc384a061..0502e5341aaf07020b87bd4ae06b83df var cinfo = Core.scene.find("coreinfo"); Table table = new Table(); table.touchable = Touchable.disabled; -@@ -388,6 +390,7 @@ public class UI implements ApplicationListener, Loadable{ +@@ -384,6 +386,7 @@ public class UI implements ApplicationListener, Loadable{ /** Shows a label at some position on the screen. Does not fade. */ public void showInfoPopup(String info, float duration, int align, int top, int left, int bottom, int right){ @@ -367,7 +372,7 @@ index 34ac2770a91fb02b7500fe46ec12f47bc384a061..0502e5341aaf07020b87bd4ae06b83df table.setFillParent(true); table.touchable = Touchable.disabled; diff --git a/core/src/mindustry/editor/MapInfoDialog.java b/core/src/mindustry/editor/MapInfoDialog.java -index ebc1f0b300d295e45333f1db38ea299c9658ec20..dbacadb84aa76aa1e89c2ccfb52be42c13e1a9e4 100644 +index ebc1f0b300d295e45333f1db38ea299c9658ec20..03e44e99a11362a2c3df1b05a63f2d1e9c8f743b 100644 --- a/core/src/mindustry/editor/MapInfoDialog.java +++ b/core/src/mindustry/editor/MapInfoDialog.java @@ -1,5 +1,6 @@ @@ -406,7 +411,7 @@ index ebc1f0b300d295e45333f1db38ea299c9658ec20..dbacadb84aa76aa1e89c2ccfb52be42c tags.put("name", text); }).size(400, 55f).maxTextLength(50).get(); name.setMessageText("@unknown"); -@@ -46,14 +48,78 @@ public class MapInfoDialog extends BaseDialog{ +@@ -46,14 +48,76 @@ public class MapInfoDialog extends BaseDialog{ t.row(); t.add("@editor.description").padRight(8).left(); @@ -422,61 +427,59 @@ index ebc1f0b300d295e45333f1db38ea299c9658ec20..dbacadb84aa76aa1e89c2ccfb52be42c + tags.put("modeName", text); + }).size(400f, 55f).maxTextLength(1000).get(); + -+ if (Core.settings.getBool("arcPlayerList")) { -+ t.row(); -+ t.add("[cyan]服务器标签").padRight(8).left(); -+ t.button("编辑...", () -> { -+ BaseDialog dialog = new BaseDialog("地图标签"); -+ -+ dialog.cont.pane(td -> { -+ td.add("[cyan]微泽系服务器标签编辑器 \n[white]BY [violet]Lucky Clover" -+ + "\n\n[white]用于国内新版微泽系插件标签。" -+ + "\n[orange]如果您发现标签无效,可能是您所在的服务器插件版本过低。请联系服主更新插件" -+ + "\n所有标签与主服同步" -+ + "\n\n[red]需要退出地图界面后重新打开才会更新" -+ + "\n\n[white]如果有bug欢迎提出" -+ ); -+ td.row(); -+ td.row(); -+ -+ td.add("PVP保护时间(s)").left(); -+ td.field(arcReadStringLabel("@pvpProtect"), pama -> { -+ arcAddStringLabel(pama, "@pvpProtect"); -+ }).maxTextLength(5).left(); -+ td.row(); -+ td.add("禁用队伍(如1,2,3...)").left(); -+ td.field(arcReadStringLabel("@banTeam"), pama -> { -+ arcAddStringLabel(pama, "@banTeam"); -+ }).maxTextLength(5).left(); -+ td.row(); -+ td.add("插件选择").left(); -+ td.field(arcReadStringLabel("@mapScript"), pama -> { -+ arcAddStringLabel(pama, "@mapScript"); -+ }).maxTextLength(6).left(); -+ td.row(); -+ td.check("空域管制 [acid]敌方核心保护区内禁止空军", arcreadBoolLable("[@limitAir]"), islimit -> { -+ arcAddBoolLable(islimit, "[@limitAir]"); -+ }).left(); -+ td.row(); -+ td.check("塔防模式 [acid]怪物仅会在出生点地板移动,不会攻击", arcreadBoolLable("[@towerDefend]"), islimit -> { -+ arcAddBoolLable(islimit, "[@towerDefend]"); -+ }).left(); -+ td.row(); -+ td.check("敌人掉落 [acid]非塔防模式下,打怪掉落资源", arcreadBoolLable("[@TDDrop]"), islimit -> { -+ arcAddBoolLable(islimit, "[@TDDrop]"); -+ }).left(); -+ td.row(); -+ td.check("水漫金山 [acid]蓝队核心会释放洪水淹没你的核心", arcreadBoolLable("[@floodV2]"), islimit -> { -+ arcAddBoolLable(islimit, "[@flood]"); -+ }).left(); ++ t.row(); ++ t.add("[cyan]服务器特殊标签").padRight(8).left(); ++ t.button("编辑...", () -> { ++ BaseDialog dialog = new BaseDialog("地图标签"); ++ ++ dialog.cont.pane(td -> { ++ td.add("[cyan]微泽系服务器标签编辑器 \n[white]BY [violet]Lucky Clover" ++ + "\n\n[white]用于国内新版微泽系插件标签。" ++ + "\n[orange]如果您发现标签无效,可能是您所在的服务器插件版本过低。请联系服主更新插件" ++ + "\n所有标签与主服同步" ++ + "\n\n[red]需要退出地图界面后重新打开才会更新" ++ + "\n\n[white]如果有bug欢迎提出" ++ ); ++ td.row(); ++ td.row(); ++ ++ td.add("PVP保护时间(s)").left(); ++ td.field(arcReadStringLabel("@pvpProtect"), pama -> { ++ arcAddStringLabel(pama, "@pvpProtect"); ++ }).maxTextLength(5).left(); ++ td.row(); ++ td.add("禁用队伍(如1,2,3...)").left(); ++ td.field(arcReadStringLabel("@banTeam"), pama -> { ++ arcAddStringLabel(pama, "@banTeam"); ++ }).maxTextLength(5).left(); ++ td.row(); ++ td.add("插件选择").left(); ++ td.field(arcReadStringLabel("@mapScript"), pama -> { ++ arcAddStringLabel(pama, "@mapScript"); ++ }).maxTextLength(6).left(); ++ td.row(); ++ td.check("空域管制 [acid]敌方核心保护区内禁止空军", arcreadBoolLable("[@limitAir]"), islimit -> { ++ arcAddBoolLable(islimit, "[@limitAir]"); + }).left(); -+ dialog.row(); -+ dialog.addCloseButton(); -+ dialog.margin(16f); ++ td.row(); ++ td.check("塔防模式 [acid]怪物仅会在出生点地板移动,不会攻击", arcreadBoolLable("[@towerDefend]"), islimit -> { ++ arcAddBoolLable(islimit, "[@towerDefend]"); ++ }).left(); ++ td.row(); ++ td.check("敌人掉落 [acid]非塔防模式下,打怪掉落资源", arcreadBoolLable("[@TDDrop]"), islimit -> { ++ arcAddBoolLable(islimit, "[@TDDrop]"); ++ }).left(); ++ td.row(); ++ td.check("水漫金山 [acid]蓝队核心会释放洪水淹没你的核心", arcreadBoolLable("[@floodV2]"), islimit -> { ++ arcAddBoolLable(islimit, "[@flood]"); ++ }).left(); ++ }).left(); ++ dialog.row(); ++ dialog.addCloseButton(); ++ dialog.margin(16f); + -+ dialog.show(); -+ }).left().width(200f); -+ } ++ dialog.show(); ++ }).left().width(200f); + + t.row(); @@ -487,7 +490,7 @@ index ebc1f0b300d295e45333f1db38ea299c9658ec20..dbacadb84aa76aa1e89c2ccfb52be42c tags.put("author", text); }).size(400, 55f).maxTextLength(50).get(); author.setMessageText("@unknown"); -@@ -117,9 +183,74 @@ public class MapInfoDialog extends BaseDialog{ +@@ -117,9 +181,74 @@ public class MapInfoDialog extends BaseDialog{ name.change(); description.change(); @@ -1043,7 +1046,7 @@ index 44cbc6b38ede0697af8af3321c342c7f117bdcbd..ed4bd9d05114a32e45e18117e02c2a60 laser(line, edge, edge, x, y, x2, y2, 1f); } diff --git a/core/src/mindustry/graphics/OverlayRenderer.java b/core/src/mindustry/graphics/OverlayRenderer.java -index 8346eb94d62f3d9cb57e4f63ed39ac34cb07c84d..4d8a5c1d39dc3daac4b27fb078c0327c629512c1 100644 +index fe8d7dc18df91b5f8484e87f0d37ab8dce06b54f..5a245c5b2e1a960ba79122ac7f84c15274086112 100644 --- a/core/src/mindustry/graphics/OverlayRenderer.java +++ b/core/src/mindustry/graphics/OverlayRenderer.java @@ -15,8 +15,8 @@ import mindustry.game.*; @@ -1389,7 +1392,7 @@ index 1fc15522d18bf8ca80f7365d68f4a7a7b1fd076c..68df7b6759f42ffabc36bffdd204370c //update payload input if(unit instanceof Payloadc){ diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java -index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df5274f84ebd 100644 +index b63fa723820b0c4e28b227d89fa615097af0b97f..31de77f007dc97c6a2b12ba3fb8d4d082328ba1a 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -36,11 +36,13 @@ import mindustry.world.*; @@ -1406,16 +1409,15 @@ index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df52 import java.util.*; -@@ -58,6 +60,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -58,6 +60,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ final static int maxLength = 100; final static Rect r1 = new Rect(), r2 = new Rect(); final static Seq tmpUnits = new Seq<>(false); + public static Player follow; -+ public static int followIndex = 0; final static Binding[] controlGroupBindings = { Binding.block_select_01, Binding.block_select_02, -@@ -108,6 +112,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -108,6 +111,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ /** Groups of units saved to different hotkeys */ public IntSeq[] controlGroups = new IntSeq[controlGroupBindings.length]; @@ -1423,7 +1425,7 @@ index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df52 private Seq plansOut = new Seq<>(BuildPlan.class); private QuadTree playerPlanTree = new QuadTree<>(new Rect()); -@@ -629,7 +634,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -629,7 +633,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ player.con.send(packet, true); } @@ -1432,7 +1434,7 @@ index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df52 } build.configured(player == null || player.dead() ? null : player.unit(), value); Events.fire(new ConfigEvent(build, player, value)); -@@ -653,9 +658,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -653,9 +657,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ throw new ValidateException(player, "Player cannot control a building."); } @@ -1443,7 +1445,7 @@ index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df52 build.onControlSelect(player.unit()); if(!before.dead && before.spawnedByCore && !before.isPlayer()){ -@@ -854,6 +858,10 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -854,6 +857,10 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } } } @@ -1454,7 +1456,7 @@ index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df52 } public void checkUnit(){ -@@ -1007,6 +1015,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -1007,6 +1014,8 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ attack = selectedEnemyUnit(target.x, target.y); } @@ -1463,7 +1465,7 @@ index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df52 int[] ids = new int[selectedUnits.size]; for(int i = 0; i < ids.length; i++){ ids[i] = selectedUnits.get(i).id; -@@ -1202,6 +1212,11 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -1202,6 +1211,11 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ }); } @@ -1475,7 +1477,7 @@ index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df52 public void rotatePlans(Seq plans, int direction){ int ox = schemOriginX(), oy = schemOriginY(); -@@ -1235,6 +1250,19 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -1235,6 +1249,19 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ plan.x = World.toTile(wx - plan.block.offset) + ox; plan.y = World.toTile(wy - plan.block.offset) + oy; plan.rotation = plan.block.planRotation(Mathf.mod(plan.rotation + direction, 4)); @@ -1495,7 +1497,7 @@ index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df52 }); } -@@ -1266,6 +1294,14 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -1266,6 +1293,14 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ //flip rotation plan.block.flipRotation(plan, x); @@ -1510,12 +1512,12 @@ index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df52 }); } -@@ -1390,12 +1426,17 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -1390,12 +1425,17 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ protected void drawSelection(int x1, int y1, int x2, int y2, int maxLength, Color col1, Color col2){ NormalizeDrawResult result = Placement.normalizeDrawArea(Blocks.air, x1, y1, x2, y2, false, maxLength, 1f); + String arcSelectionSize = Math.abs(x2 - x1) + 1 + "×" + (Math.abs(y1 - y2) + 1); -+ FuncX.drawText(Tmp.v1.set((x1 + x2) / 2f, Math.max(y1, y2) + 1).scl(tilesize), arcSelectionSize, 2f, Pal.accent, Align.top); ++ FuncX.drawText(Tmp.v1.set((x1 + x2) / 2f, Math.max(y1, y2) + 1).scl(tilesize), arcSelectionSize, 2f, Pal.accent, Align.bottom); Lines.stroke(2f); Draw.color(col1); @@ -1528,7 +1530,7 @@ index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df52 } protected void flushSelectPlans(Seq plans){ -@@ -1581,7 +1622,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -1581,7 +1621,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ if(build.block.commandable && commandMode){ //TODO handled in tap. consumed = true; @@ -1537,7 +1539,7 @@ index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df52 consumed = true; if((!config.isShown() && build.shouldShowConfigure(player)) //if the config fragment is hidden, show //alternatively, the current selected block can 'agree' to switch config tiles -@@ -1610,7 +1651,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -1610,7 +1650,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ //consume tap event if necessary if(build.interactable(player.team()) && build.block.consumesTap){ consumed = true; @@ -1546,7 +1548,7 @@ index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df52 if(build.block.hasItems && build.items.total() > 0){ inv.showFor(build); consumed = true; -@@ -1755,7 +1796,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -1755,7 +1795,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ public @Nullable Building selectedControlBuild(){ Building build = world.buildWorld(Core.input.mouseWorld().x, Core.input.mouseWorld().y); @@ -1555,7 +1557,7 @@ index b63fa723820b0c4e28b227d89fa615097af0b97f..715032817201c1f3235ec867af03df52 return build; } return null; -@@ -1841,6 +1882,9 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ +@@ -1841,6 +1881,9 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } public boolean canShoot(){ @@ -2025,7 +2027,7 @@ index f9ec8feac6e944e76b5e2309da9b78e9d1269348..54aecfe829705b2f0f39743f476fbc8d } diff --git a/core/src/mindustry/ui/Fonts.java b/core/src/mindustry/ui/Fonts.java -index c02e09ff53a80aaf540223828208ad86b96d4bec..491a2a32020bd658941ce8e74d8becd0da5ab720 100644 +index 916b2ba5102ef670704e64a1f058c477c992d6dc..749c2180b6682361b568ca6d171675bc0552a22c 100644 --- a/core/src/mindustry/ui/Fonts.java +++ b/core/src/mindustry/ui/Fonts.java @@ -30,7 +30,7 @@ public class Fonts{ @@ -2615,7 +2617,7 @@ index c8f4fb44c2d382c3430964e6197cde3f45bf8695..6af74ac5d883532c2fcb5c031bcebd81 /** Look around for existing sectors. Can only deploy. */ look, diff --git a/core/src/mindustry/ui/dialogs/SchematicsDialog.java b/core/src/mindustry/ui/dialogs/SchematicsDialog.java -index 3907f10dbee3695599e0f70bdfde13c34c53b50d..4b7cb241f7801895227073ba10ac22a5f67b6a51 100644 +index 5095be6c1d92f1049829b96a34efabb9854f0e55..5b8be2f3b6bdeb95bd2ead6650bee5fabcca67e5 100644 --- a/core/src/mindustry/ui/dialogs/SchematicsDialog.java +++ b/core/src/mindustry/ui/dialogs/SchematicsDialog.java @@ -15,6 +15,12 @@ import arc.scene.ui.layout.*; @@ -3056,7 +3058,7 @@ index 3907f10dbee3695599e0f70bdfde13c34c53b50d..4b7cb241f7801895227073ba10ac22a5 void buildTags(Schematic schem, Table t){ buildTags(schem, t, true); } -@@ -790,13 +1130,44 @@ public class SchematicsDialog extends BaseDialog{ +@@ -793,13 +1133,44 @@ public class SchematicsDialog extends BaseDialog{ } }); } @@ -3184,7 +3186,7 @@ index e74e6a12e3da57eb58598eb4e679a7990c109def..013255ce5aa828d538814fa25dc64c6a //special case for 'clear' command if(message.equals("clear")){ diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java -index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63a6353475 100644 +index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..16b01adb80bbe1ad8162d39234dec38bb33a5297 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -14,6 +14,7 @@ import arc.scene.ui.ImageButton.*; @@ -3195,7 +3197,15 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 import mindustry.annotations.Annotations.*; import mindustry.content.*; import mindustry.core.GameState.*; -@@ -34,6 +35,7 @@ import mindustryX.features.ui.*; +@@ -27,6 +28,7 @@ import mindustry.input.*; + import mindustry.net.Packets.*; + import mindustry.type.*; + import mindustry.ui.*; ++import mindustry.world.blocks.defense.turrets.*; + import mindustry.world.blocks.storage.*; + import mindustry.world.blocks.storage.CoreBlock.*; + import mindustryX.features.*; +@@ -34,6 +36,7 @@ import mindustryX.features.ui.*; import static mindustry.Vars.*; import static mindustry.gen.Tex.*; @@ -3203,7 +3213,7 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 public class HudFragment{ private static final float dsize = 65f, pauseHeight = 36f; -@@ -45,6 +47,8 @@ public class HudFragment{ +@@ -45,6 +48,8 @@ public class HudFragment{ public NewCoreItemsDisplay coreItems = new NewCoreItemsDisplay(); private AuxiliaryTools auxiliaryTools; @@ -3212,7 +3222,7 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 private String hudText = ""; private boolean showHudText; -@@ -52,6 +56,8 @@ public class HudFragment{ +@@ -52,6 +57,8 @@ public class HudFragment{ private Table lastUnlockLayout; private long lastToast; @@ -3221,7 +3231,7 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 public void build(Group parent){ auxiliaryTools = new AuxiliaryTools(); -@@ -92,6 +98,11 @@ public class HudFragment{ +@@ -92,6 +99,11 @@ public class HudFragment{ showToast(Icon.warning, Core.bundle.format("sector.attacked", e.sector.name())); }); @@ -3233,7 +3243,7 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 //paused table parent.fill(t -> { t.name = "paused"; -@@ -116,13 +127,16 @@ public class HudFragment{ +@@ -116,13 +128,16 @@ public class HudFragment{ t.add(new Minimap()).name("minimap"); t.row(); //position @@ -3257,7 +3267,7 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 if(Core.settings.getInt("AuxiliaryTable") == 3){ t.row(); t.table(infoWave -> { -@@ -219,12 +233,16 @@ public class HudFragment{ +@@ -219,12 +234,16 @@ public class HudFragment{ Table wavesMain, editorMain; cont.stack(wavesMain = new Table(), editorMain = new Table()).height(wavesMain.getPrefHeight()) @@ -3275,7 +3285,7 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 //wave info button with text s.add(makeStatusTable()).grow().name("status"); -@@ -245,7 +263,13 @@ public class HudFragment{ +@@ -245,7 +264,13 @@ public class HudFragment{ logic.skipWave(); } }).growY().fillX().right().width(40f).disabled(b -> !canSkipWave()).name("skip").get().toBack(); @@ -3290,7 +3300,7 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 wavesMain.row(); -@@ -261,6 +285,7 @@ public class HudFragment{ +@@ -261,6 +286,7 @@ public class HudFragment{ editorMain.name = "editor"; editorMain.table(Tex.buttonEdge4, t -> { @@ -3298,7 +3308,7 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 //t.margin(0f); t.name = "teams"; t.add("@editor.teams").growX().left(); -@@ -279,6 +304,7 @@ public class HudFragment{ +@@ -279,6 +305,7 @@ public class HudFragment{ teams.row(); } } @@ -3306,7 +3316,7 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 }).left(); }).width(dsize * 5 + 4f); editorMain.visible(() -> shown && state.isEditor()); -@@ -303,6 +329,8 @@ public class HudFragment{ +@@ -303,6 +330,8 @@ public class HudFragment{ IntFormat mem = new IntFormat("memory"); IntFormat memnative = new IntFormat("memory2"); @@ -3315,7 +3325,7 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 info.label(() -> fps.get(Core.graphics.getFramesPerSecond())).left().style(Styles.outlineLabel).name("fps"); info.row(); info.label(() -> Strings.format("LG/DW/UI(ms) @/@/@", Time.nanosToMillis(DebugUtil.logicTime), Time.nanosToMillis(DebugUtil.rendererTime), Time.nanosToMillis(DebugUtil.uiTime))) -@@ -311,6 +339,10 @@ public class HudFragment{ +@@ -311,6 +340,10 @@ public class HudFragment{ info.label(() -> Strings.format("D/V/T/F @/@/@/@", DebugUtil.lastDrawRequests, DebugUtil.lastVertices, DebugUtil.lastSwitchTexture, DebugUtil.lastFlushCount)).left().style(Styles.outlineLabel).name("draw"); info.row(); @@ -3326,7 +3336,7 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 if(android){ info.label(() -> memnative.get((int)(Core.app.getJavaHeap() / 1024 / 1024), (int)(Core.app.getNativeHeap() / 1024 / 1024))).left().style(Styles.outlineLabel).name("memory2"); -@@ -390,7 +422,7 @@ public class HudFragment{ +@@ -390,7 +423,7 @@ public class HudFragment{ } return max == 0f ? 0f : val / max; }).blink(Color.white).outline(new Color(0, 0, 0, 0.6f), 7f)).grow()) @@ -3335,12 +3345,12 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 t.table(Styles.black3, p -> p.margin(4).label(() -> hudText).style(Styles.outlineLabel)).touchable(Touchable.disabled).with(p -> p.visible(() -> { p.color.a = Mathf.lerpDelta(p.color.a, Mathf.num(showHudText), 0.2f); -@@ -921,6 +953,143 @@ public class HudFragment{ +@@ -921,6 +954,142 @@ public class HudFragment{ return table; } + -+ private Table makeStatusTableArc() { ++ private Table makeStatusTableArc(){ + Table table = new Table(buttonEdge4); + + table.name = "waves"; @@ -3350,7 +3360,7 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 + table.table(t -> { + t.margin(0); + t.clicked(() -> { -+ if (!player.dead() && mobile) { ++ if(!player.dead() && mobile){ + Call.unitClear(player); + control.input.recentRespawnTimer = 1f; + control.input.controlledType = null; @@ -3359,27 +3369,26 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 + t.image(() -> player.icon()).size(iconMed); + t.row(); + t.add(new Bar( -+ () -> { -+ if (player.unit().shield > 0) { -+ return UI.formatAmount((long) player.unit().health) + "[gray]+[white]" + UI.formatAmount((long) player.unit().shield); -+ } else { -+ return UI.formatAmount((long) player.unit().health); -+ } -+ }, -+ () -> Pal.health, -+ () -> Math.min(player.unit().health / player.unit().maxHealth, 1))).height(18).growX(); ++ () -> { ++ if(player.unit().shield > 0){ ++ return UI.formatAmount((long)player.unit().health) + "[gray]+[white]" + UI.formatAmount((long)player.unit().shield); ++ }else{ ++ return UI.formatAmount((long)player.unit().health); ++ } ++ }, ++ () -> Pal.health, ++ () -> Math.min(player.unit().health / player.unit().maxHealth, 1))).height(18).growX(); + t.row(); + t.add(new Bar( -+ () -> { -+ if (state.rules.unitAmmo) -+ return player.unit().type.ammoType.icon() + (int) player.unit().ammo + "/" + player.unit().type.ammoCapacity; -+ else return player.unit().type.ammoType.icon(); -+ }, -+ () -> player.unit().type.ammoType.barColor(), -+ () -> { -+ if (state.rules.unitAmmo) return player.unit().ammo / player.unit().type.ammoCapacity; -+ else return 1; -+ })).height(18).growX(); ++ () -> { ++ if(player.unit() instanceof BlockUnitUnit u && u.tile().buildOn() instanceof ItemTurret.ItemTurretBuild it) ++ return ((float)it.totalAmmo > 0 ? ((ItemTurret.ItemEntry)it.ammo.peek()).item.emoji() + it.totalAmmo + "/" + ((ItemTurret)it.block).maxAmmo : ""); ++ if(state.rules.unitAmmo) ++ return player.unit().type.ammoType.icon() + (int)player.unit().ammo + "/" + player.unit().type.ammoCapacity; ++ else return player.unit().type.ammoType.icon(); ++ }, ++ () -> player.unit().type.ammoType.barColor(), ++ () -> player.unit().ammof())).height(18).growX(); + t.row(); + + }).size(110, 80).padRight(4); @@ -3388,7 +3397,7 @@ index 98fa34b4f9a8b77d483508a3eb8c24dac76ed339..583a47f872aafe3e405d5d67bc04db63 + table.add(arcStatus).growX().pad(4f); + + // Power bar display -+ if (Core.settings.getBool("powerStatistic")) { ++ if(Core.settings.getBool("powerStatistic")){ + table.row(); + table.add(ArcPowerInfo.getBars()).growX().colspan(table.getColumns()); + } @@ -4054,10 +4063,10 @@ index 2c3e6ad5249a532799dde66f1abde1ac5884a2a8..cd6b06189153afbe838a8a2d862044ad + } } diff --git a/core/src/mindustry/ui/fragments/PlayerListFragment.java b/core/src/mindustry/ui/fragments/PlayerListFragment.java -index 9286aab19502b5cf40556311572157b20c60fef4..1165df86591dea2b418802c309a55c2bc7a6bfef 100644 +index 9286aab19502b5cf40556311572157b20c60fef4..0e6d6d3834e751851bccd15a3352317a2bb95386 100644 --- a/core/src/mindustry/ui/fragments/PlayerListFragment.java +++ b/core/src/mindustry/ui/fragments/PlayerListFragment.java -@@ -10,23 +10,29 @@ import arc.scene.ui.ImageButton.*; +@@ -10,14 +10,16 @@ import arc.scene.ui.ImageButton.*; import arc.scene.ui.layout.*; import arc.struct.*; import arc.util.*; @@ -4075,62 +4084,41 @@ index 9286aab19502b5cf40556311572157b20c60fef4..1165df86591dea2b418802c309a55c2b +import mindustryX.features.ui.*; import static mindustry.Vars.*; -+import static mindustry.input.InputHandler.follow; - - public class PlayerListFragment{ - public Table content = new Table().marginRight(13f).marginLeft(13f); - private boolean visible = false; - private Interval timer = new Interval(); - private TextField search; -- private Seq players = new Seq<>(); -+ public Seq players = new Seq<>(); -+ -+ private float buttonSize = 30f; -+ private boolean teamMode = false; - public void build(Group parent){ - content.name = "players"; -@@ -63,23 +69,23 @@ public class PlayerListFragment{ - menu.defaults().growX().height(50f).fillY(); - menu.name = "menu"; - -+ if (Core.settings.getBool("arcPlayerList") && Core.settings.getBool("easyJS")) menu.button("js换队",() -> teamMode = !teamMode).checked(t->teamMode); - menu.button("@server.bans", ui.bans::show).disabled(b -> net.client()); - menu.button("@server.admins", ui.admins::show).disabled(b -> net.client()); +@@ -68,7 +70,7 @@ public class PlayerListFragment{ menu.button("@close", this::toggle); }).margin(0f).pad(10f).growX(); - }).touchable(Touchable.enabled).margin(14f).minWidth(360f); -+ }).touchable(Touchable.enabled).margin(14f).minWidth(720f); ++ }).touchable(Touchable.enabled).margin(14f).minWidth(620f); }); rebuild(); - } +@@ -79,7 +81,7 @@ public class PlayerListFragment{ - public void rebuild(){ -- boolean allowTeamSwitch = !state.isCampaign() && (state.rules.pvp || state.rules.infiniteResources); -- content.clear(); - float h = 50f; + float h = 40f; -+ float bs = (h) - 2f; boolean found = false; players.clear(); -@@ -95,6 +101,7 @@ public class PlayerListFragment{ - NetConnection connection = user.con; +@@ -87,7 +89,7 @@ public class PlayerListFragment{ - if(connection == null && net.server() && !user.isLocal()) return; -+ if(search.getText().length() > 0 && !user.name().toLowerCase().contains(search.getText().toLowerCase()) && !Strings.stripColors(user.name().toLowerCase()).contains(search.getText().toLowerCase())) return; + players.sort(Structs.comps(Structs.comparing(Player::team), Structs.comparingBool(p -> !p.admin))); + if(search.getText().length() > 0){ +- players.retainAll(p -> Strings.stripColors(p.name().toLowerCase()).contains(search.getText().toLowerCase())); ++ players.retainAll(p -> p.name().toLowerCase().contains(search.getText().toLowerCase()) || Strings.stripColors(p.name().toLowerCase()).contains(search.getText().toLowerCase())); + } - Table button = new Table(); - button.left(); -@@ -121,28 +128,16 @@ public class PlayerListFragment{ + for(var user : players){ +@@ -120,28 +122,25 @@ public class PlayerListFragment{ + iconTable.addListener(listener); iconTable.addListener(new HandCursorListener()); } - iconTable.margin(8); -- iconTable.add(new Image(user.icon()).setScaling(Scaling.bounded)).grow(); +- iconTable.margin(8); ++ iconTable.margin(4); + iconTable.add(new Image(user.icon()).setScaling(Scaling.bounded)).grow(); iconTable.name = user.name(); iconTable.touchable = Touchable.enabled; @@ -4145,221 +4133,79 @@ index 9286aab19502b5cf40556311572157b20c60fef4..1165df86591dea2b418802c309a55c2b } }); -- button.add(iconTable).size(h); + button.add(iconTable).size(h); - button.labelWrap("[#" + user.color().toString().toUpperCase() + "]" + user.name()).style(Styles.outlineLabel).width(170f).pad(10); - button.add().grow(); -- ++ button.image(Icon.admin).visible(() -> user.admin && !(!user.isLocal() && net.server())).pad(4).get().updateVisibility(); ++ button.labelWrap("[#" + user.color().toString().toUpperCase() + "]" + user.name()).style(Styles.outlineLabel).growX(); + - button.background(Tex.underline); -- ++ button.background(Tex.underlineWhite); ++ button.setColor(state.rules.pvp || Core.settings.getBool("arcAlwaysTeamColor") ? user.team().color : Pal.gray); + - button.image(Icon.admin).visible(() -> user.admin && !(!user.isLocal() && net.server())).padRight(5).get().updateVisibility(); -- + var ustyle = new ImageButtonStyle(){{ down = Styles.none; - up = Styles.none; -@@ -151,10 +146,105 @@ public class PlayerListFragment{ +@@ -151,11 +150,37 @@ public class PlayerListFragment{ imageOverColor = Color.lightGray; }}; -- if(net.server() || (player.admin && (!user.admin || user == player))){ -- button.add().growY(); -+ iconTable.margin(4); -+ iconTable.add(new Image(user.icon()).setScaling(Scaling.bounded)).grow(); -+ iconTable.name = user.name(); -+ -+ if (Core.settings.getBool("arcPlayerList")){ -+ button.add(iconTable).size(h); -+ button.image(Icon.admin).visible(() -> user.admin && !(!user.isLocal() && net.server())).size(bs).get().updateVisibility(); -+ button.table( -+ t -> { -+ t.labelWrap("[#" + user.color().toString().toUpperCase() + "]" + user.name()).minWidth(380f); -+ t.touchable = Touchable.enabled; -+ t.tapped(()->{ -+ Core.app.setClipboardText(user.name); -+ UIExt.announce("复制昵称:" + user.name); -+ }); -+ } -+ ).width(400f).pad(10f).left(); -+ -+ button.add().grow(); -+ -+ button.button("♐", Styles.cleart, () -> { -+ ArcMessageDialog.share("AT", "戳了" + user.name + "[white]一下,并提醒你留意对话框"); -+ }).color(Pal.accent).size(buttonSize); -+ -+ button.button(String.valueOf(Iconc.lock), Styles.cleart, () -> { -+ if(follow != user){ -+ follow = user; -+ }else { -+ follow = null; ++ button.button(Icon.copySmall, ustyle, () -> { ++ Core.app.setClipboardText(user.name); ++ UIExt.announce("已复制昵称:" + user.name); ++ }).size(iconMed); ++ button.button(Icon.linkSmall, ustyle, () -> ArcMessageDialog.share("AT", "戳了" + user.name + "[white]一下,并提醒你留意对话框")).size(iconMed); ++ button.button(Icon.lockSmall, ustyle, () -> { ++ if(InputHandler.follow != user){ ++ InputHandler.follow = user; ++ if(control.input instanceof DesktopInput d){ ++ d.panning = true; + } -+ if(control.input instanceof DesktopInput){ -+ ((DesktopInput) control.input).panning = follow == user; -+ UIExt.announce("追踪玩家:" + user.name); -+ } -+ }).checked(b -> { -+ boolean checked = follow == user; -+ b.setText(checked ? String.valueOf(Iconc.lock) : String.valueOf(Iconc.lockOpen)); -+ return checked; -+ }).size(buttonSize); -+ -+ button.button("[coral]" + Iconc.planeOutline, Styles.cleart, -+ () -> { -+ ui.showConfirm("@confirm", Core.bundle.format("confirmvotekick", user.name()), () -> { -+ Call.sendChatMessage("/votekick " + user.name()); -+ }); -+ }).size(buttonSize); -+ -+ if((net.server() || player.admin) && !user.isLocal() && (!user.admin || net.server())){ -+ button.button("[gold]" + Iconc.zoom, Styles.cleart, () -> Call.adminRequest(user, AdminAction.trace, null)).size(buttonSize); -+ button.button("[gold]" + Iconc.cancel, Styles.cleart, -+ () -> ui.showConfirm("@confirm", Core.bundle.format("confirmkick", user.name()), () -> Call.adminRequest(user, AdminAction.kick, null))).size(buttonSize); -+ button.button("[gold]" + Iconc.hammer, Styles.cleart, -+ () -> ui.showConfirm("@confirm", Core.bundle.format("confirmban", user.name()), () -> Call.adminRequest(user, AdminAction.ban, null))).size(buttonSize); -+ } -+ if (teamMode) { -+ if (state.teams.getActive().size <= 5){ -+ state.teams.getActive().each(teamData -> button.button("[#" + teamData.team.color + "]" + teamData.team.localized(), Styles.cleart, -+ () -> Call.sendChatMessage("/js Groups.player.find(e=>e.name== \"" + user.name + "\").team(Team.get(" + teamData.team.id + "))")).size(buttonSize)); -+ } -+ button.button("[violet]+", Styles.cleart, () -> UIExt.teamSelect.pickOne(team -> -+ Call.sendChatMessage("/js Groups.player.find(e=>e.name== \"" + user.name + "\").team(Team.get(" + team.id + "))"), user.team())).size(buttonSize); -+ } else if (net.server() || (player.admin && (!user.admin || user == player))) { -+ if (state.teams.getActive().size <= 5){ -+ state.teams.getActive().each(teamData -> button.button("[#" + teamData.team.color + "]" + teamData.team.localized(), Styles.cleart, -+ () -> Call.adminRequest(user, AdminAction.switchTeam, teamData.team)).size(buttonSize)); -+ } -+ button.button("[violet]+",Styles.cleart,()-> UIExt.teamSelect.pickOne(team -> Call.adminRequest(user, AdminAction.switchTeam, team), user.team())).size(buttonSize); -+ } -+ if((net.server() || (player.admin && (!user.admin || user == player))) && !net.client() && !user.isLocal()){ -+ button.button("" + Iconc.admin,Styles.cleart, () -> { -+ String id = user.uuid(); -+ -+ if(user.admin){ -+ ui.showConfirm("@confirm", Core.bundle.format("confirmunadmin", user.name()), () -> { -+ netServer.admins.unAdminPlayer(id); -+ user.admin = false; -+ }); -+ }else{ -+ ui.showConfirm("@confirm", Core.bundle.format("confirmadmin", user.name()), () -> { -+ netServer.admins.adminPlayer(id, user.usid()); -+ user.admin = true; -+ }); -+ } -+ }).checked(b -> user.admin).row(); ++ }else{ ++ InputHandler.follow = null; + } -+ } -+ //原版模式 -+ else { -+ button.add(iconTable).size(h); -+ button.labelWrap("[#" + user.color().toString().toUpperCase() + "]" + user.name()).style(Styles.outlineLabel).width(170f).pad(10); -+ button.add().grow(); -+ -+ button.background(Tex.underline); -+ -+ button.image(Icon.admin).visible(() -> user.admin && !(!user.isLocal() && net.server())).padRight(5).get().updateVisibility(); -+ -+ if(net.server() || (player.admin && (!user.admin || user == player))){ -+ button.add().growY(); - -- if(allowTeamSwitch || user != player){ - button.button(Icon.menu, ustyle, () -> { ++ UIExt.announce("追踪玩家:" + user.name); ++ }).checked(b -> { ++ boolean checked = InputHandler.follow == user; ++ b.getImage().setDrawable(checked ? Icon.lockSmall : Icon.lockOpenSmall); ++ return checked; ++ }).size(iconMed); ++ ++ button.button(Icon.planeOutlineSmall, ustyle, () -> ++ ui.showTextInput("@votekick.reason", Core.bundle.format("votekick.reason.message", user.name()), "", reason -> ++ Call.sendChatMessage("/votekick #" + user.id + " " + reason)) ++ ).size(iconMed); ++ + if(net.server() || (player.admin && (!user.admin || user == player))){ + button.add().growY(); + + if(allowTeamSwitch || user != player){ +- button.button(Icon.menu, ustyle, () -> { ++ button.button(Icon.wrenchSmall, ustyle, () -> { var dialog = new BaseDialog(user.coloredName()); -@@ -181,43 +271,42 @@ public class PlayerListFragment{ - ui.showConfirm("@confirm", Core.bundle.format("confirmkick", user.name()), () -> Call.adminRequest(user, AdminAction.kick, null)); - dialog.hide(); - }).row(); -+ } - -+ if(!user.isLocal()){ - t.button("@player.trace", Icon.zoom, bstyle, () -> { - Call.adminRequest(user, AdminAction.trace, null); - dialog.hide(); - }).row(); - } - -- //there's generally no reason to team switch outside PvP or sandbox, and it's basically an easy way to cheat -- if(allowTeamSwitch){ -- t.button("@player.team", Icon.redo, bstyle, () -> { -- var teamSelect = new BaseDialog(Core.bundle.get("player.team") + ": " + user.name); -- teamSelect.setFillParent(false); -+ t.button("@player.team", Icon.redo, bstyle, () -> { -+ var teamSelect = new BaseDialog(Core.bundle.get("player.team") + ": " + user.name); -+ teamSelect.setFillParent(false); - -- var group = new ButtonGroup<>(); -+ var group = new ButtonGroup<>(); - -- int i = 0; -+ int i = 0; - -- for(Team team : Team.baseTeams){ -- var b = new ImageButton(Tex.whiteui, Styles.clearNoneTogglei); -- b.margin(4f); -- b.getImageCell().grow(); -- b.getStyle().imageUpColor = team.color; -- b.clicked(() -> { -- Call.adminRequest(user, AdminAction.switchTeam, team); -- teamSelect.hide(); -- }); -- teamSelect.cont.add(b).size(50f).checked(a -> user.team() == team).group(group); -+ for(Team team : Team.baseTeams){ -+ var b = new ImageButton(Tex.whiteui, Styles.clearNoneTogglei); -+ b.margin(4f); -+ b.getImageCell().grow(); -+ b.getStyle().imageUpColor = team.color; -+ b.clicked(() -> { -+ Call.adminRequest(user, AdminAction.switchTeam, team); -+ teamSelect.hide(); -+ }); -+ teamSelect.cont.add(b).size(50f).checked(a -> user.team() == team).group(group); - -- if(i++ % 3 == 2) teamSelect.cont.row(); -- } -+ if(i++ % 3 == 2) teamSelect.cont.row(); -+ } - -- teamSelect.addCloseButton(); -- teamSelect.show(); -+ teamSelect.addCloseButton(); -+ teamSelect.show(); - -- dialog.hide(); -- }).row(); -- } -+ dialog.hide(); -+ }).row(); - - if(!net.client() && !user.isLocal()){ - t.button("@player.admin", Icon.admin, Styles.togglet, () -> { -@@ -242,20 +331,21 @@ public class PlayerListFragment{ + dialog.title.setColor(Color.white); +@@ -242,20 +267,11 @@ public class PlayerListFragment{ dialog.cont.button("@back", Icon.left, dialog::hide).padTop(-1f).size(220f, 55f); dialog.show(); -+ }).size(h); - -+ }else if(!user.isLocal() && !user.admin && net.client() && Groups.player.size() >= 3 && player.team() == user.team()){ //votekick -+ button.add().growY(); - +- +- - }).size(h); -+ button.button(Icon.hammer, ustyle, -+ () -> ui.showTextInput("@votekick.reason", Core.bundle.format("votekick.reason.message", user.name()), "", -+ reason -> Call.sendChatMessage("/votekick #" + user.id + " " + reason))) -+ .size(h); ++ }).size(iconMed); } - }else if(!user.isLocal() && !user.admin && net.client() && Groups.player.size() >= 3 && player.team() == user.team()){ //votekick - button.add().growY(); - +- - button.button(Icon.hammer, ustyle, - () -> ui.showTextInput("@votekick.reason", Core.bundle.format("votekick.reason.message", user.name()), "", - reason -> Call.sendChatMessage("/votekick #" + user.id + " " + reason))) - .size(h); } -- + - content.add(button).width(350f).height(h + 14); -+ content.add(button).padBottom(-6).width(700f).maxHeight(h + 14); -+ content.row(); -+ content.image().height(4f).color(state.rules.pvp|| Core.settings.getBool("arcAlwaysTeamColor") ? user.team().color : Pal.gray).growX(); ++ content.add(button).width(600f).height(h + 14); content.row(); } @@ -4504,7 +4350,7 @@ index a47363df2f463338875a2937dfeffdd0411d492a..03fd8c4d74637c02a3a12353ec35e8c0 } } diff --git a/core/src/mindustry/world/blocks/ConstructBlock.java b/core/src/mindustry/world/blocks/ConstructBlock.java -index f45822964a30770bc15e4865429ef7749b4ce620..61425f62a03c91b5a6bc88d18a35de566bb2cb5e 100644 +index f45822964a30770bc15e4865429ef7749b4ce620..6c28b1574e70a7aa38b3edc200d3aee7ec01543d 100644 --- a/core/src/mindustry/world/blocks/ConstructBlock.java +++ b/core/src/mindustry/world/blocks/ConstructBlock.java @@ -3,14 +3,17 @@ package mindustry.world.blocks; @@ -4577,7 +4423,7 @@ index f45822964a30770bc15e4865429ef7749b4ce620..61425f62a03c91b5a6bc88d18a35de56 + requirements.append(stack.item.emoji()).append(hasItem ? "[#ffd37f]" : "[#e55454]").append(investItem).append("/").append(needItem).append("/").append(UI.formatAmount(coreAmount)).append("[]"); + } + pos.set(this).add(-buildHitSize / 2f, -buildHitSize / 2f);//左下角 -+ FuncX.drawText(pos, requirements.toString(), scl, Color.white, Align.bottomLeft); ++ FuncX.drawText(pos, requirements.toString(), scl, Color.white, Align.topLeft); + } + @Override @@ -5097,7 +4943,7 @@ index 0000000000000000000000000000000000000000..94e5146690c6394393ea218f67ef1db8 + } +} diff --git a/core/src/mindustryX/features/ArcOld.java b/core/src/mindustryX/features/ArcOld.java -index d498b911575861c53dcefe39434c3593fa594a4c..e9fa2ec00f4bc18b4e9659ef5e1be0c71c975d1e 100644 +index 17009f955dd1f407bdfa3c9731daba67df6388d2..de04c90eb7ec50b58a95bb9f4ead27a9eeac58ae 100644 --- a/core/src/mindustryX/features/ArcOld.java +++ b/core/src/mindustryX/features/ArcOld.java @@ -1,15 +1,20 @@ @@ -5121,7 +4967,7 @@ index d498b911575861c53dcefe39434c3593fa594a4c..e9fa2ec00f4bc18b4e9659ef5e1be0c7 import static mindustry.Vars.*; public class ArcOld{ -@@ -229,4 +234,41 @@ public class ArcOld{ +@@ -228,4 +233,41 @@ public class ArcOld{ c.checkPref("developMode", false); })); } @@ -6432,20 +6278,17 @@ index 0000000000000000000000000000000000000000..b3bf32d2d3da28f6adc38c56ea3d2440 + } +} diff --git a/core/src/mindustryX/features/RenderExt.java b/core/src/mindustryX/features/RenderExt.java -index f90dc699fdf4e83af3011322042315a081f9f2bc..e45a96437cd84779f9d0499fbfc0d20346df6372 100644 +index 269e2571a440517f257237920a5155a9eb5032a2..93583a5386d0702d886d8c70ce9ed3b0f125cfe4 100644 --- a/core/src/mindustryX/features/RenderExt.java +++ b/core/src/mindustryX/features/RenderExt.java -@@ -7,8 +7,8 @@ import arc.math.*; - import arc.math.geom.*; - import arc.util.*; +@@ -9,12 +9,14 @@ import arc.util.*; import mindustry.*; --import mindustry.arcModule.draw.*; import mindustry.entities.*; -+import mindustry.game.*; import mindustry.game.EventType.*; ++import mindustry.game.*; import mindustry.gen.*; import mindustry.graphics.*; -@@ -16,12 +16,14 @@ import mindustry.type.*; + import mindustry.type.*; import mindustry.world.*; import mindustry.world.blocks.defense.*; import mindustry.world.blocks.defense.turrets.*; @@ -6453,33 +6296,34 @@ index f90dc699fdf4e83af3011322042315a081f9f2bc..e45a96437cd84779f9d0499fbfc0d203 import mindustry.world.blocks.distribution.MassDriver.*; import mindustry.world.blocks.logic.*; import mindustry.world.blocks.logic.MessageBlock.*; - import mindustry.world.blocks.production.Drill.*; +@@ -22,6 +24,7 @@ import mindustry.world.blocks.production.Drill.*; import mindustry.world.blocks.storage.*; import mindustry.world.blocks.units.*; + import mindustryX.features.draw.*; +import mindustryX.features.func.*; - import static mindustry.Vars.tilesize; + import static mindustry.Vars.*; -@@ -40,6 +42,8 @@ public class RenderExt{ - public static int massDriverLineInterval; - public static boolean drawBars, drawBarsMend; +@@ -42,6 +45,8 @@ public class RenderExt{ public static float healthBarMinHealth; + public static boolean payloadPreview; + public static boolean deadOverlay; + public static boolean drawBlockDisabled; + public static boolean showOtherInfo; public static boolean unitHide = false; public static Color massDriverLineColor = Color.clear; -@@ -80,6 +84,9 @@ public class RenderExt{ - drawBars = Core.settings.getBool("blockBars"); - drawBarsMend = Core.settings.getBool("blockBars_mend"); +@@ -84,6 +89,9 @@ public class RenderExt{ healthBarMinHealth = Core.settings.getInt("blockbarminhealth"); + payloadPreview = Core.settings.getBool("payloadpreview"); + deadOverlay = Core.settings.getBool("deadOverlay"); + drawBlockDisabled = Core.settings.getBool("blockdisabled"); + showOtherInfo = Core.settings.getBool("showOtherTeamState"); + showOtherInfo |= Vars.player.team().id == 255 || Vars.state.rules.mode() != Gamemode.pvp; }); Events.run(Trigger.draw, RenderExt::draw); Events.on(TileChangeEvent.class, RenderExt::onSetBlock); -@@ -105,6 +112,8 @@ public class RenderExt{ +@@ -109,6 +117,8 @@ public class RenderExt{ drawMassDriverLine(b); if(build != null && drawBars) drawBars(build); @@ -6488,7 +6332,7 @@ index f90dc699fdf4e83af3011322042315a081f9f2bc..e45a96437cd84779f9d0499fbfc0d203 } private static void placementEffect(float x, float y, float lifetime, float range, Color color){ -@@ -193,7 +202,7 @@ public class RenderExt{ +@@ -197,7 +207,7 @@ public class RenderExt{ if(buildRatio >= 0){ drawBar(build, Color.black, Pal.accent, buildRatio); String progressT = Strings.format("[stat]@% | @s", (int)(Mathf.clamp(buildRatio, 0f, 1f) * 100), leftTime < 0 ? Iconc.cancel : Strings.fixed(leftTime / (60f * Vars.state.rules.unitBuildSpeed(build.team) * build.timeScale()), 0)); @@ -8206,3 +8050,29 @@ index 0000000000000000000000000000000000000000..4af00d9add5776e8d966880336121b05 + }); + } +} +diff --git a/core/src/mindustryX/features/ui/auxiliary/MapInfoTable.java b/core/src/mindustryX/features/ui/auxiliary/MapInfoTable.java +index f0ac04dfb87f841f5c4662e6bfe3a77e51d5ced9..8c88817b7dd08f3a8fe98dbdb6d05bdc4cb6bde7 100644 +--- a/core/src/mindustryX/features/ui/auxiliary/MapInfoTable.java ++++ b/core/src/mindustryX/features/ui/auxiliary/MapInfoTable.java +@@ -35,15 +35,13 @@ public class MapInfoTable extends AuxiliaryTools.Table{ + button(Items.copper.emoji(), RStyles.clearLineNonet, this::floorStatisticDialog).tooltip("矿物信息"); + button(Icon.chatSmall, RStyles.clearAccentNonei, () -> UIExt.arcMessageDialog.show()).tooltip("中央监控室"); + button(Icon.playersSmall, RStyles.clearAccentNonei, () -> { +- if(ui.listfrag.players.size > 1){ +- if(control.input instanceof DesktopInput){ +- ((DesktopInput)control.input).panning = true; +- } +- if(InputHandler.follow == null) InputHandler.follow = ui.listfrag.players.get(0); +- InputHandler.followIndex = (InputHandler.followIndex + 1) >= ui.listfrag.players.size ? 0 : InputHandler.followIndex + 1; +- InputHandler.follow = ui.listfrag.players.get(InputHandler.followIndex); +- UIExt.announce("视角追踪:" + InputHandler.follow.name); ++ var players = Groups.player.copy(); ++ if(players.isEmpty())return; ++ if(control.input instanceof DesktopInput){ ++ ((DesktopInput)control.input).panning = true; + } ++ InputHandler.follow = players.get((players.indexOf(InputHandler.follow, true) + 1) % players.size); ++ UIExt.announce("视角追踪:" + InputHandler.follow.name); + }).tooltip("切换跟踪玩家"); + if(!mobile) button(Icon.editSmall, RStyles.clearAccentNonei, this::uiTable).tooltip("ui大全"); + } diff --git a/patches/client/0092-BUILD-BE-release.patch b/patches/client/0097-BUILD-BE-release.patch similarity index 73% rename from patches/client/0092-BUILD-BE-release.patch rename to patches/client/0097-BUILD-BE-release.patch index 2080ab9b69ad..63545517a774 100644 --- a/patches/client/0092-BUILD-BE-release.patch +++ b/patches/client/0097-BUILD-BE-release.patch @@ -4,21 +4,22 @@ Date: Wed, 3 Jul 2024 00:16:15 +0800 Subject: [PATCH] BUILD BE release --- - .github/workflows/build.yml | 8 +++++--- + .github/workflows/build.yml | 6 ++++-- .github/workflows/gradle-wrapper-validation.yml | 10 ---------- - 2 files changed, 5 insertions(+), 13 deletions(-) + gradle.properties | 3 ++- + 3 files changed, 6 insertions(+), 13 deletions(-) delete mode 100644 .github/workflows/gradle-wrapper-validation.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml -index 797925569a7a81a34dff17296884a7088e05d5f1..da5e36d6a525f365832306d99dde6b97f2882149 100644 +index 797925569a7a81a34dff17296884a7088e05d5f1..04d360717113342650e43a37cc3b541376a1d3d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml -@@ -34,17 +34,19 @@ jobs: +@@ -34,16 +34,18 @@ jobs: echo "${{ secrets.KEYSTORE_BASE64 }}" | openssl enc -d -base64 -in - -out ../bekeystore.jks - name: Build run: | - gradle desktop:dist core:genLoaderModAll -Pbuildversion=${RELEASE_VERSION} -+ gradle desktop:dist server:dist -Pbuildversion=${RELEASE_VERSION} -PversionType=bleeding-edge ++ gradle desktop:dist server:dist -Pbuildversion=${RELEASE_VERSION} mkdir artifacts mv desktop/build/libs/Mindustry.jar artifacts/MindustryX-${{env.RELEASE_VERSION}}-Desktop.jar - mv core/build/distributions/MindustryX.loader.dex.jar artifacts/MindustryX-${{env.RELEASE_VERSION}}.loader.dex.jar @@ -29,13 +30,11 @@ index 797925569a7a81a34dff17296884a7088e05d5f1..da5e36d6a525f365832306d99dde6b97 keystore_alias_password: ${{ secrets.KEYSTORE_PASSWORD_SECRET }} keystore_alias: MindustryX run: | -- gradle android:assembleRelease -Pbuildversion=${RELEASE_VERSION} + sed -i 's/tinylake.mindustryX/tinylake.mindustryX.be/g' android/build.gradle + sed -i 's/MindustryX/MindustryX BE/g' android/res/values/strings.xml -+ gradle android:assembleRelease -Pbuildversion=${RELEASE_VERSION} -PversionType=bleeding-edge + gradle android:assembleRelease -Pbuildversion=${RELEASE_VERSION} mv android/build/outputs/apk/release/android-release.apk artifacts/MindustryX-${{env.RELEASE_VERSION}}-Android.apk - name: Update Tag - uses: rickstaa/action-create-tag@v1 diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml deleted file mode 100644 index 95cce8bab650b7357a7b675ea34c04601a1ec66a..0000000000000000000000000000000000000000 @@ -52,3 +51,16 @@ index 95cce8bab650b7357a7b675ea34c04601a1ec66a..00000000000000000000000000000000 - steps: - - uses: actions/checkout@v4 - - uses: gradle/wrapper-validation-action@v2 +diff --git a/gradle.properties b/gradle.properties +index 85ffb7703a2f41e9ec9d7c4681158d00e12add6c..9db1da94af1f4ffa5e487905fb718f4f0e57db68 100644 +--- a/gradle.properties ++++ b/gradle.properties +@@ -30,4 +30,5 @@ org.gradle.internal.http.connectionTimeout=100000 + android.enableR8.fullMode=false + archash=96cd86d08a + +-upstreamBuild=25136 +\ No newline at end of file ++upstreamBuild=25136 ++versionType=bleeding-edge +\ No newline at end of file