diff --git a/project/equip_model_test.gd b/project/equip_model_test.gd index 240b79c6..9153fcde 100644 --- a/project/equip_model_test.gd +++ b/project/equip_model_test.gd @@ -80,6 +80,7 @@ func _ck(c: bool, m: String) -> void: printerr("FAIL: " + m) func _init() -> void: + _test_40250_msm() await _run() if _fail == 0: print("PASS: equip_model_test (item_list + weapon swap)") @@ -88,6 +89,24 @@ func _init() -> void: printerr("%d check(s) failed" % _fail) quit(1) +# 40250 root/_.msm(playersettingmodule.py LoadLocalRaceData):8 个种族都经 _ensure_spec 找到, +# 0..3(原始职业性别)在 pc/,4..7(另一性别)在 pc2/。 +func _test_40250_msm() -> void: + var root := AssetRoot.client_path().path_join("Eternexus") + if not FileAccess.file_exists(root.path_join("root/warrior_m.msm")): + print(" (skip: no 40250 Eternexus/root)") + return + for r in 8: + var em = EquipModel.new() + em.assets_root = root + em.race = r + em._ensure_spec() + var sh: Dictionary = em._spec.shape(0) if em._spec else {} + _ck(String(sh.get("spec_dir", "")) == root.path_join("root"), "race %d: spec from root/_.msm" % r) + var pc := "pc" if r < 4 else "pc2" + _ck(String(sh.get("path", "")).to_lower().begins_with("d:/ymir work/%s/" % pc), "race %d: shape 0 under %s/" % [r, pc]) + em.free() + func _run() -> void: var assets := AssetRoot.path() var il_path := assets.path_join("locale/locale/common/item_list.txt") diff --git a/project/ui/equip_model.gd b/project/ui/equip_model.gd index d18ee038..a2ccc692 100644 --- a/project/ui/equip_model.gd +++ b/project/ui/equip_model.gd @@ -526,7 +526,9 @@ func _ensure_spec() -> void: return var cls: String = CLASS_OF[race & 3] var suffix := "w" if race in [1, 3, 4, 6] else "m" - for rel in ["root/msm/%s_%s.msm" % [cls, suffix], + # 40250 的 root 包把 _.msm 放在 root/ 下(playersettingmodule.py chrmgr.LoadLocalRaceData("warrior_m.msm"));m2dev 放在 root/msm/。 + for rel in ["root/%s_%s.msm" % [cls, suffix], + "root/msm/%s_%s.msm" % [cls, suffix], "PC/ymir work/pc/%s/%s.msm" % [cls, cls], "pc2/ymir work/pc2/%s/%s.msm" % [cls, cls], "season1/season1/pc/%s.msm" % cls]: