forked from ddnet/ddnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ddnet#7014 from Marmare314/mapview
Add CEditorComponent to moduralize editor
- Loading branch information
Showing
12 changed files
with
439 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "component.h" | ||
|
||
#include "editor.h" | ||
|
||
void CEditorComponent::Init(CEditor *pEditor) | ||
{ | ||
m_pEditor = pEditor; | ||
m_pInput = pEditor->Input(); | ||
m_pClient = pEditor->Client(); | ||
m_pConfig = pEditor->Config(); | ||
m_pConsole = pEditor->Console(); | ||
m_pEngine = pEditor->Engine(); | ||
m_pGraphics = pEditor->Graphics(); | ||
m_pSound = pEditor->Sound(); | ||
m_pTextRender = pEditor->TextRender(); | ||
m_pStorage = pEditor->Storage(); | ||
m_pUI = pEditor->UI(); | ||
m_pRenderTools = pEditor->RenderTools(); | ||
} | ||
|
||
void CEditorComponent::OnUpdate(CUIRect View) | ||
{ | ||
OnInput(); | ||
OnRender(View); | ||
} | ||
|
||
void CEditorComponent::OnInput() {} | ||
void CEditorComponent::OnRender(CUIRect View) {} | ||
|
||
CEditor *CEditorComponent::Editor() { return m_pEditor; } | ||
IInput *CEditorComponent::Input() { return m_pInput; } | ||
IClient *CEditorComponent::Client() { return m_pClient; } | ||
CConfig *CEditorComponent::Config() { return m_pConfig; } | ||
IConsole *CEditorComponent::Console() { return m_pConsole; } | ||
IEngine *CEditorComponent::Engine() { return m_pEngine; } | ||
IGraphics *CEditorComponent::Graphics() { return m_pGraphics; } | ||
ISound *CEditorComponent::Sound() { return m_pSound; } | ||
ITextRender *CEditorComponent::TextRender() { return m_pTextRender; } | ||
IStorage *CEditorComponent::Storage() { return m_pStorage; } | ||
CUI *CEditorComponent::UI() { return m_pUI; } | ||
CRenderTools *CEditorComponent::RenderTools() { return m_pRenderTools; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#ifndef GAME_EDITOR_COMPONENT_H | ||
#define GAME_EDITOR_COMPONENT_H | ||
|
||
#include <game/client/ui.h> | ||
|
||
class CEditor; | ||
class IInput; | ||
class IClient; | ||
class CConfig; | ||
class IConsole; | ||
class IEngine; | ||
class IGraphics; | ||
class ISound; | ||
class ITextRender; | ||
class IStorage; | ||
class CRenderTools; | ||
|
||
class CEditorComponent | ||
{ | ||
public: | ||
virtual ~CEditorComponent() = default; | ||
|
||
virtual void Init(CEditor *pEditor); | ||
|
||
void OnUpdate(CUIRect View); | ||
virtual void OnInput(); | ||
virtual void OnRender(CUIRect View); | ||
|
||
CEditor *Editor(); | ||
IInput *Input(); | ||
IClient *Client(); | ||
CConfig *Config(); | ||
IConsole *Console(); | ||
IEngine *Engine(); | ||
IGraphics *Graphics(); | ||
ISound *Sound(); | ||
ITextRender *TextRender(); | ||
IStorage *Storage(); | ||
CUI *UI(); | ||
CRenderTools *RenderTools(); | ||
|
||
private: | ||
CEditor *m_pEditor; | ||
IInput *m_pInput; | ||
IClient *m_pClient; | ||
CConfig *m_pConfig; | ||
IConsole *m_pConsole; | ||
IEngine *m_pEngine; | ||
IGraphics *m_pGraphics; | ||
ISound *m_pSound; | ||
ITextRender *m_pTextRender; | ||
IStorage *m_pStorage; | ||
CUI *m_pUI; | ||
CRenderTools *m_pRenderTools; | ||
}; | ||
|
||
#endif |
Oops, something went wrong.