mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-11 13:21:10 +01:00
GradientCursor initial cleanup.
This commit is contained in:
parent
8ff93d88e8
commit
943538fec9
@ -0,0 +1,146 @@
|
||||
#include "gradient_cursor.h"
|
||||
|
||||
#include "gradient_editor.h"
|
||||
#include "scene/gui/label.h"
|
||||
|
||||
Color GradientCursor::get_color() {
|
||||
return color;
|
||||
}
|
||||
|
||||
void GradientCursor::set_color(const Color &val) {
|
||||
color = val;
|
||||
GradientEditor *ged = Object::cast_to<GradientEditor>(get_parent());
|
||||
ERR_FAIL_COND(!ged);
|
||||
ged->update_value();
|
||||
update();
|
||||
}
|
||||
|
||||
bool GradientCursor::get_sliding() const {
|
||||
return sliding;
|
||||
}
|
||||
|
||||
void GradientCursor::set_sliding(const bool val) {
|
||||
sliding = val;
|
||||
}
|
||||
|
||||
void GradientCursor::set_label(Label *p_label) {
|
||||
label = p_label;
|
||||
}
|
||||
|
||||
void GradientCursor::_draw() {
|
||||
Vector<Vector2> polygon;
|
||||
polygon.push_back(Vector2(0, 5));
|
||||
polygon.push_back(Vector2(WIDTH / 2, 0));
|
||||
polygon.push_back(Vector2(WIDTH, 5));
|
||||
polygon.push_back(Vector2(WIDTH, 15));
|
||||
polygon.push_back(Vector2(0, 15));
|
||||
polygon.push_back(Vector2(0, 5));
|
||||
|
||||
Color c = color;
|
||||
c.a = 1.0;
|
||||
draw_colored_polygon(polygon, c);
|
||||
draw_polyline(polygon, color.get_v() > 0.5 ? Color(0.0, 0.0, 0.0) : Color(1.0, 1.0, 1.0));
|
||||
}
|
||||
|
||||
void GradientCursor::_gui_input(const Ref<InputEvent> &ev) {
|
||||
Ref<InputEventMouseButton> iemb = ev;
|
||||
Ref<InputEventMouseMotion> iemm = ev;
|
||||
|
||||
GradientEditor *ged = Object::cast_to<GradientEditor>(get_parent());
|
||||
ERR_FAIL_COND(!ged);
|
||||
|
||||
if (iemb.is_valid()) {
|
||||
if (iemb->get_button_index() == BUTTON_LEFT) {
|
||||
if (iemb->is_doubleclick()) {
|
||||
ged->save_color_state();
|
||||
ged->select_color(this, iemb->get_global_position());
|
||||
} else if (iemb->is_pressed()) {
|
||||
ged->save_color_state();
|
||||
sliding = true;
|
||||
label->set_visible(true);
|
||||
label->set_text(String::num(get_cursor_position(), 3));
|
||||
} else {
|
||||
if (sliding) {
|
||||
ged->undo_redo_save_color_state();
|
||||
}
|
||||
|
||||
sliding = false;
|
||||
label->set_visible(false);
|
||||
}
|
||||
} else if (iemb->get_button_index() == BUTTON_RIGHT && ged->get_sorted_cursors().size() > 2) {
|
||||
ged->save_color_state();
|
||||
ged->remove_child(this);
|
||||
ged->update_value();
|
||||
ged->undo_redo_save_color_state();
|
||||
queue_delete();
|
||||
}
|
||||
} else if (iemm.is_valid() && (iemm->get_button_mask() & BUTTON_MASK_LEFT) != 0 && sliding) {
|
||||
Vector2 position = get_position();
|
||||
|
||||
position.x += get_local_mouse_position().x;
|
||||
|
||||
if (iemm->get_control()) {
|
||||
position.x = Math::round(get_cursor_position() * 20.0) * 0.05 * (ged->get_size().x - WIDTH);
|
||||
}
|
||||
|
||||
position.x = MIN(MAX(0, position.x), ged->get_size().x - get_size().x);
|
||||
set_position(position);
|
||||
|
||||
ged->update_value();
|
||||
label->set_text(String::num(get_cursor_position(), 3));
|
||||
}
|
||||
}
|
||||
|
||||
float GradientCursor::get_cursor_position() {
|
||||
return get_position().x / (get_parent_control()->get_size().x - WIDTH);
|
||||
}
|
||||
|
||||
bool GradientCursor::sort(const Variant &a, const Variant &b) {
|
||||
return a.get_position() < b.get_position();
|
||||
}
|
||||
|
||||
bool GradientCursor::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const {
|
||||
return p_data.get_type() == Variant::COLOR;
|
||||
}
|
||||
|
||||
void GradientCursor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
|
||||
set_color(p_data);
|
||||
}
|
||||
|
||||
GradientCursor::GradientCursor() {
|
||||
sliding = false;
|
||||
label = nullptr;
|
||||
}
|
||||
|
||||
GradientCursor::~GradientCursor() {
|
||||
}
|
||||
|
||||
void GradientCursor::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_POSTINITIALIZE: {
|
||||
set_position(Vector2(0, 15));
|
||||
set_size(Vector2(WIDTH, 15));
|
||||
} break;
|
||||
case NOTIFICATION_DRAW: {
|
||||
_draw();
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
void GradientCursor::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_color"), &GradientCursor::get_color);
|
||||
ClassDB::bind_method(D_METHOD("set_color", "value"), &GradientCursor::set_color);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_sliding"), &GradientCursor::get_sliding);
|
||||
ClassDB::bind_method(D_METHOD("set_sliding", "value"), &GradientCursor::set_sliding);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "sliding"), "set_sliding", "get_sliding");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_gui_input", "ev"), &GradientCursor::_gui_input);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_cursor_position"), &GradientCursor::get_cursor_position);
|
||||
ClassDB::bind_method(D_METHOD("set_color", "c"), &GradientCursor::set_color);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("can_drop_data_fw", "point", "data", "from"), &GradientCursor::can_drop_data_fw);
|
||||
ClassDB::bind_method(D_METHOD("drop_data_fw", "point", "data", "from"), &GradientCursor::drop_data_fw);
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
|
||||
#ifndef GRADIENT_CURSOR_H
|
||||
#define GRADIENT_CURSOR_H
|
||||
|
||||
#include "core/color.h"
|
||||
#include "core/os/input_event.h"
|
||||
#include "core/variant.h"
|
||||
|
||||
#include "scene/gui/control.h"
|
||||
|
||||
class Label;
|
||||
|
||||
class GradientCursor : public Control {
|
||||
GDCLASS(GradientCursor, Control);
|
||||
|
||||
public:
|
||||
Color get_color();
|
||||
void set_color(const Color &val);
|
||||
|
||||
bool get_sliding() const;
|
||||
void set_sliding(const bool val);
|
||||
|
||||
void set_label(Label *label);
|
||||
|
||||
void _draw();
|
||||
void _gui_input(const Ref<InputEvent> &ev);
|
||||
|
||||
float get_cursor_position();
|
||||
|
||||
static bool sort(const Variant &a, const Variant &b);
|
||||
|
||||
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
|
||||
void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
|
||||
|
||||
GradientCursor();
|
||||
~GradientCursor();
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
|
||||
static void _bind_methods();
|
||||
|
||||
Color color;
|
||||
bool sliding;
|
||||
Label *label;
|
||||
|
||||
const int WIDTH = 10;
|
||||
};
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -1,251 +0,0 @@
|
||||
|
||||
void construct() {
|
||||
|
||||
//Script: res://addons/mat_maker_gd/widgets/gradient_editor/gradient_editor.gd
|
||||
Control *control = memnew(Control);
|
||||
control->set_name("Control");
|
||||
|
||||
control->set_name("Control");
|
||||
//control->set("name", Control));
|
||||
|
||||
control->set_filename("res://addons/mat_maker_gd/widgets/gradient_editor/gradient_editor.tscn");
|
||||
//control->set("filename", "res://addons/mat_maker_gd/widgets/gradient_editor/gradient_editor.tscn");
|
||||
|
||||
control->set_margin_right(120);
|
||||
//control->set("margin_right", 120);
|
||||
|
||||
control->set_margin_bottom(30);
|
||||
//control->set("margin_bottom", 30);
|
||||
|
||||
control->set_rect_size(Vector2(120, 30));
|
||||
//control->set("rect_size", Vector2(120, 30));
|
||||
|
||||
control->set_rect_min_size(Vector2(120, 32));
|
||||
//control->set("rect_min_size", Vector2(120, 32));
|
||||
|
||||
control->set_focus_mode(1);
|
||||
//control->set("focus_mode", 1);
|
||||
|
||||
|
||||
|
||||
ColorRect *background_control = memnew(ColorRect);
|
||||
background_control->set_name("Background");
|
||||
control->add_child(background_control);
|
||||
|
||||
background_control->set_name("Background");
|
||||
//background_control->set("name", Background));
|
||||
|
||||
//background_control property owner TYPE_OBJECT value: Control:[Control:51414]
|
||||
|
||||
//background_control property material TYPE_OBJECT value: [ShaderMaterial:19166]
|
||||
Ref<ShaderMaterial> background_control_prop_material;
|
||||
background_control_prop_material.instance();
|
||||
background_control->set_material(background_control_prop_material);
|
||||
//background_control->set("material", background_control_prop_material);
|
||||
|
||||
background_control->set_anchor_right(1);
|
||||
//background_control->set("anchor_right", 1);
|
||||
|
||||
background_control->set_margin_left(4);
|
||||
//background_control->set("margin_left", 4);
|
||||
|
||||
background_control->set_margin_right(-4);
|
||||
//background_control->set("margin_right", -4);
|
||||
|
||||
background_control->set_margin_bottom(15);
|
||||
//background_control->set("margin_bottom", 15);
|
||||
|
||||
background_control->set_rect_position(Vector2(4, 0));
|
||||
//background_control->set("rect_position", Vector2(4, 0));
|
||||
|
||||
background_control->set_rect_global_position(Vector2(4, 0));
|
||||
//background_control->set("rect_global_position", Vector2(4, 0));
|
||||
|
||||
background_control->set_rect_size(Vector2(0, 15));
|
||||
//background_control->set("rect_size", Vector2(0, 15));
|
||||
|
||||
background_control->set_rect_min_size(Vector2(112, 17));
|
||||
//background_control->set("rect_min_size", Vector2(112, 17));
|
||||
|
||||
background_control->set_mouse_filter(2);
|
||||
//background_control->set("mouse_filter", 2);
|
||||
|
||||
//background_control property __meta__ TYPE_DICTIONARY value: {_edit_use_anchors_:False}
|
||||
|
||||
|
||||
|
||||
TextureRect *gradient_control = memnew(TextureRect);
|
||||
gradient_control->set_name("Gradient");
|
||||
control->add_child(gradient_control);
|
||||
|
||||
gradient_control->set_name("Gradient");
|
||||
//gradient_control->set("name", Gradient));
|
||||
|
||||
//gradient_control property owner TYPE_OBJECT value: Control:[Control:51414]
|
||||
|
||||
gradient_control->set_anchor_right(1);
|
||||
//gradient_control->set("anchor_right", 1);
|
||||
|
||||
gradient_control->set_margin_left(4);
|
||||
//gradient_control->set("margin_left", 4);
|
||||
|
||||
gradient_control->set_margin_right(-4);
|
||||
//gradient_control->set("margin_right", -4);
|
||||
|
||||
gradient_control->set_margin_bottom(15);
|
||||
//gradient_control->set("margin_bottom", 15);
|
||||
|
||||
gradient_control->set_rect_position(Vector2(4, 0));
|
||||
//gradient_control->set("rect_position", Vector2(4, 0));
|
||||
|
||||
gradient_control->set_rect_global_position(Vector2(4, 0));
|
||||
//gradient_control->set("rect_global_position", Vector2(4, 0));
|
||||
|
||||
gradient_control->set_rect_size(Vector2(0, 15));
|
||||
//gradient_control->set("rect_size", Vector2(0, 15));
|
||||
|
||||
gradient_control->set_rect_min_size(Vector2(112, 17));
|
||||
//gradient_control->set("rect_min_size", Vector2(112, 17));
|
||||
|
||||
gradient_control->set_mouse_filter(2);
|
||||
//gradient_control->set("mouse_filter", 2);
|
||||
|
||||
//gradient_control property theme TYPE_OBJECT value: [Theme:19167]
|
||||
Ref<Theme> gradient_control_prop_theme;
|
||||
gradient_control_prop_theme.instance();
|
||||
gradient_control->set_theme(gradient_control_prop_theme);
|
||||
//gradient_control->set("theme", gradient_control_prop_theme);
|
||||
|
||||
//gradient_control property __meta__ TYPE_DICTIONARY value: {_edit_use_anchors_:False}
|
||||
|
||||
|
||||
|
||||
OptionButton *interpolation_control = memnew(OptionButton);
|
||||
interpolation_control->set_name("Interpolation");
|
||||
control->add_child(interpolation_control);
|
||||
|
||||
interpolation_control->set_name("Interpolation");
|
||||
//interpolation_control->set("name", Interpolation));
|
||||
|
||||
//interpolation_control property owner TYPE_OBJECT value: Control:[Control:51414]
|
||||
|
||||
interpolation_control->set_margin_left(0.418457);
|
||||
//interpolation_control->set("margin_left", 0.418457);
|
||||
|
||||
interpolation_control->set_margin_top(-2.90374);
|
||||
//interpolation_control->set("margin_top", -2.90374);
|
||||
|
||||
interpolation_control->set_margin_right(73.418503);
|
||||
//interpolation_control->set("margin_right", 73.418503);
|
||||
|
||||
interpolation_control->set_margin_bottom(19.0963);
|
||||
//interpolation_control->set("margin_bottom", 19.0963);
|
||||
|
||||
interpolation_control->set_rect_position(Vector2(0.418457, -2.90374));
|
||||
//interpolation_control->set("rect_position", Vector2(0.418457, -2.90374));
|
||||
|
||||
interpolation_control->set_rect_global_position(Vector2(0.418457, -2.90374));
|
||||
//interpolation_control->set("rect_global_position", Vector2(0.418457, -2.90374));
|
||||
|
||||
interpolation_control->set_rect_size(Vector2(73.000046, 22.00004));
|
||||
//interpolation_control->set("rect_size", Vector2(73.000046, 22.00004));
|
||||
|
||||
interpolation_control->set_rect_scale(Vector2(0.5, 0.5));
|
||||
//interpolation_control->set("rect_scale", Vector2(0.5, 0.5));
|
||||
|
||||
//interpolation_control property icon TYPE_OBJECT value: [AtlasTexture:19168]
|
||||
Ref<AtlasTexture> interpolation_control_prop_icon;
|
||||
interpolation_control_prop_icon.instance();
|
||||
interpolation_control->set_icon(interpolation_control_prop_icon);
|
||||
//interpolation_control->set("icon", interpolation_control_prop_icon);
|
||||
|
||||
//interpolation_control property items TYPE_ARRAY value: [, [AtlasTexture:19169], False, 0, Null, , [AtlasTexture:19168], False, 1, Null, , [AtlasTexture:19170], False, 2, Null, , [AtlasTexture:19171], False, 3, Null]
|
||||
|
||||
interpolation_control->set_selected(1);
|
||||
//interpolation_control->set("selected", 1);
|
||||
|
||||
|
||||
|
||||
PopupMenu *popupmenu_interpolation_control = memnew(PopupMenu);
|
||||
popupmenu_interpolation_control->set_name("PopupMenu");
|
||||
interpolation_control->add_child(popupmenu_interpolation_control);
|
||||
|
||||
popupmenu_interpolation_control->set_name("PopupMenu");
|
||||
//popupmenu_interpolation_control->set("name", PopupMenu));
|
||||
|
||||
popupmenu_interpolation_control->set_input_pass_on_modal_close_click(False);
|
||||
//popupmenu_interpolation_control->set("input_pass_on_modal_close_click", False);
|
||||
|
||||
//popupmenu_interpolation_control property items TYPE_ARRAY value: [, [AtlasTexture:19169], 2, False, False, 0, 0, Null, , False, , [AtlasTexture:19168], 2, True, False, 1, 0, Null, , False, , [AtlasTexture:19170], 2, False, False, 2, 0, Null, , False, , [AtlasTexture:19171], 2, False, False, 3, 0, Null, , False]
|
||||
|
||||
popupmenu_interpolation_control->set_allow_search(True);
|
||||
//popupmenu_interpolation_control->set("allow_search", True);
|
||||
|
||||
|
||||
|
||||
Timer *timer_popupmenu_interpolation_control = memnew(Timer);
|
||||
timer_popupmenu_interpolation_control->set_name("Timer");
|
||||
popupmenu_interpolation_control->add_child(timer_popupmenu_interpolation_control);
|
||||
|
||||
timer_popupmenu_interpolation_control->set_name("Timer");
|
||||
//timer_popupmenu_interpolation_control->set("name", Timer));
|
||||
|
||||
timer_popupmenu_interpolation_control->set_wait_time(0.3);
|
||||
//timer_popupmenu_interpolation_control->set("wait_time", 0.3);
|
||||
|
||||
timer_popupmenu_interpolation_control->set_one_shot(True);
|
||||
//timer_popupmenu_interpolation_control->set("one_shot", True);
|
||||
|
||||
|
||||
|
||||
Label *value_control = memnew(Label);
|
||||
value_control->set_name("Value");
|
||||
control->add_child(value_control);
|
||||
|
||||
value_control->set_name("Value");
|
||||
//value_control->set("name", Value));
|
||||
|
||||
//value_control property owner TYPE_OBJECT value: Control:[Control:51414]
|
||||
|
||||
value_control->set_anchor_right(1);
|
||||
//value_control->set("anchor_right", 1);
|
||||
|
||||
value_control->set_margin_top(-1);
|
||||
//value_control->set("margin_top", -1);
|
||||
|
||||
value_control->set_margin_bottom(14);
|
||||
//value_control->set("margin_bottom", 14);
|
||||
|
||||
value_control->set_rect_position(Vector2(0, -1));
|
||||
//value_control->set("rect_position", Vector2(0, -1));
|
||||
|
||||
value_control->set_rect_global_position(Vector2(0, -1));
|
||||
//value_control->set("rect_global_position", Vector2(0, -1));
|
||||
|
||||
value_control->set_rect_size(Vector2(0, 15));
|
||||
//value_control->set("rect_size", Vector2(0, 15));
|
||||
|
||||
value_control->set_custom_colors/font_color(Color(1, 1, 1, 1));
|
||||
//value_control->set("custom_colors/font_color", Color(1, 1, 1, 1));
|
||||
|
||||
value_control->set_custom_colors/font_color_shadow(Color(0, 0, 0, 1));
|
||||
//value_control->set("custom_colors/font_color_shadow", Color(0, 0, 0, 1));
|
||||
|
||||
value_control->set_custom_constants/shadow_offset_x(1);
|
||||
//value_control->set("custom_constants/shadow_offset_x", 1);
|
||||
|
||||
value_control->set_custom_constants/shadow_offset_y(1);
|
||||
//value_control->set("custom_constants/shadow_offset_y", 1);
|
||||
|
||||
value_control->set_custom_constants/shadow_as_outline(1);
|
||||
//value_control->set("custom_constants/shadow_as_outline", 1);
|
||||
|
||||
value_control->set_align(1);
|
||||
//value_control->set("align", 1);
|
||||
|
||||
//value_control property __meta__ TYPE_DICTIONARY value: {_edit_use_anchors_:False}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,121 +1,64 @@
|
||||
#ifndef GRADIENT_EDITOR_H
|
||||
#define GRADIENT_EDITOR_H
|
||||
|
||||
#include "core/color.h"
|
||||
#include "core/variant.h"
|
||||
|
||||
#include "scene/gui/control.h"
|
||||
|
||||
class GradientEditor : public Control {
|
||||
GDCLASS(GradientEditor, Control);
|
||||
GDCLASS(GradientEditor, Control);
|
||||
|
||||
public:
|
||||
public:
|
||||
Variant get_Variant();
|
||||
void set_Variant(const Variant &val);
|
||||
|
||||
Variant get_Variant();
|
||||
void set_Variant(const Variant &val);
|
||||
Variant get_Variant();
|
||||
void set_Variant(const Variant &val);
|
||||
|
||||
Variant get_Variant();
|
||||
void set_Variant(const Variant &val);
|
||||
bool get_embedded() const;
|
||||
void set_embedded(const bool val);
|
||||
|
||||
bool get_embedded() const;
|
||||
void set_embedded(const bool val);
|
||||
UndoRedo get_undo_redo();
|
||||
void set_undo_redo(const UndoRedo &val);
|
||||
|
||||
UndoRedo get_*_undo_redo();
|
||||
void set_*_undo_redo(const UndoRedo &val);
|
||||
PoolRealArray get__saved_points();
|
||||
void set__saved_points(const PoolRealArray &val);
|
||||
|
||||
PoolRealArray get__saved_points();
|
||||
void set__saved_points(const PoolRealArray &val);
|
||||
Variant get_Variant();
|
||||
void set_Variant(const Variant &val);
|
||||
|
||||
Variant get_Variant();
|
||||
void set_Variant(const Variant &val);
|
||||
void _init();
|
||||
void ignore_changes(const Variant &val);
|
||||
void save_color_state();
|
||||
void undo_redo_save_color_state();
|
||||
void set_undo_redo(const UndoRedo &ur);
|
||||
void set_value(const Variant &v);
|
||||
void update_cursors();
|
||||
void update_value();
|
||||
void add_cursor(const Variant &x, const Variant &color);
|
||||
void _gui_input(const Variant &ev);
|
||||
void select_color(const Variant &cursor, const Variant &position);
|
||||
Array get_sorted_cursors();
|
||||
void generate_preview_image();
|
||||
Color get_gradient_color(const Variant &x);
|
||||
void update_preview();
|
||||
void _on_Interpolation_item_selected(const Variant &ID);
|
||||
void on_resized();
|
||||
|
||||
class GradientCursor {
|
||||
public:
|
||||
GradientEditor();
|
||||
~GradientEditor();
|
||||
|
||||
Color get_color();
|
||||
void set_color(const Color &val);
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
bool get_sliding() const;
|
||||
void set_sliding(const bool val);
|
||||
|
||||
void _ready();
|
||||
void _draw();
|
||||
void _gui_input(const Variant &ev);
|
||||
float get_cursor_position();
|
||||
void set_color(const Variant &c);
|
||||
static bool sort(const Variant &a, const Variant & b);
|
||||
bool can_drop_data(const Variant &_position, const Variant & data);
|
||||
void drop_data(const Variant &_position, const Variant & data);
|
||||
|
||||
GradientCursor();
|
||||
~GradientCursor();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
extends Control;
|
||||
Color color = ;
|
||||
bool sliding = false;
|
||||
onready var label : Label = get_parent().get_node("Value");
|
||||
const WIDTH : int = 10;
|
||||
Variant = null;
|
||||
Variant = null;
|
||||
bool embedded = true;
|
||||
UndoRedo *_undo_redo = null;
|
||||
signal updated(value);
|
||||
PoolRealArray _saved_points = PoolRealArray();
|
||||
Variant;
|
||||
};
|
||||
|
||||
void _init();
|
||||
void ignore_changes(const Variant &val);
|
||||
void save_color_state();
|
||||
void undo_redo_save_color_state();
|
||||
void set_undo_redo(const UndoRedo &ur);
|
||||
void set_value(const Variant &v);
|
||||
void update_cursors();
|
||||
void update_value();
|
||||
void add_cursor(const Variant &x, const Variant & color);
|
||||
void _gui_input(const Variant &ev);
|
||||
void select_color(const Variant &cursor, const Variant & position);
|
||||
Array get_sorted_cursors();
|
||||
void generate_preview_image();
|
||||
Color get_gradient_color(const Variant &x);
|
||||
void update_preview();
|
||||
void _on_Interpolation_item_selected(const Variant &ID);
|
||||
void on_resized();
|
||||
|
||||
GradientEditor();
|
||||
~GradientEditor();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
//tool
|
||||
Variant = null;
|
||||
// setget set_value
|
||||
Variant = null;
|
||||
//export
|
||||
bool embedded = true;
|
||||
UndoRedo *_undo_redo = null;
|
||||
signal updated(value);
|
||||
PoolRealArray _saved_points = PoolRealArray();
|
||||
//func get_gradient_from_data(data):
|
||||
// if typeof(data) == TYPE_ARRAY:
|
||||
// return data
|
||||
// elif typeof(data) == TYPE_DICTIONARY:
|
||||
// if data.has("parameters") and data.parameters.has("gradient"):
|
||||
// return data.parameters.gradient
|
||||
// if data.has("type") and data.type == "Gradient":
|
||||
// return data
|
||||
// return null
|
||||
//func get_drag_data(_position : Vector2):
|
||||
// var data = 0//MMType.serialize_value(value)
|
||||
// var preview = ColorRect.new()
|
||||
// preview.rect_size = Vector2(64, 24)
|
||||
// preview.material = $Gradient.material
|
||||
// set_drag_preview(preview)
|
||||
// return data
|
||||
//
|
||||
//func can_drop_data(_position : Vector2, data) -> bool:
|
||||
// return get_gradient_from_data(data) != null
|
||||
//
|
||||
//func drop_data(_position : Vector2, data) -> void:
|
||||
// var gradient = get_gradient_from_data(data)
|
||||
// //if gradient != null:
|
||||
// //set_value(MMType.deserialize_value(gradient))
|
||||
Variant ;
|
||||
// Calculating a color from the gradient and generating the shader
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,42 +1,333 @@
|
||||
|
||||
#include "gradient_popup.h"
|
||||
|
||||
//tool;
|
||||
signal updated(value);
|
||||
|
||||
|
||||
//tool;
|
||||
signal updated(value);
|
||||
|
||||
void GradientPopup::init(const Variant &value, const Variant & graph_node, const Variant & undo_redo) {
|
||||
$Panel/Control.set_undo_redo(undo_redo);
|
||||
$Panel/Control.graph_node = graph_node;
|
||||
$Panel/Control.set_value(value);
|
||||
void GradientPopup::init(const Variant &value, const Variant &graph_node, const Variant &undo_redo) {
|
||||
$Panel / Control.set_undo_redo(undo_redo);
|
||||
$Panel / Control.graph_node = graph_node;
|
||||
$Panel / Control.set_value(value);
|
||||
}
|
||||
|
||||
|
||||
void GradientPopup::_on_Control_updated(const Variant &value) {
|
||||
emit_signal("updated", value);
|
||||
void GradientPopup::_on_Control_updated(const Variant &value) {
|
||||
emit_signal("updated", value);
|
||||
}
|
||||
|
||||
|
||||
void GradientPopup::_on_GradientPopup_popup_hide() {
|
||||
queue_free();
|
||||
void GradientPopup::_on_GradientPopup_popup_hide() {
|
||||
queue_free();
|
||||
}
|
||||
}
|
||||
|
||||
GradientPopup::GradientPopup() {
|
||||
//Script: res://addons/mat_maker_gd/widgets/gradient_editor/gradient_popup.gd
|
||||
Popup *gradientpopup = memnew(Popup);
|
||||
gradientpopup->set_name("GradientPopup");
|
||||
|
||||
gradientpopup->set_name("GradientPopup");
|
||||
//gradientpopup->set("name", GradientPopup));
|
||||
|
||||
gradientpopup->set_filename("res://addons/mat_maker_gd/widgets/gradient_editor/gradient_popup.tscn");
|
||||
//gradientpopup->set("filename", "res://addons/mat_maker_gd/widgets/gradient_editor/gradient_popup.tscn");
|
||||
|
||||
gradientpopup->set_margin_right(632);
|
||||
//gradientpopup->set("margin_right", 632);
|
||||
|
||||
gradientpopup->set_margin_bottom(49);
|
||||
//gradientpopup->set("margin_bottom", 49);
|
||||
|
||||
gradientpopup->set_rect_size(Vector2(632, 49));
|
||||
//gradientpopup->set("rect_size", Vector2(632, 49));
|
||||
|
||||
gradientpopup->set_size_flags_horizontal(0);
|
||||
//gradientpopup->set("size_flags_horizontal", 0);
|
||||
|
||||
gradientpopup->set_size_flags_vertical(0);
|
||||
//gradientpopup->set("size_flags_vertical", 0);
|
||||
|
||||
Panel *panel_gradientpopup = memnew(Panel);
|
||||
panel_gradientpopup->set_name("Panel");
|
||||
gradientpopup->add_child(panel_gradientpopup);
|
||||
|
||||
panel_gradientpopup->set_name("Panel");
|
||||
//panel_gradientpopup->set("name", Panel));
|
||||
|
||||
//panel_gradientpopup property owner TYPE_OBJECT value: GradientPopup:[Popup:51440]
|
||||
|
||||
panel_gradientpopup->set_margin_right(632);
|
||||
//panel_gradientpopup->set("margin_right", 632);
|
||||
|
||||
panel_gradientpopup->set_margin_bottom(49);
|
||||
//panel_gradientpopup->set("margin_bottom", 49);
|
||||
|
||||
panel_gradientpopup->set_rect_size(Vector2(632, 49));
|
||||
//panel_gradientpopup->set("rect_size", Vector2(632, 49));
|
||||
|
||||
//panel_gradientpopup property custom_styles/panel TYPE_OBJECT value: [StyleBoxFlat:51436]
|
||||
Ref<StyleBoxFlat> panel_gradientpopup_prop_custom_styles / panel;
|
||||
panel_gradientpopup_prop_custom_styles / panel.instance();
|
||||
panel_gradientpopup->set_custom_styles / panel(panel_gradientpopup_prop_custom_styles / panel);
|
||||
//panel_gradientpopup->set("custom_styles/panel", panel_gradientpopup_prop_custom_styles/panel);
|
||||
|
||||
//Script: res://addons/mat_maker_gd/widgets/gradient_editor/gradient_editor.gd
|
||||
Control *control_panel_gradientpopup = memnew(Control);
|
||||
control_panel_gradientpopup->set_name("Control");
|
||||
panel_gradientpopup->add_child(control_panel_gradientpopup);
|
||||
|
||||
control_panel_gradientpopup->set_name("Control");
|
||||
//control_panel_gradientpopup->set("name", Control));
|
||||
|
||||
control_panel_gradientpopup->set_filename("res://addons/mat_maker_gd/widgets/gradient_editor/gradient_editor.tscn");
|
||||
//control_panel_gradientpopup->set("filename", "res://addons/mat_maker_gd/widgets/gradient_editor/gradient_editor.tscn");
|
||||
|
||||
//control_panel_gradientpopup property owner TYPE_OBJECT value: GradientPopup:[Popup:51440]
|
||||
|
||||
control_panel_gradientpopup->set_anchor_right(1);
|
||||
//control_panel_gradientpopup->set("anchor_right", 1);
|
||||
|
||||
control_panel_gradientpopup->set_anchor_bottom(1);
|
||||
//control_panel_gradientpopup->set("anchor_bottom", 1);
|
||||
|
||||
control_panel_gradientpopup->set_margin_left(10);
|
||||
//control_panel_gradientpopup->set("margin_left", 10);
|
||||
|
||||
control_panel_gradientpopup->set_margin_top(10);
|
||||
//control_panel_gradientpopup->set("margin_top", 10);
|
||||
|
||||
control_panel_gradientpopup->set_margin_right(-10);
|
||||
//control_panel_gradientpopup->set("margin_right", -10);
|
||||
|
||||
control_panel_gradientpopup->set_margin_bottom(-10);
|
||||
//control_panel_gradientpopup->set("margin_bottom", -10);
|
||||
|
||||
control_panel_gradientpopup->set_rect_position(Vector2(10, 10));
|
||||
//control_panel_gradientpopup->set("rect_position", Vector2(10, 10));
|
||||
|
||||
control_panel_gradientpopup->set_rect_global_position(Vector2(10, 10));
|
||||
//control_panel_gradientpopup->set("rect_global_position", Vector2(10, 10));
|
||||
|
||||
control_panel_gradientpopup->set_rect_min_size(Vector2(120, 32));
|
||||
//control_panel_gradientpopup->set("rect_min_size", Vector2(120, 32));
|
||||
|
||||
control_panel_gradientpopup->set_focus_mode(1);
|
||||
//control_panel_gradientpopup->set("focus_mode", 1);
|
||||
|
||||
control_panel_gradientpopup->set_embedded(False);
|
||||
//control_panel_gradientpopup->set("embedded", False);
|
||||
|
||||
ColorRect *background_control_panel_gradientpopup = memnew(ColorRect);
|
||||
background_control_panel_gradientpopup->set_name("Background");
|
||||
control_panel_gradientpopup->add_child(background_control_panel_gradientpopup);
|
||||
|
||||
background_control_panel_gradientpopup->set_name("Background");
|
||||
//background_control_panel_gradientpopup->set("name", Background));
|
||||
|
||||
//background_control_panel_gradientpopup property owner TYPE_OBJECT value: Control:[Control:51442]
|
||||
|
||||
//background_control_panel_gradientpopup property material TYPE_OBJECT value: [ShaderMaterial:19166]
|
||||
Ref<ShaderMaterial> background_control_panel_gradientpopup_prop_material;
|
||||
background_control_panel_gradientpopup_prop_material.instance();
|
||||
background_control_panel_gradientpopup->set_material(background_control_panel_gradientpopup_prop_material);
|
||||
//background_control_panel_gradientpopup->set("material", background_control_panel_gradientpopup_prop_material);
|
||||
|
||||
background_control_panel_gradientpopup->set_anchor_right(1);
|
||||
//background_control_panel_gradientpopup->set("anchor_right", 1);
|
||||
|
||||
background_control_panel_gradientpopup->set_margin_left(4);
|
||||
//background_control_panel_gradientpopup->set("margin_left", 4);
|
||||
|
||||
background_control_panel_gradientpopup->set_margin_right(-4);
|
||||
//background_control_panel_gradientpopup->set("margin_right", -4);
|
||||
|
||||
background_control_panel_gradientpopup->set_margin_bottom(15);
|
||||
//background_control_panel_gradientpopup->set("margin_bottom", 15);
|
||||
|
||||
background_control_panel_gradientpopup->set_rect_position(Vector2(4, 0));
|
||||
//background_control_panel_gradientpopup->set("rect_position", Vector2(4, 0));
|
||||
|
||||
background_control_panel_gradientpopup->set_rect_global_position(Vector2(4, 0));
|
||||
//background_control_panel_gradientpopup->set("rect_global_position", Vector2(4, 0));
|
||||
|
||||
background_control_panel_gradientpopup->set_rect_size(Vector2(0, 15));
|
||||
//background_control_panel_gradientpopup->set("rect_size", Vector2(0, 15));
|
||||
|
||||
background_control_panel_gradientpopup->set_rect_min_size(Vector2(112, 17));
|
||||
//background_control_panel_gradientpopup->set("rect_min_size", Vector2(112, 17));
|
||||
|
||||
background_control_panel_gradientpopup->set_mouse_filter(2);
|
||||
//background_control_panel_gradientpopup->set("mouse_filter", 2);
|
||||
|
||||
//background_control_panel_gradientpopup property __meta__ TYPE_DICTIONARY value: {_edit_use_anchors_:False}
|
||||
|
||||
TextureRect *gradient_control_panel_gradientpopup = memnew(TextureRect);
|
||||
gradient_control_panel_gradientpopup->set_name("Gradient");
|
||||
control_panel_gradientpopup->add_child(gradient_control_panel_gradientpopup);
|
||||
|
||||
gradient_control_panel_gradientpopup->set_name("Gradient");
|
||||
//gradient_control_panel_gradientpopup->set("name", Gradient));
|
||||
|
||||
//gradient_control_panel_gradientpopup property owner TYPE_OBJECT value: Control:[Control:51442]
|
||||
|
||||
gradient_control_panel_gradientpopup->set_anchor_right(1);
|
||||
//gradient_control_panel_gradientpopup->set("anchor_right", 1);
|
||||
|
||||
gradient_control_panel_gradientpopup->set_margin_left(4);
|
||||
//gradient_control_panel_gradientpopup->set("margin_left", 4);
|
||||
|
||||
gradient_control_panel_gradientpopup->set_margin_right(-4);
|
||||
//gradient_control_panel_gradientpopup->set("margin_right", -4);
|
||||
|
||||
gradient_control_panel_gradientpopup->set_margin_bottom(15);
|
||||
//gradient_control_panel_gradientpopup->set("margin_bottom", 15);
|
||||
|
||||
gradient_control_panel_gradientpopup->set_rect_position(Vector2(4, 0));
|
||||
//gradient_control_panel_gradientpopup->set("rect_position", Vector2(4, 0));
|
||||
|
||||
gradient_control_panel_gradientpopup->set_rect_global_position(Vector2(4, 0));
|
||||
//gradient_control_panel_gradientpopup->set("rect_global_position", Vector2(4, 0));
|
||||
|
||||
gradient_control_panel_gradientpopup->set_rect_size(Vector2(0, 15));
|
||||
//gradient_control_panel_gradientpopup->set("rect_size", Vector2(0, 15));
|
||||
|
||||
gradient_control_panel_gradientpopup->set_rect_min_size(Vector2(112, 17));
|
||||
//gradient_control_panel_gradientpopup->set("rect_min_size", Vector2(112, 17));
|
||||
|
||||
gradient_control_panel_gradientpopup->set_mouse_filter(2);
|
||||
//gradient_control_panel_gradientpopup->set("mouse_filter", 2);
|
||||
|
||||
//gradient_control_panel_gradientpopup property theme TYPE_OBJECT value: [Theme:19167]
|
||||
Ref<Theme> gradient_control_panel_gradientpopup_prop_theme;
|
||||
gradient_control_panel_gradientpopup_prop_theme.instance();
|
||||
gradient_control_panel_gradientpopup->set_theme(gradient_control_panel_gradientpopup_prop_theme);
|
||||
//gradient_control_panel_gradientpopup->set("theme", gradient_control_panel_gradientpopup_prop_theme);
|
||||
|
||||
//gradient_control_panel_gradientpopup property __meta__ TYPE_DICTIONARY value: {_edit_use_anchors_:False}
|
||||
|
||||
OptionButton *interpolation_control_panel_gradientpopup = memnew(OptionButton);
|
||||
interpolation_control_panel_gradientpopup->set_name("Interpolation");
|
||||
control_panel_gradientpopup->add_child(interpolation_control_panel_gradientpopup);
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_name("Interpolation");
|
||||
//interpolation_control_panel_gradientpopup->set("name", Interpolation));
|
||||
|
||||
//interpolation_control_panel_gradientpopup property owner TYPE_OBJECT value: Control:[Control:51442]
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_margin_left(0.418457);
|
||||
//interpolation_control_panel_gradientpopup->set("margin_left", 0.418457);
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_margin_top(-2.90374);
|
||||
//interpolation_control_panel_gradientpopup->set("margin_top", -2.90374);
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_margin_right(73.418503);
|
||||
//interpolation_control_panel_gradientpopup->set("margin_right", 73.418503);
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_margin_bottom(19.0963);
|
||||
//interpolation_control_panel_gradientpopup->set("margin_bottom", 19.0963);
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_rect_position(Vector2(0.418457, -2.90374));
|
||||
//interpolation_control_panel_gradientpopup->set("rect_position", Vector2(0.418457, -2.90374));
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_rect_global_position(Vector2(0.418457, -2.90374));
|
||||
//interpolation_control_panel_gradientpopup->set("rect_global_position", Vector2(0.418457, -2.90374));
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_rect_size(Vector2(73.000046, 22.00004));
|
||||
//interpolation_control_panel_gradientpopup->set("rect_size", Vector2(73.000046, 22.00004));
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_rect_scale(Vector2(0.5, 0.5));
|
||||
//interpolation_control_panel_gradientpopup->set("rect_scale", Vector2(0.5, 0.5));
|
||||
|
||||
//interpolation_control_panel_gradientpopup property icon TYPE_OBJECT value: [AtlasTexture:19168]
|
||||
Ref<AtlasTexture> interpolation_control_panel_gradientpopup_prop_icon;
|
||||
interpolation_control_panel_gradientpopup_prop_icon.instance();
|
||||
interpolation_control_panel_gradientpopup->set_icon(interpolation_control_panel_gradientpopup_prop_icon);
|
||||
//interpolation_control_panel_gradientpopup->set("icon", interpolation_control_panel_gradientpopup_prop_icon);
|
||||
|
||||
//interpolation_control_panel_gradientpopup property items TYPE_ARRAY value: [, [AtlasTexture:19169], False, 0, Null, , [AtlasTexture:19168], False, 1, Null, , [AtlasTexture:19170], False, 2, Null, , [AtlasTexture:19171], False, 3, Null]
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_selected(1);
|
||||
//interpolation_control_panel_gradientpopup->set("selected", 1);
|
||||
|
||||
PopupMenu *popupmenu_interpolation_control_panel_gradientpopup = memnew(PopupMenu);
|
||||
popupmenu_interpolation_control_panel_gradientpopup->set_name("PopupMenu");
|
||||
interpolation_control_panel_gradientpopup->add_child(popupmenu_interpolation_control_panel_gradientpopup);
|
||||
|
||||
popupmenu_interpolation_control_panel_gradientpopup->set_name("PopupMenu");
|
||||
//popupmenu_interpolation_control_panel_gradientpopup->set("name", PopupMenu));
|
||||
|
||||
popupmenu_interpolation_control_panel_gradientpopup->set_input_pass_on_modal_close_click(False);
|
||||
//popupmenu_interpolation_control_panel_gradientpopup->set("input_pass_on_modal_close_click", False);
|
||||
|
||||
//popupmenu_interpolation_control_panel_gradientpopup property items TYPE_ARRAY value: [, [AtlasTexture:19169], 2, False, False, 0, 0, Null, , False, , [AtlasTexture:19168], 2, True, False, 1, 0, Null, , False, , [AtlasTexture:19170], 2, False, False, 2, 0, Null, , False, , [AtlasTexture:19171], 2, False, False, 3, 0, Null, , False]
|
||||
|
||||
popupmenu_interpolation_control_panel_gradientpopup->set_allow_search(True);
|
||||
//popupmenu_interpolation_control_panel_gradientpopup->set("allow_search", True);
|
||||
|
||||
Timer *timer_popupmenu_interpolation_control_panel_gradientpopup = memnew(Timer);
|
||||
timer_popupmenu_interpolation_control_panel_gradientpopup->set_name("Timer");
|
||||
popupmenu_interpolation_control_panel_gradientpopup->add_child(timer_popupmenu_interpolation_control_panel_gradientpopup);
|
||||
|
||||
timer_popupmenu_interpolation_control_panel_gradientpopup->set_name("Timer");
|
||||
//timer_popupmenu_interpolation_control_panel_gradientpopup->set("name", Timer));
|
||||
|
||||
timer_popupmenu_interpolation_control_panel_gradientpopup->set_wait_time(0.3);
|
||||
//timer_popupmenu_interpolation_control_panel_gradientpopup->set("wait_time", 0.3);
|
||||
|
||||
timer_popupmenu_interpolation_control_panel_gradientpopup->set_one_shot(True);
|
||||
//timer_popupmenu_interpolation_control_panel_gradientpopup->set("one_shot", True);
|
||||
|
||||
Label *value_control_panel_gradientpopup = memnew(Label);
|
||||
value_control_panel_gradientpopup->set_name("Value");
|
||||
control_panel_gradientpopup->add_child(value_control_panel_gradientpopup);
|
||||
|
||||
value_control_panel_gradientpopup->set_name("Value");
|
||||
//value_control_panel_gradientpopup->set("name", Value));
|
||||
|
||||
//value_control_panel_gradientpopup property owner TYPE_OBJECT value: Control:[Control:51442]
|
||||
|
||||
value_control_panel_gradientpopup->set_anchor_right(1);
|
||||
//value_control_panel_gradientpopup->set("anchor_right", 1);
|
||||
|
||||
value_control_panel_gradientpopup->set_margin_top(-1);
|
||||
//value_control_panel_gradientpopup->set("margin_top", -1);
|
||||
|
||||
value_control_panel_gradientpopup->set_margin_bottom(14);
|
||||
//value_control_panel_gradientpopup->set("margin_bottom", 14);
|
||||
|
||||
value_control_panel_gradientpopup->set_rect_position(Vector2(0, -1));
|
||||
//value_control_panel_gradientpopup->set("rect_position", Vector2(0, -1));
|
||||
|
||||
value_control_panel_gradientpopup->set_rect_global_position(Vector2(0, -1));
|
||||
//value_control_panel_gradientpopup->set("rect_global_position", Vector2(0, -1));
|
||||
|
||||
value_control_panel_gradientpopup->set_rect_size(Vector2(0, 15));
|
||||
//value_control_panel_gradientpopup->set("rect_size", Vector2(0, 15));
|
||||
|
||||
value_control_panel_gradientpopup->set_custom_colors / font_color(Color(1, 1, 1, 1));
|
||||
//value_control_panel_gradientpopup->set("custom_colors/font_color", Color(1, 1, 1, 1));
|
||||
|
||||
value_control_panel_gradientpopup->set_custom_colors / font_color_shadow(Color(0, 0, 0, 1));
|
||||
//value_control_panel_gradientpopup->set("custom_colors/font_color_shadow", Color(0, 0, 0, 1));
|
||||
|
||||
value_control_panel_gradientpopup->set_custom_constants / shadow_offset_x(1);
|
||||
//value_control_panel_gradientpopup->set("custom_constants/shadow_offset_x", 1);
|
||||
|
||||
value_control_panel_gradientpopup->set_custom_constants / shadow_offset_y(1);
|
||||
//value_control_panel_gradientpopup->set("custom_constants/shadow_offset_y", 1);
|
||||
|
||||
value_control_panel_gradientpopup->set_custom_constants / shadow_as_outline(1);
|
||||
//value_control_panel_gradientpopup->set("custom_constants/shadow_as_outline", 1);
|
||||
|
||||
value_control_panel_gradientpopup->set_align(1);
|
||||
//value_control_panel_gradientpopup->set("align", 1);
|
||||
|
||||
//value_control_panel_gradientpopup property __meta__ TYPE_DICTIONARY value: {_edit_use_anchors_:False}
|
||||
}
|
||||
|
||||
GradientPopup::GradientPopup() {
|
||||
}
|
||||
|
||||
GradientPopup::~GradientPopup() {
|
||||
}
|
||||
|
||||
|
||||
static void GradientPopup::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("init", "value", " graph_node", " undo_redo"), &GradientPopup::init);
|
||||
ClassDB::bind_method(D_METHOD("_on_Control_updated", "value"), &GradientPopup::_on_Control_updated);
|
||||
ClassDB::bind_method(D_METHOD("_on_GradientPopup_popup_hide"), &GradientPopup::_on_GradientPopup_popup_hide);
|
||||
|
||||
}
|
||||
|
||||
|
||||
GradientPopup::~GradientPopup() {
|
||||
}
|
||||
|
||||
static void GradientPopup::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("init", "value", " graph_node", " undo_redo"), &GradientPopup::init);
|
||||
ClassDB::bind_method(D_METHOD("_on_Control_updated", "value"), &GradientPopup::_on_Control_updated);
|
||||
ClassDB::bind_method(D_METHOD("_on_GradientPopup_popup_hide"), &GradientPopup::_on_GradientPopup_popup_hide);
|
||||
}
|
||||
|
@ -1,325 +0,0 @@
|
||||
|
||||
void construct() {
|
||||
|
||||
//Script: res://addons/mat_maker_gd/widgets/gradient_editor/gradient_popup.gd
|
||||
Popup *gradientpopup = memnew(Popup);
|
||||
gradientpopup->set_name("GradientPopup");
|
||||
|
||||
gradientpopup->set_name("GradientPopup");
|
||||
//gradientpopup->set("name", GradientPopup));
|
||||
|
||||
gradientpopup->set_filename("res://addons/mat_maker_gd/widgets/gradient_editor/gradient_popup.tscn");
|
||||
//gradientpopup->set("filename", "res://addons/mat_maker_gd/widgets/gradient_editor/gradient_popup.tscn");
|
||||
|
||||
gradientpopup->set_margin_right(632);
|
||||
//gradientpopup->set("margin_right", 632);
|
||||
|
||||
gradientpopup->set_margin_bottom(49);
|
||||
//gradientpopup->set("margin_bottom", 49);
|
||||
|
||||
gradientpopup->set_rect_size(Vector2(632, 49));
|
||||
//gradientpopup->set("rect_size", Vector2(632, 49));
|
||||
|
||||
gradientpopup->set_size_flags_horizontal(0);
|
||||
//gradientpopup->set("size_flags_horizontal", 0);
|
||||
|
||||
gradientpopup->set_size_flags_vertical(0);
|
||||
//gradientpopup->set("size_flags_vertical", 0);
|
||||
|
||||
|
||||
|
||||
Panel *panel_gradientpopup = memnew(Panel);
|
||||
panel_gradientpopup->set_name("Panel");
|
||||
gradientpopup->add_child(panel_gradientpopup);
|
||||
|
||||
panel_gradientpopup->set_name("Panel");
|
||||
//panel_gradientpopup->set("name", Panel));
|
||||
|
||||
//panel_gradientpopup property owner TYPE_OBJECT value: GradientPopup:[Popup:51440]
|
||||
|
||||
panel_gradientpopup->set_margin_right(632);
|
||||
//panel_gradientpopup->set("margin_right", 632);
|
||||
|
||||
panel_gradientpopup->set_margin_bottom(49);
|
||||
//panel_gradientpopup->set("margin_bottom", 49);
|
||||
|
||||
panel_gradientpopup->set_rect_size(Vector2(632, 49));
|
||||
//panel_gradientpopup->set("rect_size", Vector2(632, 49));
|
||||
|
||||
//panel_gradientpopup property custom_styles/panel TYPE_OBJECT value: [StyleBoxFlat:51436]
|
||||
Ref<StyleBoxFlat> panel_gradientpopup_prop_custom_styles/panel;
|
||||
panel_gradientpopup_prop_custom_styles/panel.instance();
|
||||
panel_gradientpopup->set_custom_styles/panel(panel_gradientpopup_prop_custom_styles/panel);
|
||||
//panel_gradientpopup->set("custom_styles/panel", panel_gradientpopup_prop_custom_styles/panel);
|
||||
|
||||
|
||||
|
||||
//Script: res://addons/mat_maker_gd/widgets/gradient_editor/gradient_editor.gd
|
||||
Control *control_panel_gradientpopup = memnew(Control);
|
||||
control_panel_gradientpopup->set_name("Control");
|
||||
panel_gradientpopup->add_child(control_panel_gradientpopup);
|
||||
|
||||
control_panel_gradientpopup->set_name("Control");
|
||||
//control_panel_gradientpopup->set("name", Control));
|
||||
|
||||
control_panel_gradientpopup->set_filename("res://addons/mat_maker_gd/widgets/gradient_editor/gradient_editor.tscn");
|
||||
//control_panel_gradientpopup->set("filename", "res://addons/mat_maker_gd/widgets/gradient_editor/gradient_editor.tscn");
|
||||
|
||||
//control_panel_gradientpopup property owner TYPE_OBJECT value: GradientPopup:[Popup:51440]
|
||||
|
||||
control_panel_gradientpopup->set_anchor_right(1);
|
||||
//control_panel_gradientpopup->set("anchor_right", 1);
|
||||
|
||||
control_panel_gradientpopup->set_anchor_bottom(1);
|
||||
//control_panel_gradientpopup->set("anchor_bottom", 1);
|
||||
|
||||
control_panel_gradientpopup->set_margin_left(10);
|
||||
//control_panel_gradientpopup->set("margin_left", 10);
|
||||
|
||||
control_panel_gradientpopup->set_margin_top(10);
|
||||
//control_panel_gradientpopup->set("margin_top", 10);
|
||||
|
||||
control_panel_gradientpopup->set_margin_right(-10);
|
||||
//control_panel_gradientpopup->set("margin_right", -10);
|
||||
|
||||
control_panel_gradientpopup->set_margin_bottom(-10);
|
||||
//control_panel_gradientpopup->set("margin_bottom", -10);
|
||||
|
||||
control_panel_gradientpopup->set_rect_position(Vector2(10, 10));
|
||||
//control_panel_gradientpopup->set("rect_position", Vector2(10, 10));
|
||||
|
||||
control_panel_gradientpopup->set_rect_global_position(Vector2(10, 10));
|
||||
//control_panel_gradientpopup->set("rect_global_position", Vector2(10, 10));
|
||||
|
||||
control_panel_gradientpopup->set_rect_min_size(Vector2(120, 32));
|
||||
//control_panel_gradientpopup->set("rect_min_size", Vector2(120, 32));
|
||||
|
||||
control_panel_gradientpopup->set_focus_mode(1);
|
||||
//control_panel_gradientpopup->set("focus_mode", 1);
|
||||
|
||||
control_panel_gradientpopup->set_embedded(False);
|
||||
//control_panel_gradientpopup->set("embedded", False);
|
||||
|
||||
|
||||
|
||||
ColorRect *background_control_panel_gradientpopup = memnew(ColorRect);
|
||||
background_control_panel_gradientpopup->set_name("Background");
|
||||
control_panel_gradientpopup->add_child(background_control_panel_gradientpopup);
|
||||
|
||||
background_control_panel_gradientpopup->set_name("Background");
|
||||
//background_control_panel_gradientpopup->set("name", Background));
|
||||
|
||||
//background_control_panel_gradientpopup property owner TYPE_OBJECT value: Control:[Control:51442]
|
||||
|
||||
//background_control_panel_gradientpopup property material TYPE_OBJECT value: [ShaderMaterial:19166]
|
||||
Ref<ShaderMaterial> background_control_panel_gradientpopup_prop_material;
|
||||
background_control_panel_gradientpopup_prop_material.instance();
|
||||
background_control_panel_gradientpopup->set_material(background_control_panel_gradientpopup_prop_material);
|
||||
//background_control_panel_gradientpopup->set("material", background_control_panel_gradientpopup_prop_material);
|
||||
|
||||
background_control_panel_gradientpopup->set_anchor_right(1);
|
||||
//background_control_panel_gradientpopup->set("anchor_right", 1);
|
||||
|
||||
background_control_panel_gradientpopup->set_margin_left(4);
|
||||
//background_control_panel_gradientpopup->set("margin_left", 4);
|
||||
|
||||
background_control_panel_gradientpopup->set_margin_right(-4);
|
||||
//background_control_panel_gradientpopup->set("margin_right", -4);
|
||||
|
||||
background_control_panel_gradientpopup->set_margin_bottom(15);
|
||||
//background_control_panel_gradientpopup->set("margin_bottom", 15);
|
||||
|
||||
background_control_panel_gradientpopup->set_rect_position(Vector2(4, 0));
|
||||
//background_control_panel_gradientpopup->set("rect_position", Vector2(4, 0));
|
||||
|
||||
background_control_panel_gradientpopup->set_rect_global_position(Vector2(4, 0));
|
||||
//background_control_panel_gradientpopup->set("rect_global_position", Vector2(4, 0));
|
||||
|
||||
background_control_panel_gradientpopup->set_rect_size(Vector2(0, 15));
|
||||
//background_control_panel_gradientpopup->set("rect_size", Vector2(0, 15));
|
||||
|
||||
background_control_panel_gradientpopup->set_rect_min_size(Vector2(112, 17));
|
||||
//background_control_panel_gradientpopup->set("rect_min_size", Vector2(112, 17));
|
||||
|
||||
background_control_panel_gradientpopup->set_mouse_filter(2);
|
||||
//background_control_panel_gradientpopup->set("mouse_filter", 2);
|
||||
|
||||
//background_control_panel_gradientpopup property __meta__ TYPE_DICTIONARY value: {_edit_use_anchors_:False}
|
||||
|
||||
|
||||
|
||||
TextureRect *gradient_control_panel_gradientpopup = memnew(TextureRect);
|
||||
gradient_control_panel_gradientpopup->set_name("Gradient");
|
||||
control_panel_gradientpopup->add_child(gradient_control_panel_gradientpopup);
|
||||
|
||||
gradient_control_panel_gradientpopup->set_name("Gradient");
|
||||
//gradient_control_panel_gradientpopup->set("name", Gradient));
|
||||
|
||||
//gradient_control_panel_gradientpopup property owner TYPE_OBJECT value: Control:[Control:51442]
|
||||
|
||||
gradient_control_panel_gradientpopup->set_anchor_right(1);
|
||||
//gradient_control_panel_gradientpopup->set("anchor_right", 1);
|
||||
|
||||
gradient_control_panel_gradientpopup->set_margin_left(4);
|
||||
//gradient_control_panel_gradientpopup->set("margin_left", 4);
|
||||
|
||||
gradient_control_panel_gradientpopup->set_margin_right(-4);
|
||||
//gradient_control_panel_gradientpopup->set("margin_right", -4);
|
||||
|
||||
gradient_control_panel_gradientpopup->set_margin_bottom(15);
|
||||
//gradient_control_panel_gradientpopup->set("margin_bottom", 15);
|
||||
|
||||
gradient_control_panel_gradientpopup->set_rect_position(Vector2(4, 0));
|
||||
//gradient_control_panel_gradientpopup->set("rect_position", Vector2(4, 0));
|
||||
|
||||
gradient_control_panel_gradientpopup->set_rect_global_position(Vector2(4, 0));
|
||||
//gradient_control_panel_gradientpopup->set("rect_global_position", Vector2(4, 0));
|
||||
|
||||
gradient_control_panel_gradientpopup->set_rect_size(Vector2(0, 15));
|
||||
//gradient_control_panel_gradientpopup->set("rect_size", Vector2(0, 15));
|
||||
|
||||
gradient_control_panel_gradientpopup->set_rect_min_size(Vector2(112, 17));
|
||||
//gradient_control_panel_gradientpopup->set("rect_min_size", Vector2(112, 17));
|
||||
|
||||
gradient_control_panel_gradientpopup->set_mouse_filter(2);
|
||||
//gradient_control_panel_gradientpopup->set("mouse_filter", 2);
|
||||
|
||||
//gradient_control_panel_gradientpopup property theme TYPE_OBJECT value: [Theme:19167]
|
||||
Ref<Theme> gradient_control_panel_gradientpopup_prop_theme;
|
||||
gradient_control_panel_gradientpopup_prop_theme.instance();
|
||||
gradient_control_panel_gradientpopup->set_theme(gradient_control_panel_gradientpopup_prop_theme);
|
||||
//gradient_control_panel_gradientpopup->set("theme", gradient_control_panel_gradientpopup_prop_theme);
|
||||
|
||||
//gradient_control_panel_gradientpopup property __meta__ TYPE_DICTIONARY value: {_edit_use_anchors_:False}
|
||||
|
||||
|
||||
|
||||
OptionButton *interpolation_control_panel_gradientpopup = memnew(OptionButton);
|
||||
interpolation_control_panel_gradientpopup->set_name("Interpolation");
|
||||
control_panel_gradientpopup->add_child(interpolation_control_panel_gradientpopup);
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_name("Interpolation");
|
||||
//interpolation_control_panel_gradientpopup->set("name", Interpolation));
|
||||
|
||||
//interpolation_control_panel_gradientpopup property owner TYPE_OBJECT value: Control:[Control:51442]
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_margin_left(0.418457);
|
||||
//interpolation_control_panel_gradientpopup->set("margin_left", 0.418457);
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_margin_top(-2.90374);
|
||||
//interpolation_control_panel_gradientpopup->set("margin_top", -2.90374);
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_margin_right(73.418503);
|
||||
//interpolation_control_panel_gradientpopup->set("margin_right", 73.418503);
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_margin_bottom(19.0963);
|
||||
//interpolation_control_panel_gradientpopup->set("margin_bottom", 19.0963);
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_rect_position(Vector2(0.418457, -2.90374));
|
||||
//interpolation_control_panel_gradientpopup->set("rect_position", Vector2(0.418457, -2.90374));
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_rect_global_position(Vector2(0.418457, -2.90374));
|
||||
//interpolation_control_panel_gradientpopup->set("rect_global_position", Vector2(0.418457, -2.90374));
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_rect_size(Vector2(73.000046, 22.00004));
|
||||
//interpolation_control_panel_gradientpopup->set("rect_size", Vector2(73.000046, 22.00004));
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_rect_scale(Vector2(0.5, 0.5));
|
||||
//interpolation_control_panel_gradientpopup->set("rect_scale", Vector2(0.5, 0.5));
|
||||
|
||||
//interpolation_control_panel_gradientpopup property icon TYPE_OBJECT value: [AtlasTexture:19168]
|
||||
Ref<AtlasTexture> interpolation_control_panel_gradientpopup_prop_icon;
|
||||
interpolation_control_panel_gradientpopup_prop_icon.instance();
|
||||
interpolation_control_panel_gradientpopup->set_icon(interpolation_control_panel_gradientpopup_prop_icon);
|
||||
//interpolation_control_panel_gradientpopup->set("icon", interpolation_control_panel_gradientpopup_prop_icon);
|
||||
|
||||
//interpolation_control_panel_gradientpopup property items TYPE_ARRAY value: [, [AtlasTexture:19169], False, 0, Null, , [AtlasTexture:19168], False, 1, Null, , [AtlasTexture:19170], False, 2, Null, , [AtlasTexture:19171], False, 3, Null]
|
||||
|
||||
interpolation_control_panel_gradientpopup->set_selected(1);
|
||||
//interpolation_control_panel_gradientpopup->set("selected", 1);
|
||||
|
||||
|
||||
|
||||
PopupMenu *popupmenu_interpolation_control_panel_gradientpopup = memnew(PopupMenu);
|
||||
popupmenu_interpolation_control_panel_gradientpopup->set_name("PopupMenu");
|
||||
interpolation_control_panel_gradientpopup->add_child(popupmenu_interpolation_control_panel_gradientpopup);
|
||||
|
||||
popupmenu_interpolation_control_panel_gradientpopup->set_name("PopupMenu");
|
||||
//popupmenu_interpolation_control_panel_gradientpopup->set("name", PopupMenu));
|
||||
|
||||
popupmenu_interpolation_control_panel_gradientpopup->set_input_pass_on_modal_close_click(False);
|
||||
//popupmenu_interpolation_control_panel_gradientpopup->set("input_pass_on_modal_close_click", False);
|
||||
|
||||
//popupmenu_interpolation_control_panel_gradientpopup property items TYPE_ARRAY value: [, [AtlasTexture:19169], 2, False, False, 0, 0, Null, , False, , [AtlasTexture:19168], 2, True, False, 1, 0, Null, , False, , [AtlasTexture:19170], 2, False, False, 2, 0, Null, , False, , [AtlasTexture:19171], 2, False, False, 3, 0, Null, , False]
|
||||
|
||||
popupmenu_interpolation_control_panel_gradientpopup->set_allow_search(True);
|
||||
//popupmenu_interpolation_control_panel_gradientpopup->set("allow_search", True);
|
||||
|
||||
|
||||
|
||||
Timer *timer_popupmenu_interpolation_control_panel_gradientpopup = memnew(Timer);
|
||||
timer_popupmenu_interpolation_control_panel_gradientpopup->set_name("Timer");
|
||||
popupmenu_interpolation_control_panel_gradientpopup->add_child(timer_popupmenu_interpolation_control_panel_gradientpopup);
|
||||
|
||||
timer_popupmenu_interpolation_control_panel_gradientpopup->set_name("Timer");
|
||||
//timer_popupmenu_interpolation_control_panel_gradientpopup->set("name", Timer));
|
||||
|
||||
timer_popupmenu_interpolation_control_panel_gradientpopup->set_wait_time(0.3);
|
||||
//timer_popupmenu_interpolation_control_panel_gradientpopup->set("wait_time", 0.3);
|
||||
|
||||
timer_popupmenu_interpolation_control_panel_gradientpopup->set_one_shot(True);
|
||||
//timer_popupmenu_interpolation_control_panel_gradientpopup->set("one_shot", True);
|
||||
|
||||
|
||||
|
||||
Label *value_control_panel_gradientpopup = memnew(Label);
|
||||
value_control_panel_gradientpopup->set_name("Value");
|
||||
control_panel_gradientpopup->add_child(value_control_panel_gradientpopup);
|
||||
|
||||
value_control_panel_gradientpopup->set_name("Value");
|
||||
//value_control_panel_gradientpopup->set("name", Value));
|
||||
|
||||
//value_control_panel_gradientpopup property owner TYPE_OBJECT value: Control:[Control:51442]
|
||||
|
||||
value_control_panel_gradientpopup->set_anchor_right(1);
|
||||
//value_control_panel_gradientpopup->set("anchor_right", 1);
|
||||
|
||||
value_control_panel_gradientpopup->set_margin_top(-1);
|
||||
//value_control_panel_gradientpopup->set("margin_top", -1);
|
||||
|
||||
value_control_panel_gradientpopup->set_margin_bottom(14);
|
||||
//value_control_panel_gradientpopup->set("margin_bottom", 14);
|
||||
|
||||
value_control_panel_gradientpopup->set_rect_position(Vector2(0, -1));
|
||||
//value_control_panel_gradientpopup->set("rect_position", Vector2(0, -1));
|
||||
|
||||
value_control_panel_gradientpopup->set_rect_global_position(Vector2(0, -1));
|
||||
//value_control_panel_gradientpopup->set("rect_global_position", Vector2(0, -1));
|
||||
|
||||
value_control_panel_gradientpopup->set_rect_size(Vector2(0, 15));
|
||||
//value_control_panel_gradientpopup->set("rect_size", Vector2(0, 15));
|
||||
|
||||
value_control_panel_gradientpopup->set_custom_colors/font_color(Color(1, 1, 1, 1));
|
||||
//value_control_panel_gradientpopup->set("custom_colors/font_color", Color(1, 1, 1, 1));
|
||||
|
||||
value_control_panel_gradientpopup->set_custom_colors/font_color_shadow(Color(0, 0, 0, 1));
|
||||
//value_control_panel_gradientpopup->set("custom_colors/font_color_shadow", Color(0, 0, 0, 1));
|
||||
|
||||
value_control_panel_gradientpopup->set_custom_constants/shadow_offset_x(1);
|
||||
//value_control_panel_gradientpopup->set("custom_constants/shadow_offset_x", 1);
|
||||
|
||||
value_control_panel_gradientpopup->set_custom_constants/shadow_offset_y(1);
|
||||
//value_control_panel_gradientpopup->set("custom_constants/shadow_offset_y", 1);
|
||||
|
||||
value_control_panel_gradientpopup->set_custom_constants/shadow_as_outline(1);
|
||||
//value_control_panel_gradientpopup->set("custom_constants/shadow_as_outline", 1);
|
||||
|
||||
value_control_panel_gradientpopup->set_align(1);
|
||||
//value_control_panel_gradientpopup->set("align", 1);
|
||||
|
||||
//value_control_panel_gradientpopup property __meta__ TYPE_DICTIONARY value: {_edit_use_anchors_:False}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user