fix(editor): move build stamp to bottom, expand palette list, add hover feedback and instructions
checkpoint / checkpoint (push) Successful in 6m5s

This commit is contained in:
2026-09-16 12:21:39 +00:00
parent 42520b33d5
commit 73172b1e28
6 changed files with 195 additions and 28 deletions
+25 -12
View File
@@ -85,7 +85,11 @@ func _toggle_build_mode() -> void:
func _open_build_mode() -> void:
var model := ChunkEditorModel.create_empty(32, 32, str(Session.world_id), "main")
var world_id_str := str(Session.world_id) if Session.world_id != null else "0"
var room_slug := "main"
var coord := Vector3i.ZERO
var model := ChunkEditorModel.create_empty(32, 32, world_id_str, room_slug, coord)
var catalog := EditorObjectCatalog.new()
var err := catalog.load_catalog()
if err != OK:
@@ -93,6 +97,13 @@ func _open_build_mode() -> void:
var core := EditorCore.new(model, catalog)
_build_editor = InGameEditor.new(core)
if int(world_id_str) > 0:
var save_service := ChunkSaveService.new()
save_service.world_id = world_id_str
save_service.room_slug = room_slug
add_child(save_service)
_build_editor.setup_persistence(save_service, world_id_str, room_slug, coord, 0)
_build_editor.closed.connect(_close_build_mode)
add_child(_build_editor)
@@ -109,6 +120,9 @@ func _close_build_mode() -> void:
if _build_editor != null and is_instance_valid(_build_editor):
_build_editor.queue_free()
_build_editor = null
for child in get_children():
if child is ChunkSaveService:
child.queue_free()
_player.set_physics_process(true)
_player.set_process_unhandled_input(true)
_player._refresh_mouse_mode()
@@ -210,19 +224,18 @@ func _show_build_stamp() -> void:
add_child(layer)
var lbl := Label.new()
lbl.text = "build %s" % _build_label()
lbl.add_theme_color_override("font_color", Color(1, 1, 0.35))
lbl.add_theme_color_override("font_color", Color(1, 1, 0.35, 0.85))
lbl.add_theme_color_override("font_outline_color", Color(0, 0, 0, 1))
lbl.add_theme_constant_override("outline_size", 6)
lbl.add_theme_font_size_override("font_size", 20)
# Full-width strip pinned to the TOP-left. (A bare preset + .position on a
# zero-size Label collapses the rect to negative width and nothing draws --
# which is why this never showed; explicit offsets fix it.)
lbl.set_anchors_preset(Control.PRESET_TOP_WIDE)
lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
lbl.add_theme_constant_override("outline_size", 4)
lbl.add_theme_font_size_override("font_size", 14)
# Pinned to the BOTTOM-right so it never blocks top menu or editor toolbars.
lbl.set_anchors_preset(Control.PRESET_BOTTOM_WIDE)
lbl.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
lbl.vertical_alignment = VERTICAL_ALIGNMENT_BOTTOM
lbl.offset_left = 12
lbl.offset_right = -12
lbl.offset_top = 8
lbl.offset_bottom = 40
lbl.offset_right = -16
lbl.offset_top = -32
lbl.offset_bottom = -8
lbl.mouse_filter = Control.MOUSE_FILTER_IGNORE
layer.add_child(lbl)