Skip to content

Commit

Permalink
Show only secondary tasks in task list in Clear Sky (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Feb 22, 2024
1 parent aa1e4f0 commit 4aa42d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/xrGame/ui/UISecondTaskWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<UITaskListWndItem>();
if (item->init_task(task, this))
Expand Down
4 changes: 3 additions & 1 deletion src/xrGame/ui/UISecondTaskWnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"; }
Expand All @@ -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

// -------------------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/xrGame/ui/UITaskWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4aa42d0

Please sign in to comment.