From 4aa42d03d6adbbc2162fe0d9d1e3bca59d682843 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Wed, 21 Feb 2024 04:42:19 +0500 Subject: [PATCH] Show only secondary tasks in task list in Clear Sky (#382) --- src/xrGame/ui/UISecondTaskWnd.cpp | 2 ++ src/xrGame/ui/UISecondTaskWnd.h | 4 +++- src/xrGame/ui/UITaskWnd.cpp | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xrGame/ui/UISecondTaskWnd.cpp b/src/xrGame/ui/UISecondTaskWnd.cpp index a66a79b4437..2c07dbe3fa7 100644 --- a/src/xrGame/ui/UISecondTaskWnd.cpp +++ b/src/xrGame/ui/UISecondTaskWnd.cpp @@ -147,6 +147,8 @@ void UITaskListWnd::UpdateList() if (!task || task->GetTaskState() != eTaskStateInProgress) continue; + if (m_show_only_secondary_tasks && task->GetTaskType() == eTaskTypeStoryline) + continue; auto* item = xr_new(); if (item->init_task(task, this)) diff --git a/src/xrGame/ui/UISecondTaskWnd.h b/src/xrGame/ui/UISecondTaskWnd.h index 9d5c3455d27..419ef64708b 100644 --- a/src/xrGame/ui/UISecondTaskWnd.h +++ b/src/xrGame/ui/UISecondTaskWnd.h @@ -43,6 +43,8 @@ class UITaskListWnd final : public CUIWindow, public CUIWndCallback virtual void Update(); virtual void SendMessage(CUIWindow* pWnd, s16 msg, void* pData); + void ShowOnlySecondaryTasks(bool mode) { m_show_only_secondary_tasks = mode; } + void UpdateList(); pcstr GetDebugType() override { return "UITaskListWnd"; } @@ -63,7 +65,7 @@ class UITaskListWnd final : public CUIWindow, public CUIWndCallback CUI3tButton* m_bt_close{}; float m_orig_h{}; - + bool m_show_only_secondary_tasks{}; }; // class UITaskListWnd // ------------------------------------------------------------------------------------------------- diff --git a/src/xrGame/ui/UITaskWnd.cpp b/src/xrGame/ui/UITaskWnd.cpp index 945c66ef026..52add68dccf 100644 --- a/src/xrGame/ui/UITaskWnd.cpp +++ b/src/xrGame/ui/UITaskWnd.cpp @@ -91,6 +91,7 @@ bool CUITaskWnd::Init() m_task_wnd->SetAutoDelete(true); m_task_wnd->hint_wnd = hint_wnd; m_task_wnd->init_from_xml(xml, "second_task_wnd"); + m_task_wnd->ShowOnlySecondaryTasks(m_pSecondaryTaskItem != nullptr); m_pMapWnd->AttachChild(m_task_wnd); m_task_wnd->SetMessageTarget(this);