Skip to content

Commit

Permalink
refactor: change render outline config option
Browse files Browse the repository at this point in the history
  • Loading branch information
isHarryh committed Sep 6, 2024
1 parent 887e1fc commit 4cd6b15
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions assets/ArkPetsConfigDefault.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions core/src/cn/harryh/arkpets/ArkConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -156,8 +156,8 @@ public static ArkConfig getDefaultConfig() {
*/
public enum RenderOutline {
NEVER,
TOUCHING,
DRAGGING,
PRESSING,
FOCUSED,
_RESERVED,
ALWAYS;
Expand Down
2 changes: 1 addition & 1 deletion core/src/cn/harryh/arkpets/ArkPets.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) -> {
Expand Down

0 comments on commit 4cd6b15

Please sign in to comment.