载入中...
搜索中...
未找到
ScriptEditorTool.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4#include "editor/EditorTool.h"
5
6#include <memory>
7
8namespace ssq { class Object; }
9
10namespace eve::editor {
11
19public:
21 ScriptEditorTool(std::string id, std::string label);
26
28 const ToolDescriptor &descriptor() const override;
30 void setShortcut(const std::string &shortcut);
32 void setActivateCallback(ssq::Object callback);
34 void setDeactivateCallback(ssq::Object callback);
36 void setPointerCallback(ssq::Object callback);
38 void setKeyCallback(ssq::Object callback);
40 void setUpdateCallback(ssq::Object callback);
42 void setCancelCallback(ssq::Object callback);
43
45 void activate(EditorContext &context) override;
47 void deactivate(EditorContext &context) override;
49 ToolResponse pointerEvent(EditorContext &context, const EditorPointerEvent &event) override;
51 ToolResponse keyEvent(EditorContext &context, const EditorKeyEvent &event) override;
53 void update(EditorContext &context, float dt) override;
55 void cancel(EditorContext &context) override;
56
57private:
58 struct Impl;
59 std::unique_ptr<Impl> impl_;
60};
61
62} // namespace eve::editor
std::string descriptor
#define EVENGINE_API_ORCHESTRATION
Definition Export.h:111
std::string label
double dt
const VegetationPresetContext & context
ViewPreparation callback
Context supplied by EditorSession to tools.
Definition EditorTool.h:71
Protocol implemented by every editor tool.
Definition EditorTool.h:110
IEditorTool adapter whose lifecycle and input callbacks are Squirrel closures.
~ScriptEditorTool() override
Releases ScriptEditorTool resources.
ScriptEditorTool(const ScriptEditorTool &)=delete
ScriptEditorTool & operator=(const ScriptEditorTool &)=delete
EVEngine ECS 集成层:底层实现使用 sunxfancy/ECS.hpp https://github.com/sunxfancy/ECS.hpp
Definition ECS.h:21
Keyboard input normalized by the editor host.
Definition EditorTool.h:40
Pointer input normalized by an editor viewport adapter.
Definition EditorTool.h:20
UI-facing metadata supplied by a tool implementation.
Definition EditorTool.h:98
Result returned by a tool after processing input.
Definition EditorTool.h:50