mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 14:08:19 +00:00
Merge pull request #8656 from ChillerDragon/pr_editor_oninit
Rename editor component `Init` to `OnInit`
This commit is contained in:
commit
78cbb45d49
|
@ -42,7 +42,7 @@ static int HashLocation(uint32_t Seed, uint32_t Run, uint32_t Rule, uint32_t X,
|
|||
|
||||
CAutoMapper::CAutoMapper(CEditor *pEditor)
|
||||
{
|
||||
Init(pEditor);
|
||||
OnInit(pEditor);
|
||||
}
|
||||
|
||||
void CAutoMapper::Load(const char *pTileName)
|
||||
|
|
|
@ -14,7 +14,7 @@ void CEditorComponent::InitSubComponents()
|
|||
{
|
||||
for(CEditorComponent &Component : m_vSubComponents)
|
||||
{
|
||||
Component.Init(Editor());
|
||||
Component.OnInit(Editor());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8324,15 +8324,15 @@ void CEditor::Init()
|
|||
m_PopupEventWasActivated = false;
|
||||
});
|
||||
m_RenderTools.Init(m_pGraphics, m_pTextRender);
|
||||
m_ZoomEnvelopeX.Init(this);
|
||||
m_ZoomEnvelopeY.Init(this);
|
||||
m_ZoomEnvelopeX.OnInit(this);
|
||||
m_ZoomEnvelopeY.OnInit(this);
|
||||
m_Map.m_pEditor = this;
|
||||
|
||||
m_vComponents.emplace_back(m_MapView);
|
||||
m_vComponents.emplace_back(m_MapSettingsBackend);
|
||||
m_vComponents.emplace_back(m_LayerSelector);
|
||||
for(CEditorComponent &Component : m_vComponents)
|
||||
Component.Init(this);
|
||||
Component.OnInit(this);
|
||||
|
||||
m_CheckerTexture = Graphics()->LoadTexture("editor/checker.png", IStorage::TYPE_ALL);
|
||||
m_BackgroundTexture = Graphics()->LoadTexture("editor/background.png", IStorage::TYPE_ALL);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "editor.h"
|
||||
|
||||
void CEditorObject::Init(CEditor *pEditor)
|
||||
void CEditorObject::OnInit(CEditor *pEditor)
|
||||
{
|
||||
m_pEditor = pEditor;
|
||||
OnReset();
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
* Needs to be the first function that is called.
|
||||
* The default implentation also resets the component.
|
||||
*/
|
||||
virtual void Init(CEditor *pEditor);
|
||||
virtual void OnInit(CEditor *pEditor);
|
||||
|
||||
/**
|
||||
* Maybe calls `OnHot` or `OnActive`.
|
||||
|
|
|
@ -1049,9 +1049,9 @@ void CEditor::MapSettingsDropdownRenderCallback(const SPossibleValueMatch &Match
|
|||
|
||||
CMapSettingsBackend::CContext *CMapSettingsBackend::ms_pActiveContext = nullptr;
|
||||
|
||||
void CMapSettingsBackend::Init(CEditor *pEditor)
|
||||
void CMapSettingsBackend::OnInit(CEditor *pEditor)
|
||||
{
|
||||
CEditorComponent::Init(pEditor);
|
||||
CEditorComponent::OnInit(pEditor);
|
||||
|
||||
// Register values loader
|
||||
InitValueLoaders();
|
||||
|
|
|
@ -198,7 +198,7 @@ class CMapSettingsBackend : public CEditorComponent
|
|||
public: // General methods
|
||||
CMapSettingsBackend() = default;
|
||||
|
||||
void Init(CEditor *pEditor) override;
|
||||
void OnInit(CEditor *pEditor) override;
|
||||
bool OnInput(const IInput::CEvent &Event) override;
|
||||
void OnUpdate() override;
|
||||
void OnMapLoad() override;
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
#include "layer_selector.h"
|
||||
|
||||
void CLayerSelector::Init(CEditor *pEditor)
|
||||
void CLayerSelector::OnInit(CEditor *pEditor)
|
||||
{
|
||||
CEditorComponent::Init(pEditor);
|
||||
CEditorComponent::OnInit(pEditor);
|
||||
|
||||
m_SelectionOffset = 0;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ class CLayerSelector : public CEditorComponent
|
|||
int m_SelectionOffset;
|
||||
|
||||
public:
|
||||
void Init(CEditor *pEditor) override;
|
||||
void OnInit(CEditor *pEditor) override;
|
||||
bool SelectByTile();
|
||||
};
|
||||
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
#include "editor.h"
|
||||
|
||||
void CMapView::Init(CEditor *pEditor)
|
||||
void CMapView::OnInit(CEditor *pEditor)
|
||||
{
|
||||
CEditorComponent::Init(pEditor);
|
||||
CEditorComponent::OnInit(pEditor);
|
||||
RegisterSubComponent(m_MapGrid);
|
||||
RegisterSubComponent(m_ProofMode);
|
||||
InitSubComponents();
|
||||
|
@ -19,7 +19,7 @@ void CMapView::Init(CEditor *pEditor)
|
|||
void CMapView::OnReset()
|
||||
{
|
||||
m_Zoom = CSmoothValue(200.0f, 10.0f, 2000.0f);
|
||||
m_Zoom.Init(Editor());
|
||||
m_Zoom.OnInit(Editor());
|
||||
m_WorldZoom = 1.0f;
|
||||
|
||||
SetWorldOffset({0, 0});
|
||||
|
|
|
@ -13,7 +13,7 @@ class CLayerGroup;
|
|||
class CMapView : public CEditorComponent
|
||||
{
|
||||
public:
|
||||
void Init(CEditor *pEditor) override;
|
||||
void OnInit(CEditor *pEditor) override;
|
||||
void OnReset() override;
|
||||
void OnMapLoad() override;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
CEditorImage::CEditorImage(CEditor *pEditor) :
|
||||
m_AutoMapper(pEditor)
|
||||
{
|
||||
Init(pEditor);
|
||||
OnInit(pEditor);
|
||||
m_Texture.Invalidate();
|
||||
}
|
||||
|
||||
|
@ -16,9 +16,9 @@ CEditorImage::~CEditorImage()
|
|||
m_pData = nullptr;
|
||||
}
|
||||
|
||||
void CEditorImage::Init(CEditor *pEditor)
|
||||
void CEditorImage::OnInit(CEditor *pEditor)
|
||||
{
|
||||
CEditorComponent::Init(pEditor);
|
||||
CEditorComponent::OnInit(pEditor);
|
||||
RegisterSubComponent(m_AutoMapper);
|
||||
InitSubComponents();
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ public:
|
|||
explicit CEditorImage(CEditor *pEditor);
|
||||
~CEditorImage();
|
||||
|
||||
void Init(CEditor *pEditor) override;
|
||||
void OnInit(CEditor *pEditor) override;
|
||||
void AnalyseTileFlags();
|
||||
bool DataEquals(const CEditorImage &Other) const;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
CEditorSound::CEditorSound(CEditor *pEditor)
|
||||
{
|
||||
Init(pEditor);
|
||||
OnInit(pEditor);
|
||||
}
|
||||
|
||||
CEditorSound::~CEditorSound()
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
#include "editor.h"
|
||||
|
||||
void CProofMode::Init(CEditor *pEditor)
|
||||
void CProofMode::OnInit(CEditor *pEditor)
|
||||
{
|
||||
CEditorComponent::Init(pEditor);
|
||||
CEditorComponent::OnInit(pEditor);
|
||||
SetMenuBackgroundPositionNames();
|
||||
OnReset();
|
||||
OnMapLoad();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
class CProofMode : public CEditorComponent
|
||||
{
|
||||
public:
|
||||
void Init(CEditor *pEditor) override;
|
||||
void OnInit(CEditor *pEditor) override;
|
||||
void OnReset() override;
|
||||
void OnMapLoad() override;
|
||||
void RenderScreenSizes();
|
||||
|
|
Loading…
Reference in a new issue