Skip to content

Commit

Permalink
update to Godot 4
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxUserGD committed Sep 6, 2023
1 parent 82c9cf2 commit 91dc238
Show file tree
Hide file tree
Showing 10 changed files with 267 additions and 215 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Imported assets
.import/
.godot/

# Logs when editor logging is enabled
logs/
Expand Down
33 changes: 33 additions & 0 deletions fonts/hack_regular.ttf.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[remap]

importer="font_data_dynamic"
type="FontFile"
uid="uid://bwt6t2q5kbjbe"
path="res://.godot/imported/hack_regular.ttf-820faac22e8507b865c49f372d61c50a.fontdata"

[deps]

source_file="res://fonts/hack_regular.ttf"
dest_files=["res://.godot/imported/hack_regular.ttf-820faac22e8507b865c49f372d61c50a.fontdata"]

[params]

Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}
33 changes: 33 additions & 0 deletions fonts/noto_sans_regular.ttf.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[remap]

importer="font_data_dynamic"
type="FontFile"
uid="uid://decvm47txmafw"
path="res://.godot/imported/noto_sans_regular.ttf-17218758a5901582c240baa6434c5ece.fontdata"

[deps]

source_file="res://fonts/noto_sans_regular.ttf"
dest_files=["res://.godot/imported/noto_sans_regular.ttf-17218758a5901582c240baa6434c5ece.fontdata"]

[params]

Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}
31 changes: 15 additions & 16 deletions icon.png.import
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
type="CompressedTexture2D"
uid="uid://7ovkcxaqbbkn"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
32 changes: 17 additions & 15 deletions icon.svg.import
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/icon.svg-218a8f2b3041327d8a5756f3a245f83b.stex"
type="CompressedTexture2D"
uid="uid://pshtg2iiqrsd"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icon.svg"
dest_files=[ "res://.import/icon.svg-218a8f2b3041327d8a5756f3a245f83b.stex" ]
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/hdr_compression=1
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
129 changes: 56 additions & 73 deletions main.tscn
Original file line number Diff line number Diff line change
@@ -1,126 +1,109 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=7 format=3 uid="uid://bb4hpvw0tq6yt"]

[ext_resource path="res://resources/code_font.tres" type="DynamicFont" id=1]
[ext_resource path="res://script_editor.gd" type="Script" id=2]
[ext_resource path="res://run_button.gd" type="Script" id=3]
[ext_resource path="res://resources/theme.tres" type="Theme" id=4]
[ext_resource path="res://main_window.gd" type="Script" id=5]
[ext_resource type="Theme" uid="uid://bwuol0nxm8rsj" path="res://resources/theme.tres" id="1_b4qlw"]
[ext_resource type="Script" path="res://main_window.gd" id="2_cf6o8"]
[ext_resource type="Script" path="res://script_editor.gd" id="3_g8bjr"]
[ext_resource type="FontFile" uid="uid://decvm47txmafw" path="res://fonts/noto_sans_regular.ttf" id="4_hv1ml"]
[ext_resource type="Script" path="res://run_button.gd" id="5_d1ogv"]

[sub_resource type="StyleBoxFlat" id=1]
content_margin_left = 32.0
content_margin_right = 32.0
content_margin_top = 24.0
content_margin_bottom = 24.0
bg_color = Color( 0.18375, 0.202519, 0.21, 1 )
[sub_resource type="CodeHighlighter" id="CodeHighlighter_wdykl"]
number_color = Color(1, 0.666667, 0.137255, 1)
symbol_color = Color(1, 1, 1, 1)
function_color = Color(0.27451, 0.47451, 0.65098, 1)

[node name="MainWindow" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 4 )
script = ExtResource( 5 )
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_b4qlw")
script = ExtResource("2_cf6o8")

[node name="HSplitContainer" type="HSplitContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
split_offset = 640
__meta__ = {
"_edit_use_anchors_": false
}

[node name="VBoxContainer" type="VBoxContainer" parent="HSplitContainer"]
margin_right = 656.0
margin_bottom = 720.0
custom_constants/separation = 0
layout_mode = 2

[node name="ScriptEditor" type="TextEdit" parent="HSplitContainer/VBoxContainer"]
margin_right = 656.0
margin_bottom = 720.0
layout_mode = 2
size_flags_vertical = 3
custom_colors/selection_color = Color( 0, 0.666667, 1, 0.25098 )
custom_colors/current_line_color = Color( 1, 1, 1, 0.0705882 )
custom_constants/line_spacing = 6
custom_fonts/font = ExtResource( 1 )
theme = ExtResource("1_b4qlw")
text = "extends Node
func _ready():
print(\"Hello world!\")
"
print(\"Hello world!\")"
highlight_all_occurrences = true
highlight_current_line = true
syntax_highlighting = true
show_line_numbers = true
draw_tabs = true
fold_gutter = true
highlight_all_occurrences = true
hiding_enabled = true
wrap_enabled = true
syntax_highlighter = SubResource("CodeHighlighter_wdykl")
caret_blink = true
caret_blink_speed = 0.5
script = ExtResource( 2 )
script = ExtResource("3_g8bjr")

[node name="RunButton" type="Button" parent="HSplitContainer/VBoxContainer/ScriptEditor"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
margin_left = -100.0
margin_top = 15.0
margin_right = -15.0
margin_bottom = 48.0
offset_left = -80.0
offset_bottom = 33.0
grow_horizontal = 0
hint_tooltip = "Shortcut: Ctrl + Enter"
theme_override_fonts/font = ExtResource("4_hv1ml")
text = "Run"
script = ExtResource( 3 )
script = ExtResource("5_d1ogv")
metadata/_edit_layout_mode = 1

[node name="ShareButton" type="Button" parent="HSplitContainer/VBoxContainer/ScriptEditor"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
margin_left = -196.0
margin_top = 15.0
margin_right = -111.0
margin_bottom = 48.0
offset_left = -167.0
offset_right = -87.0
offset_bottom = 33.0
grow_horizontal = 0
hint_tooltip = "Copies a link to this website to the clipboard with the current code pre-placed."
theme_override_fonts/font = ExtResource("4_hv1ml")
text = "Share"
metadata/_edit_layout_mode = 1

[node name="CopiedTimer" type="Timer" parent="HSplitContainer/VBoxContainer/ScriptEditor"]
one_shot = true

[node name="OutputPanel" type="PanelContainer" parent="HSplitContainer"]
margin_left = 668.0
margin_right = 1280.0
margin_bottom = 720.0
custom_styles/panel = SubResource( 1 )
layout_mode = 2

[node name="ErrorLabel" type="Label" parent="HSplitContainer/OutputPanel"]
margin_left = 32.0
margin_top = 24.0
margin_right = 580.0
margin_bottom = 46.0
layout_mode = 2
size_flags_vertical = 0
custom_colors/font_color = Color( 1, 0.501961, 0.376471, 1 )
autowrap = true
theme_override_colors/font_color = Color(0.772549, 0, 0, 1)
theme_override_fonts/font = ExtResource("4_hv1ml")
clip_text = true

[node name="RichTextLabel" type="RichTextLabel" parent="HSplitContainer/OutputPanel"]
margin_left = 32.0
margin_top = 24.0
margin_right = 580.0
margin_bottom = 696.0
layout_mode = 2
focus_mode = 2
custom_colors/selection_color = Color( 0, 0.666667, 1, 0.376471 )
custom_fonts/normal_font = ExtResource( 1 )
scroll_following = true
selection_enabled = true

[node name="EngineVersion" type="Label" parent="."]
modulate = Color( 1, 1, 1, 0.501961 )
modulate = Color(1, 1, 1, 0.501961)
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
margin_left = -208.0
margin_top = 20.0
margin_right = -20.0
margin_bottom = 42.0
align = 2
__meta__ = {
"_edit_use_anchors_": false
}
offset_left = -132.0
offset_top = 9.0
offset_right = -15.0
offset_bottom = 46.0
grow_horizontal = 0
metadata/_edit_layout_mode = 1

[connection signal="text_changed" from="HSplitContainer/VBoxContainer/ScriptEditor" to="HSplitContainer/VBoxContainer/ScriptEditor" method="_on_ScriptEditor_text_changed"]
[connection signal="pressed" from="HSplitContainer/VBoxContainer/ScriptEditor/RunButton" to="HSplitContainer/VBoxContainer/ScriptEditor" method="_run_button_pressed"]
Expand Down
7 changes: 4 additions & 3 deletions main_window.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See `LICENSE.md` included in the source distribution for details.
extends Control

onready var engine_version_label := $EngineVersion as Label
@onready var engine_version_label := $EngineVersion as Label


func _ready() -> void:
Expand All @@ -15,5 +15,6 @@ func _ready() -> void:

# Upscale everything if the display requires it (crude hiDPI support).
# This prevents UI elements from being too small on hiDPI displays.
if OS.get_screen_dpi() >= 192 and OS.get_screen_size().x >= 2048:
get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_DISABLED, SceneTree.STRETCH_ASPECT_IGNORE, Vector2(), 2)
if DisplayServer.screen_get_dpi() >= 192 and DisplayServer.screen_get_dpi() >= 2048:
get_tree().root.content_scale_mode = Window.CONTENT_SCALE_MODE_DISABLED
get_tree().root.content_scale_factor = 2
Loading

0 comments on commit 91dc238

Please sign in to comment.