Fix bug cant get "Lan xi ki di" in main quest progress

This commit is contained in:
Chomper9981
2026-02-10 12:14:47 +07:00
parent 5a959f562a
commit a86e15e48a
13 changed files with 54 additions and 52 deletions
@@ -288,7 +288,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &5334235739729266731
RectTransform:
m_ObjectHideFlags: 0
@@ -735,9 +735,9 @@ RectTransform:
- {fileID: 5334235739729266731}
m_Father: {fileID: 3016039455618517900}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 131.66666, y: -25}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 50, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6804128504798270830
@@ -762,7 +762,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
@@ -1199,9 +1199,9 @@ RectTransform:
- {fileID: 2700626918252070787}
m_Father: {fileID: 3016039455618517900}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 25, y: -25}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 50, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &9058123560732067158
@@ -1226,7 +1226,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
@@ -1584,7 +1584,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &2700626918252070787
RectTransform:
m_ObjectHideFlags: 0
@@ -1879,9 +1879,9 @@ RectTransform:
- {fileID: 8505317987590978995}
m_Father: {fileID: 3016039455618517900}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 78.33333, y: -25}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 50, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1266149729541302388
@@ -1906,7 +1906,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
@@ -2059,7 +2059,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &8505317987590978995
RectTransform:
m_ObjectHideFlags: 0
@@ -112,16 +112,13 @@ namespace BrewMonster
switch (entityID)
{
case "coord":
Debug.Log($"Clicked coord link: ID={entityID} Text={linkText}");
linkCommands[hoveredLink].Execute(tmp);
//Debug.Log($"[StyledTaskTraceText] OnPointerClick: linkCommands[hoveredLink].Execute(tmp) => {linkCommands[hoveredLink].Execute(tmp)}");
break;
case "npc":
Debug.Log($"Clicked npc link: ID={entityID} Text={linkText}");
linkCommands[hoveredLink].Execute(tmp);
break;
case "monster":
Debug.Log($"Clicked monster link: ID={entityID} Text={linkText}");
break;
default:
Debug.Log($"Clicked unknown link: ID={entityID} Text={linkText}");
@@ -132,7 +132,6 @@ namespace BrewMonster.Scripts.Managers
public int[] resistance;
public IVTR_ESSENCE_ARMOR(byte[] data)
{
Debug.Log("IVTR_ESSENCE_ARMOR: data.Length: " + data.Length);
resistance = new int[InventoryConst.NUM_MAGICCLASS];
CECDataReader dr = new(data, data.Length);
defense = dr.ReadInt();
@@ -842,9 +842,6 @@ namespace BrewMonster.Scripts.Task
public void CheckAutoDelv(TaskInterface pTask)
{
ATaskTempl pTempl = null;
// TaskTemplMap::iterator it = m_AutoDelvMap.begin();
var it = m_AutoDelvMap[0];
uint ulCurTime = pTask.GetCurTime();
ActiveTaskList pLst = pTask.GetActiveTaskList();
@@ -874,10 +871,8 @@ namespace BrewMonster.Scripts.Task
if (!pTempl.IsValidState())
continue;
if (pTempl.CheckPrerequisite(pTask, pLst, ulCurTime) == 0)
{
pTempl.IncValidCount();
_notify_svr(pTask, ClientNotificationConstants.TASK_CLT_NOTIFY_AUTO_DELV, (ushort)(pTempl.m_FixedData.m_ID));
}
@@ -887,7 +882,9 @@ namespace BrewMonster.Scripts.Task
public void UpdateStatus(TaskInterface pTask)
{
// ΪCheckTitleƺݣֱȡƺ֮ǰܵ
if (!pTask.IsTitleDataReady()) return;
//TODO:Add -----bool CECHostPlayer::ProcessMessage(const ECMSG& Msg)---- feature to check if title data is ready.
//If enable now it will not create autotask
//if (!pTask.IsTitleDataReady()) return;
CheckAutoDelv(pTask);
// TODO: Implement other checks as needed
@@ -42,7 +42,6 @@ namespace BrewMonster.Scripts.Task
for (int i = 0; i < pLst.m_uTaskCount; i++)
{
ActiveTaskEntry CurEntry = aEntries[i];
if (CurEntry == null) continue;
if (CurEntry.m_ulTemplAddr == 0)
{
@@ -56,7 +55,6 @@ namespace BrewMonster.Scripts.Task
// IsValidState from C++ not found in managed port; skip validity-state check
if (!pTempl.IsValidState())
continue;
// PQ子任务 // PQ subtask
if (pTempl.m_FixedData.m_bPQSubTask)
{
@@ -149,7 +147,9 @@ namespace BrewMonster.Scripts.Task
if ((TaskCompletionMethod)pTempl.m_FixedData.m_enumMethod == TaskCompletionMethod.enumTMTalkToNPC
|| pTempl.m_FixedData.m_bMarriage
|| (TaskFinishType)pTempl.m_FixedData.m_enumFinishType == TaskFinishType.enumTFTNPC)
{
continue;
}
// 判断未完成的直接完成判定 // Check direct-finish for unfinished tasks
if (!CurEntry.IsFinished())
@@ -277,7 +277,6 @@ namespace BrewMonster.Scripts.Task
continue;
}
}
// 非子任务:检查奖励条件并按需标记/通知 // If no children, check award conditions and update
if (pTempl != null && pTempl.m_pFirstChild == null)
{
@@ -135,7 +135,7 @@ namespace BrewMonster.UI
m_TargetPos = EC_Game.GetGameRun().GetHostPlayer().GetObjectCoordinates(
idTarget, ref m_Targets, ref bInTable);
//todo: add map feature here.
if(!bInTable && /*MAJOR_MAP*/1 == CECWorld.Instance.GetInstanceID())
if(!bInTable /*&& MAJOR_MAP== CECWorld.Instance.GetInstanceID())*/)
{
ATaskTemplMan pMan = EC_Game.GetTaskTemplateMan();
if(pMan.TryGetTaskNPCInfo((uint)idTarget, out NPC_INFO pInfo))
@@ -187,7 +187,7 @@ namespace BrewMonster.UI
}
else
{
string szNameLink = string.Format("<color=#00FF00><u>{0}</u></color><color=#FFFFFF>", m_TargetName);
string szNameLink = string.Format("<color=#FFA500><u>{0}</u></color>", m_TargetName);
return szNameLink;
}
}
@@ -200,13 +200,18 @@ namespace BrewMonster.UI
if (!m_TargetPos.IsZero())
{
// show the flag on worldmap
DlgTask.SetTracePosition(m_Targets, m_TargetName);
DlgTask.SetTracePosition(m_Targets, m_TargetName);
return true;
}
else if (m_TargetId > 0 && m_TaskId > 0)
{
DlgTask.SetTraceNpc(m_TargetId, m_TaskId);
return true;
}
else
{
Debug.LogError("MoveToLinkCommand: Invalid target position");
//EC_Game.GetGameRun().AddFixedMessage(FIXMSG_ERR_FC_INVALID_OPERATION);
return false;
}
}
@@ -396,7 +396,11 @@ namespace BrewMonster.Scripts.Task.UI
}
AUIDialog pTrace = auiManager.GetDialog("Win_QuestMinion");
int index = this.transform.GetSiblingIndex();
pTrace.transform.SetSiblingIndex(index);
int pTraceIndex = pTrace.transform.GetSiblingIndex();
if(pTraceIndex > index)
{
pTrace.transform.SetSiblingIndex(index);
}
if (pTrace) {
pTrace.Show(m_bShowTrace);
}
@@ -611,7 +615,6 @@ namespace BrewMonster.Scripts.Task.UI
// }
m_idSelTask = idTask;
Debug.Log($"[DlgTask] OnEventLButtonDown_Tv_Quest: {idTask}");
}
// void OnEventMouseMove_Txt_QuestItem(WPARAM wParam, LPARAM lParam, AUIObject *pObj);
// void OnEventLButtonDown_Txt_QuestItem(WPARAM wParam, LPARAM lParam, AUIObject *pObj);
@@ -69,6 +69,12 @@ namespace BrewMonster.Scripts.Task.UI
// AUI_ON_EVENT("Txt_Link_Trace", WM_LBUTTONUP, OnEventLButton_Txt_Link_Trace)
// AUI_ON_EVENT("Txt_Link_Trace", WM_MOUSEWHEEL, OnMouseWheel)
}
public override void Show(bool value)
{
gameObject.SetActive(value);
m_bShow = value;
OnShowDialogue();
}
public override void OnShowDialogue()
{
base.OnShowDialogue();
@@ -220,8 +226,13 @@ namespace BrewMonster.Scripts.Task.UI
//todo: MakeNameUnique(not implemented)
string strUniqueName = MakeNameUnique(strName);
if (!string.IsNullOrEmpty(strUniqueName)){
//Currently get npc method is bugging so BindlinkCommand cant not get true format of this sting.
//BUG: EC_Game.GetTaskTemplateMan().TryGetTaskNPCInfo((uint)idTarget, out NPC_INFO pInfo)
//Work around by using this magic string to give us the visual effect of the link.
//TODO: Fix the Get npc method bug.
strUniqueName = string.Format("<color=#FFA500><u><link=\"npc\">{0}</link></u></color>",strUniqueName);
TraceLinkCommand cmd = new TraceLinkCommand(m_Buffer, idTarget, strUniqueName, idTask);
Debug.Log($"[DlgTaskTrace] AppendCommand: strUniqueName {strUniqueName}");
m_pTxt_Desc.AddLinkCommand(cmd);
BindLinkCommand(m_pTxt_Desc.tmp, strUniqueName, cmd);
}
}
@@ -264,7 +275,7 @@ namespace BrewMonster.Scripts.Task.UI
A3DVECTOR3 vPos = instCoord[0].vPos;
strName = FormatFromTable(9393, ((int)vPos.x+4000)/10, ((int)vPos.z+5500)/10);
Debug.Log($"[DlgTaskTrace] AppendCommand: strName {strName}");
strName = string.Format("<link=\"coord_{0}\">{1}</link>", instCoord[0].strMap, strName);
strName = string.Format("<link=\"coord\">{0}</link>", strName);
//FormatFromTable(9393, ((int)vPos.x+4000)/10, ((int)vPos.z+5500)/10);
TraceLinkCommand cmd = new TraceLinkCommand(m_Buffer, instCoord, strName);
@@ -642,7 +653,7 @@ namespace BrewMonster.Scripts.Task.UI
}
// init the indent
string strIndent = withName ? strIndentIn + INDENTATION : "";
// δʱʾNPC
int nDNPC = (int)pTemp.GetDeliverNPC();
if (!bActiveTask && nDNPC > 0)
@@ -663,13 +674,13 @@ namespace BrewMonster.Scripts.Task.UI
}
// check whether can finish the task
int nANPC = (int)pTemp.GetAwardNPC();
ulong nANPC = pTemp.GetAwardNPC();
// ͱȽʱҪ
bool bSpecialAwardType = pTemp.GetAwardType_S() != (uint)TaskAwardType.enumTATNormal;
if(nANPC > 0 && pTask.CanFinishTask((uint)idTask) && !bSpecialAwardType)
{
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
var temp = pDataMan.get_data_ptr((uint)nDNPC, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
var temp = pDataMan.get_data_ptr((uint)nANPC, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
if(temp == null && DataType != DATA_TYPE.DT_NPC_ESSENCE) {
return;
}
@@ -678,10 +689,11 @@ namespace BrewMonster.Scripts.Task.UI
{
AppendText(strIndent);
AppendText(GetStringFromTable(9391));
AppendCommand(pNPC.Name, nANPC, idTask);
AppendCommand(pNPC.Name, (int)nANPC, idTask);
AppendText("\n");
return;
}
}
// append global task character
@@ -991,7 +1003,7 @@ namespace BrewMonster.Scripts.Task.UI
public override void AppendText()
{
// do nothing here
m_Buffer.Value += this.GetLinkText();
m_Buffer.Value += GetLinkText();
}
@@ -157,7 +157,6 @@ namespace BrewMonster.Scripts.Task.UI
void SetSelectedItem(uint idItem)
{
_currentSelectedItem = GetItemByData(idItem);
Debug.Log($"[TaskTreeView] SetSelectedItem: {idItem}");
}
public void RefreshLayout()
@@ -170,7 +169,6 @@ namespace BrewMonster.Scripts.Task.UI
// Force Unity to rebuild layout immediately
parent.ForceUpdateRectTransforms();
LayoutRebuilder.ForceRebuildLayoutImmediate(parent);
Debug.Log($"[TaskTreeView] RefreshLayout");
}
/// <summary>
@@ -121,7 +121,6 @@ namespace BrewMonster.Scripts.Task.UI
{
return;
}
Debug.Log($"[TaskTreeViewHolder] RefreshLayout");
foreach(var child in GetComponentsInChildren<TaskTreeViewHolder>(true))
{
child.RefreshSelf();
@@ -142,12 +141,11 @@ namespace BrewMonster.Scripts.Task.UI
}
rectTransform.ForceUpdateRectTransforms();
LayoutRebuilder.ForceRebuildLayoutImmediate(rectTransform);
_pTreeItemPrefab_Root.RefreshSelf();
//_pTreeItemPrefab_Root.RefreshSelf();
}
void OnBtnClick()
{
EventBus.Publish(new TaskItemClickEvent() { Data = m_uItemData });
Debug.Log($"[TaskTreeViewItem] OnBtnClick: {m_uItemData}");
}
}
@@ -82,7 +82,6 @@ namespace BrewMonster.Scripts.Task.UI
//_expandButton.gameObject.SetActive(!expand);
//_collapseButton.gameObject.SetActive(expand);
//RefreshLayout();
Debug.Log($"[TaskTreeViewItem] RefreshLayout: {expand}");
OnExpand.Invoke(expand);
RefreshLayout();
}
@@ -153,8 +153,6 @@ namespace BrewMonster.Scripts.UI
//Debug.Log("[THN]CDlgAward: pItem.GetDesc():" + pItem.GetDesc());
// af_GetFileTitle(pItem.GetIconFile(), strFile); // TODO
strFile.ToLower();
BMLogger.Log("[THN]CDlgAward: pItem.GetDesc():" + strDesc);
// TODO: Set the image cover here
// pImage.SetCover(GetGameUIMan().m_pA2DSpriteIcons[CECGameUIMan::ICONS_INVENTORY],
// GetGameUIMan().m_IconMap[CECGameUIMan::ICONS_INVENTORY][strFile]);
@@ -66,7 +66,6 @@ namespace BrewMonster.Scripts.UI
// 回退到 coord_data.txtC++Configs/Coord_data.txt,通过 CECGame::GetObjectCoord
if (BrewMonster.Network.EC_Game.TryGetFirstObjectCoord(id.ToString(), out var coordPos, out var mapName))
{
UnityEngine.Debug.Log($"[CECUIHelper] GetTaskObjectCoordinates: Resolved id={id} via coord_data.txt map={mapName} pos=({coordPos.x:F2},{coordPos.y:F2},{coordPos.z:F2})");
in_table = true;
return new A3DVECTOR3(coordPos.x, coordPos.y, coordPos.z);
}
@@ -170,7 +169,6 @@ namespace BrewMonster.Scripts.UI
float cy = (r.zvMin.y + r.zvMax.y) * 0.5f;
float cz = (r.zvMin.z + r.zvMax.z) * 0.5f;
pos = new A3DVECTOR3(cx, cy, cz);
UnityEngine.Debug.Log($"[CECUIHelper] FollowCoord: Fallback {tag} region center=({cx:F2},{cy:F2},{cz:F2}) worldId={worldId} curWorldId={curWorldId}");
return true;
}
@@ -239,7 +237,6 @@ namespace BrewMonster.Scripts.UI
}
wm.StartWork_p2(work);
UnityEngine.Debug.Log($"[CECUIHelper] FollowCoord: Started auto-move to ({vPos.x},{vPos.y},{vPos.z}) for id={id}, taskId={taskId}");
return true;
}