add plugin settings, per-tile refresh, settings menu, touch-friendly UI
- Plugin settings infrastructure in PluginManager with config/plugin_settings.cfg storage, manifest [settings] sections, CRUD API, plugin_setting_changed signal - Per-tile refresh intervals: 100ms base tick, per-tile update_interval_ms metadata, dynamic tween durations clamped to refresh window - Settings menu (PopupPanel) with General/Plugins/About tabs, plugin activation toggles, per-plugin settings cog buttons - Plugin settings popup (PopupPanel) with dynamic UI from setting definitions (SpinBox/CheckBox/LineEdit), auto-save on change - Modal behavior: exclusive = true on settings windows - Touch-friendly sizing: enlarged close buttons, cog buttons, controls, spacing - Red corner close button redesign with rounded corners, hover/pressed states - Split system_monitor into local_system_monitor (CPU, Memory) and test plugins - Plugin activation/deactivation with layout preservation
This commit is contained in:
parent
12b45b2685
commit
57b36798b9
24 changed files with 1065 additions and 183 deletions
30
plugins/test/plugin.cfg
Normal file
30
plugins/test/plugin.cfg
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
[plugin]
|
||||
name="Test"
|
||||
version="0.1.0"
|
||||
description="Development testing tiles and framework experiments"
|
||||
author="Fifthdread"
|
||||
|
||||
[tiles]
|
||||
count=1
|
||||
|
||||
[tile_0]
|
||||
id="testing"
|
||||
name="Testing"
|
||||
scene="res://plugins/test/tiles/testing/testing_tile.tscn"
|
||||
min_w=1
|
||||
min_h=1
|
||||
max_w=4
|
||||
max_h=4
|
||||
default_w=1
|
||||
default_h=1
|
||||
|
||||
[settings]
|
||||
count=1
|
||||
|
||||
[setting_0]
|
||||
key="testing_update_interval_ms"
|
||||
label="Testing Update Interval"
|
||||
type="int"
|
||||
default=1000
|
||||
min=100
|
||||
max=60000
|
||||
67
plugins/test/tiles/testing/testing_tile.gd
Normal file
67
plugins/test/tiles/testing/testing_tile.gd
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
extends PluginTile
|
||||
|
||||
|
||||
@onready var title_label: Label = %Title
|
||||
@onready var label: Label = %Label
|
||||
@onready var vial_fill: ColorRect = %VialFill
|
||||
|
||||
var _displayed_fill: float = 0.0
|
||||
var _fill_tween: Tween
|
||||
var _cycle: int = 0
|
||||
var _levels: Array[float] = [0.0, 0.25, 0.50, 0.75, 1.0]
|
||||
|
||||
|
||||
func initialize() -> void:
|
||||
module_title = "Testing"
|
||||
_setup_shader()
|
||||
_style()
|
||||
|
||||
|
||||
func refresh(data: Dictionary) -> void:
|
||||
_cycle = (_cycle + 1) % _levels.size()
|
||||
var target: float = _levels[_cycle]
|
||||
|
||||
label.text = "%d%%" % roundi(target * 100.0)
|
||||
|
||||
# Clamp duration so animation never outlasts the refresh interval
|
||||
var update_ms: int = data.get("update_interval_ms", 1000)
|
||||
var duration: float = minf(0.6, update_ms / 1500.0)
|
||||
if _fill_tween and _fill_tween.is_valid():
|
||||
_fill_tween.kill()
|
||||
_fill_tween = create_tween()
|
||||
_fill_tween.tween_method(_set_fill, _displayed_fill, target, duration).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_CUBIC)
|
||||
|
||||
|
||||
func _set_fill(value: float) -> void:
|
||||
_displayed_fill = value
|
||||
var mat := vial_fill.material as ShaderMaterial
|
||||
if mat:
|
||||
mat.set_shader_parameter("fill", value)
|
||||
|
||||
|
||||
func _setup_shader() -> void:
|
||||
var mat := ShaderMaterial.new()
|
||||
mat.shader = preload("res://shaders/vial_fill.gdshader")
|
||||
mat.set_shader_parameter("liquid_color", Color(0.6, 0.3, 0.8, 1.0))
|
||||
mat.set_shader_parameter("fill", 0.0)
|
||||
mat.set_shader_parameter("noise_tex", load("res://assets/textures/noise_100.png"))
|
||||
vial_fill.material = mat
|
||||
|
||||
|
||||
func _style() -> void:
|
||||
var panel := StyleBoxFlat.new()
|
||||
panel.bg_color = Color.TRANSPARENT
|
||||
panel.corner_radius_top_left = 12
|
||||
panel.corner_radius_top_right = 12
|
||||
panel.corner_radius_bottom_right = 12
|
||||
panel.corner_radius_bottom_left = 12
|
||||
add_theme_stylebox_override("panel", panel)
|
||||
add_theme_stylebox_override("panel_focused", panel)
|
||||
|
||||
title_label.add_theme_color_override("font_color", Color(0.7, 0.7, 0.8, 1.0))
|
||||
title_label.add_theme_constant_override("outline_size", 2)
|
||||
title_label.add_theme_color_override("font_outline_color", Color(0.0, 0.0, 0.0, 0.5))
|
||||
label.add_theme_color_override("font_color", Color(0.9, 0.9, 1.0, 1.0))
|
||||
label.add_theme_font_size_override("font_size", 48)
|
||||
label.add_theme_constant_override("outline_size", 3)
|
||||
label.add_theme_color_override("font_outline_color", Color(0.0, 0.0, 0.0, 0.7))
|
||||
41
plugins/test/tiles/testing/testing_tile.tscn
Normal file
41
plugins/test/tiles/testing/testing_tile.tscn
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
[gd_scene format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://plugins/test/tiles/testing/testing_tile.gd" id="1"]
|
||||
[ext_resource type="Shader" path="res://shaders/vial_fill.gdshader" id="2"]
|
||||
|
||||
[node name="TestingTile" type="PanelContainer"]
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="VialFill" type="ColorRect" parent="."]
|
||||
unique_name_in_owner = true
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
theme_constant_overrides/margin_left = 12
|
||||
theme_constant_overrides/margin_top = 12
|
||||
theme_constant_overrides/margin_right = 12
|
||||
theme_constant_overrides/margin_bottom = 12
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
|
||||
[node name="Title" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
text = "Testing"
|
||||
|
||||
[node name="Spacer" type="Control" parent="MarginContainer/VBoxContainer"]
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
horizontal_alignment = 1
|
||||
size_flags_horizontal = 4
|
||||
Loading…
Add table
Add a link
Reference in a new issue