mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Update if == NOTIFICATION_* to switch statements to match coding style
This commit is contained in:
parent
98b97d34df
commit
8824b6c5e9
38 changed files with 1134 additions and 1016 deletions
|
@ -38,31 +38,33 @@
|
|||
#include "scene/resources/sky_material.h"
|
||||
|
||||
void MaterialEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_READY) {
|
||||
//get_scene()->connect("node_removed",this,"_node_removed");
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_READY: {
|
||||
//get_scene()->connect("node_removed",this,"_node_removed");
|
||||
|
||||
if (first_enter) {
|
||||
//it's in propertyeditor so.. could be moved around
|
||||
if (first_enter) {
|
||||
//it's in propertyeditor so.. could be moved around
|
||||
|
||||
light_1_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewLight1"), SNAME("EditorIcons")));
|
||||
light_1_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewLight1Off"), SNAME("EditorIcons")));
|
||||
light_2_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewLight2"), SNAME("EditorIcons")));
|
||||
light_2_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewLight2Off"), SNAME("EditorIcons")));
|
||||
light_1_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewLight1"), SNAME("EditorIcons")));
|
||||
light_1_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewLight1Off"), SNAME("EditorIcons")));
|
||||
light_2_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewLight2"), SNAME("EditorIcons")));
|
||||
light_2_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewLight2Off"), SNAME("EditorIcons")));
|
||||
|
||||
sphere_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewSphereOff"), SNAME("EditorIcons")));
|
||||
sphere_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewSphere"), SNAME("EditorIcons")));
|
||||
box_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewCubeOff"), SNAME("EditorIcons")));
|
||||
box_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewCube"), SNAME("EditorIcons")));
|
||||
sphere_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewSphereOff"), SNAME("EditorIcons")));
|
||||
sphere_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewSphere"), SNAME("EditorIcons")));
|
||||
box_switch->set_normal_texture(get_theme_icon(SNAME("MaterialPreviewCubeOff"), SNAME("EditorIcons")));
|
||||
box_switch->set_pressed_texture(get_theme_icon(SNAME("MaterialPreviewCube"), SNAME("EditorIcons")));
|
||||
|
||||
first_enter = false;
|
||||
}
|
||||
}
|
||||
first_enter = false;
|
||||
}
|
||||
} break;
|
||||
|
||||
if (p_what == NOTIFICATION_DRAW) {
|
||||
Ref<Texture2D> checkerboard = get_theme_icon(SNAME("Checkerboard"), SNAME("EditorIcons"));
|
||||
Size2 size = get_size();
|
||||
case NOTIFICATION_DRAW: {
|
||||
Ref<Texture2D> checkerboard = get_theme_icon(SNAME("Checkerboard"), SNAME("EditorIcons"));
|
||||
Size2 size = get_size();
|
||||
|
||||
draw_texture_rect(checkerboard, Rect2(Point2(), size), true);
|
||||
draw_texture_rect(checkerboard, Rect2(Point2(), size), true);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue