Networked client on the existing Godot 4.7 + libgr2 renderer:
- net: m2dev wire protocol (libsodium KX + XChaCha20), auth/select/game
phases, EntityStore world model, ~all GC/CG headers. char create/delete,
private shop / mall / cube, SHOP_GC_START_EX, guild, party (+ CG_PARTY_SET_STATE),
quests, dragon soul, refine, safebox, exchange.
- UI: in-game windows migrated 1:1 from the reference uiscript/root .py —
char status (/stat), inventory+equipment, select-item ([SELECT_ITEM] quest
token), system-option + game-option + ESC system menu, private-shop 39-grid,
party info board, shop tabs, atlas, minimap, quickbar, chat, …
- EterGrnLib polish: GR2 material blend/two-sided, LOD crossfade, motion-event
dispatch, contact shadow, ray-AABB picking, weapon grip pre-transform.
Portable asset IO (A1) — all extension/libgr2/formats/mtproto reads routed
through godot::FileAccess (res:// PCK works on iOS/Android); standalone-lib
*_path() kept for the non-Godot CTests. AssetResolver + PropertyRegistry
switched to a baked index (bake_asset_index.gd) instead of std::filesystem.
Mobile builds: build-{android,ios}.sh, export-android.sh, pack-assets.sh,
gen-debug-keystore.sh. Assets ship as a zip mounted at runtime by
project/asset_pack.gd (adb push now; HTTP download is a drop-in later).
ctest 10/10, 34 GDScript suites, macOS/iOS/Android all build.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013EJxkHiNKS4kybHS3XKyAJ
52 lines
1.5 KiB
GDScript
52 lines
1.5 KiB
GDScript
# LoveUI — GC_LOVER_INFO / GC_LOVE_POINT_UPDATE 的常驻情侣状态。
|
|
extends Node
|
|
|
|
var client: Node
|
|
var _root: Panel
|
|
var _name: Label
|
|
var _bar: ProgressBar
|
|
|
|
func setup(m2client: Node, parent: Node) -> void:
|
|
client = m2client
|
|
_build(parent)
|
|
if client.has_signal("lover_changed"):
|
|
client.lover_changed.connect(func(_lover: Dictionary): refresh())
|
|
refresh()
|
|
|
|
func refresh() -> void:
|
|
if client == null or not client.has_method("get_lover"):
|
|
return
|
|
var lover: Dictionary = client.get_lover()
|
|
var valid := bool(lover.get("valid", false))
|
|
_root.visible = valid
|
|
if not valid:
|
|
return
|
|
_name.text = "♥ " + String(lover.get("name", ""))
|
|
_bar.value = clampi(int(lover.get("love_point", 0)), 0, 100)
|
|
_bar.tooltip_text = "爱意值:%d%%" % int(_bar.value)
|
|
|
|
func _build(parent: Node) -> void:
|
|
_root = Panel.new()
|
|
_root.name = "LoveStatus"
|
|
_root.set_anchors_preset(Control.PRESET_TOP_RIGHT)
|
|
_root.position = Vector2(-238, 28)
|
|
_root.size = Vector2(220, 48)
|
|
var bg := StyleBoxFlat.new()
|
|
bg.bg_color = Color(0.14, 0.05, 0.10, 0.88)
|
|
bg.border_color = Color(0.95, 0.35, 0.55, 0.9)
|
|
bg.set_border_width_all(1)
|
|
bg.set_corner_radius_all(5)
|
|
_root.add_theme_stylebox_override("panel", bg)
|
|
parent.add_child(_root)
|
|
_name = Label.new()
|
|
_name.position = Vector2(9, 5)
|
|
_name.add_theme_font_size_override("font_size", 13)
|
|
_name.modulate = Color(1.0, 0.72, 0.82)
|
|
_root.add_child(_name)
|
|
_bar = ProgressBar.new()
|
|
_bar.position = Vector2(9, 27)
|
|
_bar.size = Vector2(202, 13)
|
|
_bar.max_value = 100
|
|
_bar.show_percentage = false
|
|
_root.add_child(_bar)
|