1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Portals - lift roomlist restrictions and fix link bug

Allows users to have the RoomManager as the roomlist.

Fixes a couple of bugs dealing with situations where users attempt to link Portals to Rooms outside the roomlist.

Adds a PortalEditorPlugin allowing you to flip individual portals.
This commit is contained in:
lawnjelly
2021-07-16 09:15:14 +01:00
parent 06d66488c2
commit 83f1377a8f
7 changed files with 197 additions and 65 deletions

View File

@@ -33,6 +33,7 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
#include "scene/3d/portal.h"
#include "scene/3d/room.h"
#include "scene/3d/room_manager.h"
#include "scene/resources/material.h"
@@ -89,4 +90,29 @@ public:
~RoomEditorPlugin();
};
///////////////////////
class PortalEditorPlugin : public EditorPlugin {
GDCLASS(PortalEditorPlugin, EditorPlugin);
Portal *_portal;
ToolButton *button_flip;
EditorNode *editor;
void _flip_portal();
protected:
static void _bind_methods();
public:
virtual String get_name() const { return "Portal"; }
bool has_main_screen() const { return false; }
virtual void edit(Object *p_object);
virtual bool handles(Object *p_object) const;
virtual void make_visible(bool p_visible);
PortalEditorPlugin(EditorNode *p_node);
~PortalEditorPlugin();
};
#endif