mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-02-07 00:25:54 +01:00
Renamed the new gizmo.
This commit is contained in:
parent
91f6141b5c
commit
dbff74222c
@ -49,8 +49,8 @@ sources = [
|
|||||||
|
|
||||||
if env["tools"]:
|
if env["tools"]:
|
||||||
sources.append("editor/terrain_world_editor.cpp")
|
sources.append("editor/terrain_world_editor.cpp")
|
||||||
sources.append("editor/terraman_gizmo.cpp")
|
sources.append("editor/terrain_world_gizmo.cpp")
|
||||||
sources.append("editor/terraman_gizmo_plugin.cpp")
|
sources.append("editor/terrain_world_gizmo_plugin.cpp")
|
||||||
|
|
||||||
if env["module_texture_packer_enabled"]:
|
if env["module_texture_packer_enabled"]:
|
||||||
sources.append("library/terrain_library_merger.cpp")
|
sources.append("library/terrain_library_merger.cpp")
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include "editor/editor_scale.h"
|
#include "editor/editor_scale.h"
|
||||||
#include "editor/editor_settings.h"
|
#include "editor/editor_settings.h"
|
||||||
|
|
||||||
#include "modules/terraman/editor/terraman_gizmo_plugin.h"
|
#include "terrain_world_gizmo_plugin.h"
|
||||||
|
|
||||||
#include "../world/terrain_world.h"
|
#include "../world/terrain_world.h"
|
||||||
#include "scene/gui/box_container.h"
|
#include "scene/gui/box_container.h"
|
||||||
|
@ -43,7 +43,7 @@ class HSlider;
|
|||||||
class BoxContainer;
|
class BoxContainer;
|
||||||
class HFlowContainer;
|
class HFlowContainer;
|
||||||
class SpinBox;
|
class SpinBox;
|
||||||
class TerramanGizmoPlugin;
|
class TerrainWorldGizmoPlugin;
|
||||||
|
|
||||||
class TerrainWorldEditor : public PanelContainer {
|
class TerrainWorldEditor : public PanelContainer {
|
||||||
GDCLASS(TerrainWorldEditor, PanelContainer);
|
GDCLASS(TerrainWorldEditor, PanelContainer);
|
||||||
@ -183,7 +183,7 @@ class TerrainWorldEditorPlugin : public EditorPlugin {
|
|||||||
|
|
||||||
TerrainWorldEditor *terrain_world_editor;
|
TerrainWorldEditor *terrain_world_editor;
|
||||||
EditorNode *editor;
|
EditorNode *editor;
|
||||||
Ref<TerramanGizmoPlugin> gizmo_plugin;
|
Ref<TerrainWorldGizmoPlugin> gizmo_plugin;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void _notification(int p_what);
|
void _notification(int p_what);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* terraman_gizmo.cpp */
|
/* terrain_world_gizmo.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* PANDEMONIUM ENGINE */
|
/* PANDEMONIUM ENGINE */
|
||||||
@ -29,27 +29,26 @@
|
|||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "terraman_gizmo.h"
|
#include "terrain_world_gizmo.h"
|
||||||
|
|
||||||
#include "editor/editor_node.h"
|
#include "editor/editor_node.h"
|
||||||
#include "editor/editor_settings.h"
|
|
||||||
#include "scene/3d/camera.h"
|
#include "scene/3d/camera.h"
|
||||||
|
|
||||||
void TerramanGizmo::set_visible(const bool visible) {
|
void TerrainWorldGizmo::set_visible(const bool visible) {
|
||||||
_visible = visible;
|
_visible = visible;
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerramanGizmo::set_editor_plugin(EditorPlugin *editor_plugin) {
|
void TerrainWorldGizmo::set_editor_plugin(EditorPlugin *editor_plugin) {
|
||||||
_editor_plugin = editor_plugin;
|
_editor_plugin = editor_plugin;
|
||||||
|
|
||||||
_undo_redo = EditorNode::get_undo_redo();
|
_undo_redo = EditorNode::get_undo_redo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerramanGizmo::set_handle(int index, bool secondary, Camera *camera, const Point2 &point) {
|
void TerrainWorldGizmo::set_handle(int index, bool secondary, Camera *camera, const Point2 &point) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerramanGizmo::redraw() {
|
void TerrainWorldGizmo::redraw() {
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
if (!_visible) {
|
if (!_visible) {
|
||||||
@ -84,18 +83,18 @@ void TerramanGizmo::redraw() {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
void TerramanGizmo::apply() {
|
void TerrainWorldGizmo::apply() {
|
||||||
}
|
}
|
||||||
|
|
||||||
TerramanGizmo::TerramanGizmo() {
|
TerrainWorldGizmo::TerrainWorldGizmo() {
|
||||||
_editor_plugin = nullptr;
|
_editor_plugin = nullptr;
|
||||||
_undo_redo = nullptr;
|
_undo_redo = nullptr;
|
||||||
|
|
||||||
_visible = false;
|
_visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
TerramanGizmo::~TerramanGizmo() {
|
TerrainWorldGizmo::~TerrainWorldGizmo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerramanGizmo::_bind_methods() {
|
void TerrainWorldGizmo::_bind_methods() {
|
||||||
}
|
}
|
@ -2,7 +2,7 @@
|
|||||||
#define TERRAMAN_GIZMO_H
|
#define TERRAMAN_GIZMO_H
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* terraman_gizmo.h */
|
/* terrain_world_gizmo.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* PANDEMONIUM ENGINE */
|
/* PANDEMONIUM ENGINE */
|
||||||
@ -34,8 +34,6 @@
|
|||||||
|
|
||||||
#include "editor/spatial_editor_gizmos.h"
|
#include "editor/spatial_editor_gizmos.h"
|
||||||
|
|
||||||
#include "core/variant/variant.h"
|
|
||||||
|
|
||||||
class Camera;
|
class Camera;
|
||||||
class MeshDataResource;
|
class MeshDataResource;
|
||||||
class MDREDMeshOutline;
|
class MDREDMeshOutline;
|
||||||
@ -43,8 +41,8 @@ class InputEvent;
|
|||||||
class EditorPlugin;
|
class EditorPlugin;
|
||||||
class UndoRedo;
|
class UndoRedo;
|
||||||
|
|
||||||
class TerramanGizmo : public EditorSpatialGizmo {
|
class TerrainWorldGizmo : public EditorSpatialGizmo {
|
||||||
GDCLASS(TerramanGizmo, EditorSpatialGizmo);
|
GDCLASS(TerrainWorldGizmo, EditorSpatialGizmo);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void set_visible(const bool visible);
|
void set_visible(const bool visible);
|
||||||
@ -55,8 +53,8 @@ public:
|
|||||||
void redraw();
|
void redraw();
|
||||||
void apply();
|
void apply();
|
||||||
|
|
||||||
TerramanGizmo();
|
TerrainWorldGizmo();
|
||||||
~TerramanGizmo();
|
~TerrainWorldGizmo();
|
||||||
|
|
||||||
PoolVector3Array _vertices;
|
PoolVector3Array _vertices;
|
||||||
PoolIntArray _indices;
|
PoolIntArray _indices;
|
@ -1,5 +1,5 @@
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* terrmana_gizmo_plugin.cpp */
|
/* terrain_world_gizmo_plugin.cpp */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* PANDEMONIUM ENGINE */
|
/* PANDEMONIUM ENGINE */
|
||||||
@ -29,27 +29,27 @@
|
|||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
#include "terraman_gizmo_plugin.h"
|
#include "terrain_world_gizmo_plugin.h"
|
||||||
|
|
||||||
#include "../world/terrain_world.h"
|
#include "../world/terrain_world.h"
|
||||||
#include "terrain_world_editor.h"
|
#include "terrain_world_editor.h"
|
||||||
#include "terraman_gizmo.h"
|
#include "terrain_world_gizmo.h"
|
||||||
|
|
||||||
String TerramanGizmoPlugin::get_gizmo_name() const {
|
String TerrainWorldGizmoPlugin::get_gizmo_name() const {
|
||||||
return "TerramanGizmo";
|
return "TerrainWorldGizmo";
|
||||||
}
|
}
|
||||||
int TerramanGizmoPlugin::get_priority() const {
|
int TerrainWorldGizmoPlugin::get_priority() const {
|
||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
bool TerramanGizmoPlugin::is_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int p_idx, bool p_secondary) const {
|
bool TerrainWorldGizmoPlugin::is_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int p_idx, bool p_secondary) const {
|
||||||
return EditorSpatialGizmoPlugin::is_handle_highlighted(p_gizmo, p_idx, p_secondary);
|
return EditorSpatialGizmoPlugin::is_handle_highlighted(p_gizmo, p_idx, p_secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<EditorSpatialGizmo> TerramanGizmoPlugin::create_gizmo(Spatial *p_spatial) {
|
Ref<EditorSpatialGizmo> TerrainWorldGizmoPlugin::create_gizmo(Spatial *p_spatial) {
|
||||||
TerrainWorld *world = Object::cast_to<TerrainWorld>(p_spatial);
|
TerrainWorld *world = Object::cast_to<TerrainWorld>(p_spatial);
|
||||||
|
|
||||||
if (world) {
|
if (world) {
|
||||||
Ref<TerramanGizmo> gizmo;
|
Ref<TerrainWorldGizmo> gizmo;
|
||||||
gizmo.instance();
|
gizmo.instance();
|
||||||
|
|
||||||
gizmo->set_editor_plugin(plugin);
|
gizmo->set_editor_plugin(plugin);
|
||||||
@ -61,7 +61,7 @@ Ref<EditorSpatialGizmo> TerramanGizmoPlugin::create_gizmo(Spatial *p_spatial) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TerramanGizmoPlugin::TerramanGizmoPlugin() {
|
TerrainWorldGizmoPlugin::TerrainWorldGizmoPlugin() {
|
||||||
plugin = nullptr;
|
plugin = nullptr;
|
||||||
|
|
||||||
create_material("main", Color(0.7, 0.7, 0.7));
|
create_material("main", Color(0.7, 0.7, 0.7));
|
||||||
@ -69,8 +69,8 @@ TerramanGizmoPlugin::TerramanGizmoPlugin() {
|
|||||||
create_handle_material("handles");
|
create_handle_material("handles");
|
||||||
}
|
}
|
||||||
|
|
||||||
TerramanGizmoPlugin::~TerramanGizmoPlugin() {
|
TerrainWorldGizmoPlugin::~TerrainWorldGizmoPlugin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerramanGizmoPlugin::_bind_methods() {
|
void TerrainWorldGizmoPlugin::_bind_methods() {
|
||||||
}
|
}
|
@ -2,7 +2,7 @@
|
|||||||
#define TERRAMAN_GIZMO_PLUGIN_H
|
#define TERRAMAN_GIZMO_PLUGIN_H
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* terraman_gizmo_plugin.h */
|
/* terrain_world_gizmo_plugin.h */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* This file is part of: */
|
/* This file is part of: */
|
||||||
/* PANDEMONIUM ENGINE */
|
/* PANDEMONIUM ENGINE */
|
||||||
@ -36,8 +36,8 @@
|
|||||||
|
|
||||||
class TerrainWorldEditorPlugin;
|
class TerrainWorldEditorPlugin;
|
||||||
|
|
||||||
class TerramanGizmoPlugin : public EditorSpatialGizmoPlugin {
|
class TerrainWorldGizmoPlugin : public EditorSpatialGizmoPlugin {
|
||||||
GDCLASS(TerramanGizmoPlugin, EditorSpatialGizmoPlugin);
|
GDCLASS(TerrainWorldGizmoPlugin, EditorSpatialGizmoPlugin);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void _init();
|
void _init();
|
||||||
@ -45,8 +45,8 @@ public:
|
|||||||
int get_priority() const;
|
int get_priority() const;
|
||||||
bool is_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int p_idx, bool p_secondary) const;
|
bool is_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int p_idx, bool p_secondary) const;
|
||||||
|
|
||||||
TerramanGizmoPlugin();
|
TerrainWorldGizmoPlugin();
|
||||||
~TerramanGizmoPlugin();
|
~TerrainWorldGizmoPlugin();
|
||||||
|
|
||||||
TerrainWorldEditorPlugin *plugin;
|
TerrainWorldEditorPlugin *plugin;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user