客户端问题修改
This commit is contained in:
+20
-2
@@ -183,6 +183,11 @@ func setup(m2client: Node, assets_root: String,
|
||||
net_world.set_camera(cam)
|
||||
net_world.set_local_node(player)
|
||||
net_world.entity_added.connect(func(node: Node3D, _vid: int):
|
||||
# Model-factory upgrades replace an earlier placeholder node in place.
|
||||
# Drop queued-for-free entries before registering the rebuilt pick target.
|
||||
for old in pc.pickables.duplicate():
|
||||
if old == null or not is_instance_valid(old):
|
||||
pc.pickables.erase(old)
|
||||
if node not in pc.pickables:
|
||||
pc.pickables.append(node))
|
||||
net_world.entity_removed.connect(func(vid: int):
|
||||
@@ -272,7 +277,7 @@ func setup(m2client: Node, assets_root: String,
|
||||
add_child(quickbar)
|
||||
quickbar.item_mouse = mouse_controller
|
||||
quickbar.net_play = net_play # §3.8 修改 1:技能三层校验的运行期上下文
|
||||
quickbar.setup(client, skill_table, ui, func() -> Node: return player)
|
||||
quickbar.setup(client, skill_table, ui, func() -> Node: return player, assets_root)
|
||||
# §3.4 MODE_USE_SKILL:预约技能进射程后由 quickbar 执行实际施法。
|
||||
if net_play:
|
||||
net_play.use_skill_hook = func(slot: int) -> bool: return quickbar.activate_reserved(slot)
|
||||
@@ -1333,12 +1338,25 @@ func _build_lighting() -> void:
|
||||
e.background_color = Color(0.55, 0.62, 0.72)
|
||||
e.ambient_light_source = Environment.AMBIENT_SOURCE_COLOR
|
||||
e.ambient_light_color = Color(0.5, 0.55, 0.62)
|
||||
e.ambient_light_energy = 0.6
|
||||
e.ambient_light_energy = 0.42
|
||||
e.tonemap_mode = Environment.TONE_MAPPER_LINEAR
|
||||
e.tonemap_exposure = 0.82
|
||||
e.adjustment_enabled = true
|
||||
e.adjustment_saturation = 1.05
|
||||
e.adjustment_contrast = 1.08
|
||||
e.adjustment_brightness = 0.88
|
||||
we.environment = e
|
||||
add_child(we)
|
||||
_env = e
|
||||
|
||||
func _on_main_set(vid: int) -> void:
|
||||
# GC_MAIN_CHARACTER can arrive after GameScene has subscribed. Mark this VID
|
||||
# as local before building its view so NetWorld removes (and never recreates)
|
||||
# the generic remote-player capsule for our own character.
|
||||
if net_world and net_world.has_method("set_local_vid"):
|
||||
net_world.set_local_vid(vid)
|
||||
if net_world and net_world.has_method("set_local_node") and player:
|
||||
net_world.set_local_node(player)
|
||||
var e: Dictionary = client.get_entity(vid)
|
||||
if e.is_empty() or player == null:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user