Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore visuals in DemoPickerUI.tscn: UI theme resource and background image #60

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
248 changes: 108 additions & 140 deletions godot/Main/DemoPickerUI.tscn

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions godot/Main/DemoSelector.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ script = ExtResource("5")
[node name="DemoPickerUI" parent="." instance=ExtResource("1")]
layout_mode = 3
anchors_preset = 15
grow_horizontal = 2
grow_vertical = 2

[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = 100
Expand Down
14 changes: 8 additions & 6 deletions godot/Main/GDQuestLogo.tscn
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[gd_scene load_steps=2 format=3 uid="uid://cmg7vob2jhnek"]
[gd_scene load_steps=3 format=3 uid="uid://cmg7vob2jhnek"]

[ext_resource type="Texture2D" uid="uid://dieoxafgevoay" path="res://Main/gdquest_logo_white.svg" id="1_wf1i5"]
[ext_resource type="Script" path="res://Main/GDQuestLogo.gd" id="2"]

[node name="GDQuestLogo" type="TextureButton"]
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -311.082
offset_top = -127.947
offset_right = -57.082
offset_bottom = -49.9467
offset_left = -1920.0
offset_top = -1080.0
offset_right = -1666.0
offset_bottom = -1001.0
mouse_default_cursor_shape = 2
texture_normal = null
texture_normal = ExtResource("1_wf1i5")
script = ExtResource("2")
9 changes: 9 additions & 0 deletions godot/Main/UI/ui_theme.tres
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ cache/0/16/0/descent = 0.0
cache/0/16/0/underline_position = 0.0
cache/0/16/0/underline_thickness = 0.0
cache/0/16/0/scale = 1.0
cache/0/28/0/ascent = 0.0
cache/0/28/0/descent = 0.0
cache/0/28/0/underline_position = 0.0
cache/0/28/0/underline_thickness = 0.0
cache/0/28/0/scale = 1.0

[sub_resource type="StyleBoxTexture" id="2"]
region_rect = Rect2(0, 0, 199, 128)
Expand Down Expand Up @@ -45,12 +50,14 @@ expand_margin_bottom = 20.0

[resource]
default_font = ExtResource("1")
default_font_size = 36
Button/colors/font_color = Color(0.760784, 0.760784, 0.819608, 1)
Button/colors/font_color_disabled = Color(0.196078, 0.160784, 0.278431, 0.619608)
Button/colors/font_color_focus = Color(0.760784, 0.760784, 0.819608, 1)
Button/colors/font_color_hover = Color(0.760784, 0.760784, 0.819608, 1)
Button/colors/font_color_pressed = Color(0.494118, 0.494118, 0.560784, 1)
Button/constants/hseparation = 2
Button/font_sizes/font_size = 28
Button/fonts/font = SubResource("1")
Button/styles/disabled = SubResource("2")
Button/styles/focus = SubResource("3")
Expand All @@ -72,6 +79,7 @@ ItemList/constants/hseparation = 4
ItemList/constants/icon_margin = 4
ItemList/constants/line_separation = 2
ItemList/constants/vseparation = 2
ItemList/font_sizes/font_size = 36
ItemList/fonts/font = ExtResource("1")
ItemList/styles/bg = SubResource("7")
ItemList/styles/bg_focus = null
Expand All @@ -87,6 +95,7 @@ LineEdit/colors/font_color_selected = Color(0, 0, 0, 1)
LineEdit/colors/font_color_uneditable = Color(0.88, 0.88, 0.88, 0.5)
LineEdit/colors/selection_color = Color(0.49, 0.49, 0.49, 1)
LineEdit/constants/minimum_spaces = 12
LineEdit/font_sizes/font_size = 36
LineEdit/fonts/font = ExtResource("1")
LineEdit/icons/clear = null
LineEdit/styles/focus = null
Expand Down
2 changes: 1 addition & 1 deletion godot/Utils/DebugViewer.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class_name DebugViewer
extends Control

@export (float, 0.1, 1, 0.025) var size_multiplier = 0.125
@export_range(0.1, 1, 0.025) var size_multiplier := 0.125
@export var enabled := true: set = _set_enabled


Expand Down
2 changes: 1 addition & 1 deletion godot/Utils/PostProcessBuilder.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class_name PostProcessBuilder
extends Control

@export (Array, Resource) var processing_steps := []
@export var processing_steps: Array[Resource] = []
@export var scene: PackedScene


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extends Node

enum LightRole { KEY, FILL, KICK }

@export (LightRole) var light_role := 0: set = _set_light_role
@export var light_role: LightRole = 0: set = _set_light_role
@export var emits_shadows := false: set = _set_emits_shadows
@export var specular_material: ShaderMaterial: set = _set_specular_material

Expand Down Expand Up @@ -182,9 +182,7 @@ func _on_parent_renamed() -> void:

func _on_parent_tree_exiting() -> void:
abort_deletion = false
Engine.get_main_loop().connect(
"idle_frame", self, "_on_SceneTree_idle_frame", [], CONNECT_ONE_SHOT
)
get_tree().process_frame.connect(_on_SceneTree_idle_frame, ConnectFlags.CONNECT_ONE_SHOT)


func _on_SceneTree_idle_frame() -> void:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ func _ready() -> void:
scene_root.call_deferred("move_child", self, 0)

if not light_data:
light_data = await _build_data(DataType.LIGHT).completed
light_data = await _build_data(DataType.LIGHT)

if not specular_data:
specular_data = await _build_data(DataType.SPECULAR).completed
specular_data = await _build_data(DataType.SPECULAR)


func get_class() -> String:
Expand Down Expand Up @@ -67,8 +67,8 @@ func _build_data(type: int) -> SubViewport:

var viewport := SubViewport.new()
viewport.transparent_bg = true
viewport.world = World.new()
viewport.usage = SubViewport.USAGE_3D_NO_EFFECTS
viewport.world_3d = World3D.new()
#viewport.usage = Viewport.USAGE_3D_NO_EFFECTS
viewport.render_target_update_mode = SubViewport.UPDATE_ALWAYS
viewport.msaa = ProjectSettings.get_setting("rendering/quality/filters/msaa")
viewport.shadow_atlas_size = shadow_resolution
Expand Down
4 changes: 2 additions & 2 deletions godot/addons/gdquest.toon-controller/plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ func handles(object: Object) -> bool:
return false


func _forward_3d_gui_input(camera: Camera3D, event: InputEvent) -> bool:
func _forward_3d_gui_input(camera: Camera3D, event: InputEvent) -> int:
_set_camera_and_viewports(camera.global_transform)
return false
return EditorPlugin.AFTER_GUI_INPUT_STOP


func _on_Preview_pressed() -> void:
Expand Down
4 changes: 2 additions & 2 deletions godot/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ window/size/viewport_height=1080
window/size/always_on_top=true
window/size/window_width_override=1280
window/size/window_height_override=720
window/stretch/mode="2d"
window/stretch/mode="canvas_items"
window/stretch/aspect="expand"

[editor_plugins]

enabled=PackedStringArray("gdquest.toon-controller")
enabled=PackedStringArray("res://addons/gdquest.toon-controller/plugin.cfg")

[filesystem]

Expand Down