Skip to content

Commit 8564cde

Browse files
committed
xrEngine/editor_base.h: use on_tool_frame instead of OnFrame in ide_tool class
Prevents clashes with the normal OnFrame in classes. Editor frame update should be called separately.
1 parent bcc03eb commit 8564cde

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

src/xrEngine/editor_base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void ide::OnFrame()
6363
if (m_show_weather_editor)
6464
ShowWeatherEditor();
6565
for (const auto& tool : m_tools)
66-
tool->OnFrame();
66+
tool->on_tool_frame();
6767
break;
6868
}
6969

src/xrEngine/editor_base.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99

1010
namespace xray::editor
1111
{
12-
class XR_NOVTABLE ENGINE_API ide_tool : public pureFrame
12+
class XR_NOVTABLE ENGINE_API ide_tool
1313
{
1414
bool is_opened{};
1515

1616
public:
1717
ide_tool();
1818
virtual ~ide_tool();
1919

20+
virtual void on_tool_frame() = 0;
21+
2022
virtual pcstr tool_name() = 0;
2123

2224
bool& get_open_state() { return is_opened; }

src/xrGame/player_hud_tune.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void CHudTuner::UpdateValues()
6262
}
6363
}
6464

65-
void CHudTuner::OnFrame()
65+
void CHudTuner::on_tool_frame()
6666
{
6767
#ifndef MASTER_GOLD
6868
if (!get_open_state())

src/xrGame/player_hud_tune.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class CHudTuner final : public xray::editor::ide_tool
66
{
77
public:
88
CHudTuner();
9-
void OnFrame() override;
9+
void on_tool_frame() override;
1010
bool is_active() const override;
1111

1212
private:

src/xrUICore/ui_debug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ CUIDebugger::CUIDebugger()
5959
ImGui::SetCurrentContext(Device.GetImGuiContext());
6060
}
6161

62-
void CUIDebugger::OnFrame()
62+
void CUIDebugger::on_tool_frame()
6363
{
6464
#ifndef MASTER_GOLD
6565
if (!get_open_state())

src/xrUICore/ui_debug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class XRUICORE_API CUIDebugger final : public xray::editor::ide_tool
4545
void Register(CUIDebuggable* debuggable);
4646
void Unregister(CUIDebuggable* debuggable);
4747

48-
void OnFrame() override;
48+
void on_tool_frame() override;
4949

5050
[[nodiscard]]
5151
CUIDebuggable* GetSelected() const { return m_state.selected; }

0 commit comments

Comments
 (0)