完善客户端功能并同步差距文档
This commit is contained in:
@@ -26,7 +26,9 @@ class FakeClient extends Node:
|
||||
|
||||
class FakeProto extends Node:
|
||||
func item(vnum: int) -> Dictionary:
|
||||
return {"vnum": vnum, "name": "Item%d" % vnum, "locale_name": "物品%d" % vnum, "type": 1}
|
||||
# type 1 = WEAPON;给出可穿戴位 + 空限制,让 EquipRules 前置门放行。
|
||||
return {"vnum": vnum, "name": "Item%d" % vnum, "locale_name": "物品%d" % vnum,
|
||||
"type": 1, "sub_type": 0, "anti_flags": 0, "wear_flags": 1 << 4, "limits": []}
|
||||
|
||||
var _fail := 0
|
||||
func _ck(c: bool, m: String) -> void:
|
||||
@@ -61,6 +63,10 @@ func _run() -> void:
|
||||
fc.equip[1] = {"vnum": 11209, "count": 1, "wear": 1}
|
||||
|
||||
var iv: Node = InventoryUI.new()
|
||||
var mouse := preload("res://ui/mouse_controller.gd").new()
|
||||
get_root().add_child(mouse)
|
||||
mouse.setup(ui)
|
||||
iv.item_mouse = mouse
|
||||
get_root().add_child(iv)
|
||||
iv.setup(ui, fc, fp, assets)
|
||||
iv.open()
|
||||
@@ -88,6 +94,10 @@ func _run() -> void:
|
||||
# 拖 5 -> 91(背包 -> 装备)
|
||||
iv.move_to(5, 91, 1)
|
||||
_ck(fc.moved.size() == 1 and fc.moved[0] == [1, 5, 2, 1, 1], "move_to(5,91) -> move_item(1,5,2,1,1)")
|
||||
_ck(iv._drop_mouse_item({"window": 1, "cell": 6, "vnum": 27, "count": 3}, 8),
|
||||
"mouse drop accepts inventory stack")
|
||||
_ck(fc.moved.size() == 2 and fc.moved[1] == [1, 6, 1, 8, 3],
|
||||
"mouse drop preserves attached stack count")
|
||||
|
||||
iv.close()
|
||||
_ck(not iv.is_open(), "window closed")
|
||||
|
||||
Reference in New Issue
Block a user