From 4cd6b158ecc1aa9aa132d2c4dd90a80d85f22f49 Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Fri, 6 Sep 2024 20:55:09 +0800 Subject: [PATCH] refactor: change render outline config option --- assets/ArkPetsConfigDefault.json | 1 + core/src/cn/harryh/arkpets/ArkConfig.java | 4 ++-- core/src/cn/harryh/arkpets/ArkPets.java | 2 +- desktop/src/cn/harryh/arkpets/controllers/SettingsModule.java | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/assets/ArkPetsConfigDefault.json b/assets/ArkPetsConfigDefault.json index e73b88d1..a6282179 100644 --- a/assets/ArkPetsConfigDefault.json +++ b/assets/ArkPetsConfigDefault.json @@ -11,6 +11,7 @@ "display_fps":30, "display_margin_bottom":0, "display_multi_monitors":true, + "display_render_outline":1, "display_scale":1.0, "initial_relative_position":[0.2,0.2], "launcher_solid_exit":true, diff --git a/core/src/cn/harryh/arkpets/ArkConfig.java b/core/src/cn/harryh/arkpets/ArkConfig.java index 57056fe1..b7b58bd1 100644 --- a/core/src/cn/harryh/arkpets/ArkConfig.java +++ b/core/src/cn/harryh/arkpets/ArkConfig.java @@ -62,7 +62,7 @@ public class ArkConfig implements Serializable { public int display_margin_bottom; /** @since ArkPets 2.1 */ @JSONField(defaultValue = "true") public boolean display_multi_monitors; - /** @since ArkPets 3.3 */ @JSONField(defaultValue = "2") + /** @since ArkPets 3.3 */ @JSONField(defaultValue = "1") public int display_render_outline; /** @since ArkPets 1.0 */ @JSONField(defaultValue = "1.0") public float display_scale; @@ -156,8 +156,8 @@ public static ArkConfig getDefaultConfig() { */ public enum RenderOutline { NEVER, - TOUCHING, DRAGGING, + PRESSING, FOCUSED, _RESERVED, ALWAYS; diff --git a/core/src/cn/harryh/arkpets/ArkPets.java b/core/src/cn/harryh/arkpets/ArkPets.java index 5c454248..5ee63a9d 100644 --- a/core/src/cn/harryh/arkpets/ArkPets.java +++ b/core/src/cn/harryh/arkpets/ArkPets.java @@ -155,7 +155,7 @@ public void render() { // 4.Outline. ArkConfig.RenderOutline renderOutline = ArkConfig.RenderOutline.from(config.display_render_outline); cha.setOutlineWidth(renderOutline == ArkConfig.RenderOutline.ALWAYS || - mouseStatus.mouseDown && renderOutline == ArkConfig.RenderOutline.TOUCHING || + mouseStatus.mouseDown && renderOutline == ArkConfig.RenderOutline.PRESSING || isFocused && renderOutline == ArkConfig.RenderOutline.FOCUSED || mouseStatus.dragging && renderOutline == ArkConfig.RenderOutline.DRAGGING ? outlineWidthMax : 0f); diff --git a/desktop/src/cn/harryh/arkpets/controllers/SettingsModule.java b/desktop/src/cn/harryh/arkpets/controllers/SettingsModule.java index 79907eb0..4160e438 100644 --- a/desktop/src/cn/harryh/arkpets/controllers/SettingsModule.java +++ b/desktop/src/cn/harryh/arkpets/controllers/SettingsModule.java @@ -132,8 +132,8 @@ public String getContent() { }; new ComboBoxSetup<>(configRenderOutline).setItems(new NamedItem<>("始终开启", ArkConfig.RenderOutline.ALWAYS.ordinal()), new NamedItem<>("处于前台时", ArkConfig.RenderOutline.FOCUSED.ordinal()), + new NamedItem<>("点击时", ArkConfig.RenderOutline.PRESSING.ordinal()), new NamedItem<>("拖拽时", ArkConfig.RenderOutline.DRAGGING.ordinal()), - new NamedItem<>("点击时", ArkConfig.RenderOutline.TOUCHING.ordinal()), new NamedItem<>("关闭", ArkConfig.RenderOutline.NEVER.ordinal())) .selectValue(app.config.display_render_outline, "未知") .setOnNonNullValueUpdated((observable, oldValue, newValue) -> {