mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-04-11 22:32:02 +02:00
Added a button for setting the allow chunk creation option for the isolevel brush in TerrainWorldEditor.
This commit is contained in:
parent
7120ab24fd
commit
7e54c7d634
@ -267,11 +267,11 @@ TerrainWorldEditor::TerrainWorldEditor() {
|
||||
_isolevel_picker_mode = false;
|
||||
|
||||
_isolevel_brush_channel = -1;
|
||||
_brush_allow_create_chunks = true;
|
||||
_isolevel_brush_size = 10;
|
||||
_isolevel_brush_smoothness = 10;
|
||||
//_brush_type = BRUSH_TYPE_CIRCLE;
|
||||
_isolevel_brush_type = ISOLEVEL_BRUSH_TYPE_ADD;
|
||||
_isolevel_brush_allow_create_chunks = false;
|
||||
}
|
||||
TerrainWorldEditor::TerrainWorldEditor(EditorNode *p_editor) {
|
||||
_undo_redo = EditorNode::get_undo_redo();
|
||||
@ -287,11 +287,11 @@ TerrainWorldEditor::TerrainWorldEditor(EditorNode *p_editor) {
|
||||
_isolevel_picker_mode = false;
|
||||
|
||||
_isolevel_brush_channel = -1;
|
||||
_brush_allow_create_chunks = true;
|
||||
_isolevel_brush_size = 10;
|
||||
_isolevel_brush_smoothness = 10;
|
||||
//_brush_type = BRUSH_TYPE_CIRCLE;
|
||||
_isolevel_brush_type = ISOLEVEL_BRUSH_TYPE_ADD;
|
||||
_isolevel_brush_allow_create_chunks = false;
|
||||
|
||||
_editor = p_editor;
|
||||
_tool_mode = TOOL_MODE_ADD;
|
||||
@ -429,6 +429,12 @@ TerrainWorldEditor::TerrainWorldEditor(EditorNode *p_editor) {
|
||||
_isolevel_brush_type_smooth_button->set_shortcut(ED_SHORTCUT("terrain_world_editor/isolevel_brush_type_smooth", "Isolevel Brush Type Smooth", KEY_K));
|
||||
isolevel_brush_flow_container->add_child(_isolevel_brush_type_smooth_button);
|
||||
|
||||
_isolevel_brush_allow_creating_chunks_button = memnew(ToolButton);
|
||||
_isolevel_brush_allow_creating_chunks_button->set_toggle_mode(true);
|
||||
_isolevel_brush_allow_creating_chunks_button->connect("button_up", this, "_on_isolevel_brush_allow_creating_chunks_selected");
|
||||
_isolevel_brush_allow_creating_chunks_button->set_shortcut(ED_SHORTCUT("terrain_world_editor/isolevel_brush_allow_creating_chunks", "Isolevel Brush Allow Chunk Creation", KEY_L));
|
||||
isolevel_brush_flow_container->add_child(_isolevel_brush_allow_creating_chunks_button);
|
||||
|
||||
Label *isolevel_brush_size_label = memnew(Label);
|
||||
isolevel_brush_size_label->set_text(TTR("Size"));
|
||||
_isolevel_brush_tool_container->add_child(isolevel_brush_size_label);
|
||||
@ -504,6 +510,7 @@ void TerrainWorldEditor::_notification(int p_what) {
|
||||
_isolevel_brush_type_substract_button->set_icon(get_theme_icon("MoveDown", "EditorIcons"));
|
||||
_isolevel_brush_type_set_button->set_icon(get_theme_icon("CanvasLayer", "EditorIcons"));
|
||||
_isolevel_brush_type_smooth_button->set_icon(get_theme_icon("Blend", "EditorIcons"));
|
||||
_isolevel_brush_allow_creating_chunks_button->set_icon(get_theme_icon("Add", "EditorIcons"));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
@ -620,6 +627,10 @@ void TerrainWorldEditor::_on_isolevel_brush_channel_select_sb_changed(int value)
|
||||
_isolevel_brush_channel = value;
|
||||
}
|
||||
|
||||
void TerrainWorldEditor::_on_isolevel_brush_allow_creating_chunks_selected() {
|
||||
_isolevel_brush_allow_create_chunks = _isolevel_brush_allow_creating_chunks_button->is_pressed();
|
||||
}
|
||||
|
||||
void TerrainWorldEditor::_bind_methods() {
|
||||
ClassDB::bind_method("_node_removed", &TerrainWorldEditor::_node_removed);
|
||||
ClassDB::bind_method("_on_surface_button_pressed", &TerrainWorldEditor::_on_surface_button_pressed);
|
||||
@ -630,6 +641,7 @@ void TerrainWorldEditor::_bind_methods() {
|
||||
ClassDB::bind_method("_on_isolevel_brush_size_slider_changed", &TerrainWorldEditor::_on_isolevel_brush_size_slider_changed);
|
||||
ClassDB::bind_method("_on_isolevel_brush_smoothness_slider_changed", &TerrainWorldEditor::_on_isolevel_brush_smoothness_slider_changed);
|
||||
ClassDB::bind_method("_on_isolevel_brush_channel_select_sb_changed", &TerrainWorldEditor::_on_isolevel_brush_channel_select_sb_changed);
|
||||
ClassDB::bind_method("_on_isolevel_brush_allow_creating_chunks_selected", &TerrainWorldEditor::_on_isolevel_brush_allow_creating_chunks_selected);
|
||||
}
|
||||
|
||||
void TerrainWorldEditorPlugin::_notification(int p_what) {
|
||||
|
@ -81,6 +81,7 @@ protected:
|
||||
void _on_isolevel_brush_size_slider_changed(float value);
|
||||
void _on_isolevel_brush_smoothness_slider_changed(float value);
|
||||
void _on_isolevel_brush_channel_select_sb_changed(int value);
|
||||
void _on_isolevel_brush_allow_creating_chunks_selected();
|
||||
|
||||
private:
|
||||
UndoRedo *_undo_redo;
|
||||
@ -99,8 +100,6 @@ private:
|
||||
ISOLEVEL_BRUSH_TYPE_SMOOTH,
|
||||
};
|
||||
|
||||
bool _brush_allow_create_chunks;
|
||||
|
||||
bool _isolevel_picker_mode;
|
||||
|
||||
int _isolevel_brush_channel;
|
||||
@ -108,6 +107,7 @@ private:
|
||||
float _isolevel_brush_smoothness;
|
||||
//BrushType _brush_type;
|
||||
IsolevelBrushType _isolevel_brush_type;
|
||||
bool _isolevel_brush_allow_create_chunks;
|
||||
|
||||
private:
|
||||
TerrainWorld *_world;
|
||||
@ -144,6 +144,7 @@ private:
|
||||
ToolButton *_isolevel_brush_type_substract_button;
|
||||
ToolButton *_isolevel_brush_type_set_button;
|
||||
ToolButton *_isolevel_brush_type_smooth_button;
|
||||
ToolButton *_isolevel_brush_allow_creating_chunks_button;
|
||||
HSlider *_isolevel_brush_size_slider;
|
||||
HSlider *_isolevel_brush_smoothness_slider;
|
||||
SpinBox *_isolevel_brush_channel_select_sb;
|
||||
|
Loading…
Reference in New Issue
Block a user