diff options
Diffstat (limited to '')
| -rw-r--r-- | editor/plugins/physical_bone_plugin.h (renamed from platform/javascript/power_javascript.cpp) | 81 |
1 files changed, 43 insertions, 38 deletions
diff --git a/platform/javascript/power_javascript.cpp b/editor/plugins/physical_bone_plugin.h index 54fceb75f..9e7a50307 100644 --- a/platform/javascript/power_javascript.cpp +++ b/editor/plugins/physical_bone_plugin.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* power_javascript.cpp */ +/* physical_bone_plugin.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,46 +28,51 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "power_javascript.h" -#include "error_macros.h" +#ifndef PHYSICAL_BONE_PLUGIN_H +#define PHYSICAL_BONE_PLUGIN_H -bool PowerJavascript::UpdatePowerInfo() { - // TODO Javascript implementation - return false; -} +#include "editor/editor_node.h" -OS::PowerState PowerJavascript::get_power_state() { - if (UpdatePowerInfo()) { - return power_state; - } else { - WARN_PRINT("Power management is not implemented on this platform, defaulting to POWERSTATE_UNKNOWN"); - return OS::POWERSTATE_UNKNOWN; - } -} +class PhysicalBoneEditor : public Object { + GDCLASS(PhysicalBoneEditor, Object); -int PowerJavascript::get_power_seconds_left() { - if (UpdatePowerInfo()) { - return nsecs_left; - } else { - WARN_PRINT("Power management is not implemented on this platform, defaulting to -1"); - return -1; - } -} + EditorNode *editor; + HBoxContainer *spatial_editor_hb; + ToolButton *button_transform_joint; -int PowerJavascript::get_power_percent_left() { - if (UpdatePowerInfo()) { - return percent_left; - } else { - WARN_PRINT("Power management is not implemented on this platform, defaulting to -1"); - return -1; - } -} + PhysicalBone *selected; -PowerJavascript::PowerJavascript() : - nsecs_left(-1), - percent_left(-1), - power_state(OS::POWERSTATE_UNKNOWN) { -} +protected: + static void _bind_methods(); -PowerJavascript::~PowerJavascript() { -} +private: + void _on_toggle_button_transform_joint(bool p_is_pressed); + void _set_move_joint(); + +public: + PhysicalBoneEditor(EditorNode *p_editor); + ~PhysicalBoneEditor(); + + void set_selected(PhysicalBone *p_pb); + + void hide(); + void show(); +}; + +class PhysicalBonePlugin : public EditorPlugin { + GDCLASS(PhysicalBonePlugin, EditorPlugin); + + EditorNode *editor; + PhysicalBone *selected; + PhysicalBoneEditor *physical_bone_editor; + +public: + virtual String get_name() const { return "PhysicalBone"; } + virtual bool handles(Object *p_object) const { return p_object->is_class("PhysicalBone"); } + virtual void make_visible(bool p_visible); + virtual void edit(Object *p_node); + + PhysicalBonePlugin(EditorNode *p_editor); +}; + +#endif |
