Skip to content

Commit 564535a

Browse files
committed
notices
1 parent 3b43301 commit 564535a

13 files changed

Lines changed: 370 additions & 25 deletions

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,19 @@ GriddyCode allows you to extend its functionality via **Lua**.
3636

3737
## Where?
3838
To open the folder with Lua scripts, go to:
39+
<<<<<<< Updated upstream
3940
- Windows: `%APPDATA%\Godot\app_userdata\Bussin GriddyCode`
4041
- macOS: `~/Library/Application Support/Bussin GriddyCode`
4142
- Linux: `~/.local/share/godot/app_userdata/Bussin GriddyCode`
4243

4344
*Note: the paths are not accurate, we recommend you manually search for GriddyCode in the AppData of your OS.*
45+
=======
46+
- Windows: `%APPDATA%\Bussin GriddyCode`
47+
- macOS: `~/Library/Application Support/Bussin GriddyCode`
48+
- Linux: `~/.local/share/Bussin GriddyCode`
49+
50+
*Note: since the paths might change, we recommend you manually search for GriddyCode in the AppData of your OS.*
51+
>>>>>>> Stashed changes
4452
4553
## How?
4654
You may see the folders **"langs"** and **"themes"**.
@@ -64,7 +72,11 @@ To extend the functionality of GriddyCode for a specific **file extension**, cre
6472
| `detect_functions(content: String) -> Array[String]` | `detect_functions("const test = 3; function main() {}; async init() => { main() }")` | Called by GriddyCode upon input. Results are showed in the autocomplete feature. | This must be provided by the Lua script. It must return an array of strings (i.e. ["main", "init"]). |
6573
| `detect_variables(content: String) -> Array[String]` | `detect_variables("const test = 3;")` | Called by GriddyCode upon input. Results are showed in the autocomplete feature. | This must be provided by the Lua script. It must return an array of strings (i.e. ["test"]). |
6674

75+
<<<<<<< Updated upstream
6776
*Note: to provide reserved variables/functions (i.e. `Math`/`parseInt()` in JS) you can have them already set up in the array you return. GriddyCode will handle the rest!*
77+
=======
78+
*Note: to provide reserved variables/functions (i.e. `Math`/`parseInt()` in JS) you can have them as preset values in the array you return. GriddyCode will handle the rest!*
79+
>>>>>>> Stashed changes
6880
### Themes
6981
#### Introduction
7082
To add a theme, create a file in the **"themes"** folder with any name. (i.e. "dracula.lua"). You will be able to choose it within GriddyCode.
@@ -76,14 +88,22 @@ To add a theme, create a file in the **"themes"** folder with any name. (i.e. "d
7688
| `set_gui(property: String, new_color: String)` | `set_gui("background_color", "#ff00ff")` | This method is dedicated to the overall GUI aspect of GriddyCode. | Available properties: `background_color`, `current_line_color`, `selection_color`, `font_color`, `word_highlighted_color`, `selection_background_color`. Properties except `background_color`, if not provided, will be set to a slightly modified version of `background_color`. Although possible, we don't recommend you rely on those & instead set all the values. |
7789

7890
*Note: if the HEX you input is invalid, it will default to #ff0000 (red)*
91+
<<<<<<< Updated upstream
7992
## Publishing
8093
If you want to use a theme/plugin for **yourself**, you can put it into your [AppData](#where).
8194

8295
If you want to **submit** a theme/plugin, open a pull request adding it to `Lua/Plugins` or `Lua/Themes` respectively. If merged, it will be included in the next build.
96+
=======
97+
98+
# Known issues
99+
## Visual bugs
100+
- The `CheckButton` node for each `setting` scene doesn't change with the theme. This affects light themes specifically.
101+
>>>>>>> Stashed changes
83102
84103
# Contributions
85104
Contributions are heavily appreciated, whether it's for adding Lua plugins, themes, safely exposing more features to Lua, or adding features directly to GriddyCode!
86105

106+
<<<<<<< Updated upstream
87107
## Notice
88108
- You will need to install the [Godot Engine](https://godotengine.org/) to run your proposed change & make sure it runs flawlessly.
89109
- You don't have to submit executables.
@@ -103,3 +123,13 @@ Contributions are heavily appreciated, whether it's for adding Lua plugins, them
103123
- `CTRL` + `P` to open a **quick file picker**, similar to [VSCode](https://code.visualstudio.com/docs/editor/editingevolved#:~:text=Quick%20file%20navigation,-Tip%3A%20You%20can&text=VS%20Code%20provides%20two%20powerful,release%20Ctrl%20to%20open%20it.).
104124
- Selecting a setting with the property "shader" *should* disable previously-enabled settings with "shader".
105125
- The `CheckButton` node for each `setting` scene doesn't change with the theme. This affects light themes specifically.
126+
=======
127+
Stuff we are currently looking for: (this doesn't mean you can't contribute with other stuff!)
128+
- `CTRL` + `P` to open a **quick file picker**, similar to [VSCode](https://code.visualstudio.com/docs/editor/editingevolved#:~:text=Quick%20file%20navigation,-Tip%3A%20You%20can&text=VS%20Code%20provides%20two%20powerful,release%20Ctrl%20to%20open%20it.)
129+
- An option in the settings menu (`CTRL` + `,`) to change the font!
130+
- Making the cat jumping video in the settings menu fade in/out along the actual menu. Currently it ignores the transition
131+
- Heavy cleanup of `settings.gd`!
132+
- The file picker (`CTRL` + `O`) stores the position of the selected item even after entering/exiting a directory. However, if the directory's file size is lower than it, it will disappear until you move it up. This can be fixed by setting its selected item to the last item if it exceeds dirs.size()
133+
134+
Please note that creating a Pull Request to fix these features does *not* guarantee its merge. Please don't open a Pull Request unless you are confident you've done a good job.
135+
>>>>>>> Stashed changes

Scenes/comment.tscn

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
[gd_scene load_steps=6 format=3 uid="uid://bp8qdakc47pva"]
1+
[gd_scene load_steps=5 format=3 uid="uid://bp8qdakc47pva"]
22

33
[ext_resource type="Shader" path="res://Shaders/circle_mask.gdshader" id="1_1jr08"]
44
[ext_resource type="Script" path="res://Scripts/comment.gd" id="1_b8ga8"]
55
[ext_resource type="Texture2D" uid="uid://dqsmye2lux7vl" path="res://Icons/Comments/quincetart10.png" id="3_gt38f"]
6-
[ext_resource type="FontFile" uid="uid://d1v66naqhhggj" path="res://Fonts/FiraCode-Regular.ttf" id="3_r26eh"]
76

87
[sub_resource type="ShaderMaterial" id="ShaderMaterial_gok1n"]
98
shader = ExtResource("1_1jr08")
@@ -31,7 +30,6 @@ offset_left = 212.245
3130
offset_top = 18.295
3231
offset_right = 1112.24
3332
offset_bottom = 918.295
34-
theme_override_fonts/normal_font = ExtResource("3_r26eh")
3533
theme_override_font_sizes/normal_font_size = 41
3634
bbcode_enabled = true
3735
text = "kgpoakgp3 3d"
@@ -43,9 +41,8 @@ offset_top = 85.0
4341
offset_right = 5682.0
4442
offset_bottom = 7405.0
4543
scale = Vector2(0.075, 0.075)
46-
theme_override_fonts/normal_font = ExtResource("3_r26eh")
4744
theme_override_font_sizes/normal_font_size = 300
4845
bbcode_enabled = true
4946
text = "This is a placeholder. If you are seeing this:
5047
1. Your extension does not provide comments.
51-
2. GriddyCode failed to properly load."
48+
2. GriddyCode failed to properly load. 🔥"

Scenes/editor.tscn

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
[gd_scene load_steps=21 format=3 uid="uid://bj6s526sep4xw"]
1+
[gd_scene load_steps=20 format=3 uid="uid://bj6s526sep4xw"]
22

3-
[ext_resource type="FontFile" uid="uid://drrhlpxmc4pq4" path="res://Fonts/FiraCode-VariableFont_wght.ttf" id="1_cd7xi"]
43
[ext_resource type="Script" path="res://Scripts/file_manager.gd" id="1_x00ag"]
54
[ext_resource type="Script" path="res://Scripts/settings.gd" id="2_7x3ll"]
6-
[ext_resource type="FontFile" uid="uid://d1v66naqhhggj" path="res://Fonts/FiraCode-Regular.ttf" id="2_wpuu1"]
5+
[ext_resource type="Theme" uid="uid://daiset8sjhqyc" path="res://theme.tres" id="2_bh428"]
76
[ext_resource type="PackedScene" uid="uid://dk43uvvc3j228" path="res://Scenes/settings_list.tscn" id="5_6usn0"]
87
[ext_resource type="Script" path="res://Scripts/file_dialog.gd" id="5_bhd70"]
98
[ext_resource type="PackedScene" uid="uid://c2gyvklbna1ss" path="res://Scenes/theme_chooser.tscn" id="6_10xx2"]
@@ -54,10 +53,10 @@ color = Color(0, 0, 0, 1)
5453
unique_name_in_owner = true
5554
offset_right = 2044.0
5655
offset_bottom = 44630.0
56+
theme = ExtResource("2_bh428")
5757
theme_override_colors/background_color = Color(0, 0, 0, 1)
5858
theme_override_colors/current_line_color = Color(0.168627, 0.168627, 0.168627, 1)
5959
theme_override_colors/caret_color = Color(0.321569, 0.545098, 1, 1)
60-
theme_override_fonts/font = ExtResource("2_wpuu1")
6160
theme_override_font_sizes/font_size = 0
6261
text = "function getRandomColor() {
6362
const letters = '0123456789ABCDEF';
@@ -118,10 +117,9 @@ anchor_bottom = 1.0
118117
offset_left = -492.0
119118
offset_top = 119.0
120119
offset_right = -30.0
121-
offset_bottom = 749.0
120+
offset_bottom = 8889.0
122121
grow_horizontal = 2
123122
grow_vertical = 0
124-
theme_override_fonts/normal_font = ExtResource("2_wpuu1")
125123
text = "gpake
126124
gka
127125
ekga
@@ -148,7 +146,6 @@ offset_top = 112.0
148146
offset_right = 3336.0
149147
offset_bottom = 2112.0
150148
scale = Vector2(0.235, 0.235)
151-
theme_override_fonts/normal_font = ExtResource("1_cd7xi")
152149
theme_override_font_sizes/normal_font_size = 376
153150
bbcode_enabled = true
154151
text = "Greetings!"
@@ -159,7 +156,6 @@ offset_top = 244.0
159156
offset_right = 3341.0
160157
offset_bottom = 2244.0
161158
scale = Vector2(0.235, 0.235)
162-
theme_override_fonts/normal_font = ExtResource("1_cd7xi")
163159
theme_override_font_sizes/normal_font_size = 146
164160
bbcode_enabled = true
165161
text = "You're currently using [color=#c9daf8]Bussin[/color] [color=#85c6ff]GriddyCode[/color]"
@@ -170,7 +166,6 @@ offset_top = 380.0
170166
offset_right = 3341.0
171167
offset_bottom = 2380.0
172168
scale = Vector2(0.235, 0.235)
173-
theme_override_fonts/normal_font = ExtResource("1_cd7xi")
174169
theme_override_font_sizes/normal_font_size = 106
175170
bbcode_enabled = true
176171
text = "To get started, please choose a file."
@@ -220,7 +215,6 @@ offset_top = 28.0
220215
offset_right = 4821.0
221216
offset_bottom = 1219.0
222217
scale = Vector2(0.235, 0.235)
223-
theme_override_fonts/normal_font = ExtResource("1_cd7xi")
224218
theme_override_font_sizes/normal_font_size = 376
225219
bbcode_enabled = true
226220
text = "[color=#c9daf8]Bussin[/color] [color=#85c6ff]GriddyCode[/color]"
@@ -231,7 +225,6 @@ offset_top = 165.0
231225
offset_right = 6395.0
232226
offset_bottom = 4616.0
233227
scale = Vector2(0.235, 0.235)
234-
theme_override_fonts/normal_font = ExtResource("1_cd7xi")
235228
theme_override_font_sizes/normal_font_size = 121
236229
bbcode_enabled = true
237230
text = "Created by [url=https://youtube.com/facedevstuff][color=#b4a7d6]Face[/color][/url] & the contributors at [url=https://github.com/face-hh/griddycode][color=#b4a7d6]GitHub[/color][/url]
@@ -304,6 +297,10 @@ offset_top = 2.0
304297
offset_right = 772.0
305298
offset_bottom = 2.0
306299

300+
[node name="CanvasLayer" type="CanvasLayer" parent="."]
301+
offset = Vector2(100, 129.5)
302+
transform = Transform2D(1, 0, 0, 1, 100, 129.5)
303+
307304
[connection signal="caret_changed" from="Code" to="Code" method="_on_caret_changed"]
308305
[connection signal="code_completion_requested" from="Code" to="Code" method="_on_code_completion_requested"]
309306
[connection signal="gui_input" from="Code" to="Code" method="_on_gui_input"]

Scenes/notice.tscn

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[gd_scene load_steps=4 format=3 uid="uid://c8njeludg1ajk"]
2+
3+
[ext_resource type="Script" path="res://Scripts/notice.gd" id="1_dlyuf"]
4+
[ext_resource type="Shader" path="res://Shaders/border_radius.gdshader" id="1_m2ntv"]
5+
6+
[sub_resource type="ShaderMaterial" id="ShaderMaterial_in2wo"]
7+
shader = ExtResource("1_m2ntv")
8+
shader_parameter/radius = 1.0
9+
shader_parameter/animate = false
10+
shader_parameter/square_scale = 0.07
11+
12+
[node name="Notice" type="Control"]
13+
layout_mode = 3
14+
anchors_preset = 15
15+
anchor_right = 1.0
16+
anchor_bottom = 1.0
17+
grow_horizontal = 2
18+
grow_vertical = 2
19+
script = ExtResource("1_dlyuf")
20+
21+
[node name="ColorRect" type="ColorRect" parent="."]
22+
material = SubResource("ShaderMaterial_in2wo")
23+
layout_mode = 0
24+
offset_right = 487.0
25+
offset_bottom = 88.0
26+
color = Color(0.101961, 0.101961, 0.101961, 1)
27+
28+
[node name="RichTextLabel" type="RichTextLabel" parent="."]
29+
layout_mode = 0
30+
offset_left = 9.0
31+
offset_top = 10.0
32+
offset_right = 491.0
33+
offset_bottom = 124.0
34+
bbcode_enabled = true
35+
text = "[color=yellow]WARNING[/color]: This file isn’t supported. Highlighting, autocomplete and comments won’t work properly."

Scenes/setting.tscn

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
[gd_scene load_steps=4 format=3 uid="uid://cshkyynl6dffr"]
2-
3-
[ext_resource type="FontFile" uid="uid://d1v66naqhhggj" path="res://Fonts/FiraCode-Regular.ttf" id="1_t6bjo"]
1+
[gd_scene load_steps=3 format=3 uid="uid://cshkyynl6dffr"]
42

53
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_wffyp"]
64

@@ -19,7 +17,6 @@ offset_top = 3.0
1917
offset_right = 1315.0
2018
offset_bottom = 131.0
2119
scale = Vector2(0.235, 0.235)
22-
theme_override_fonts/normal_font = ExtResource("1_t6bjo")
2320
theme_override_font_sizes/normal_font_size = 66
2421
bbcode_enabled = true
2522
text = "Scroll Speed"

Scripts/file_dialog.gd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ var files: Array[String]
1313
var zoom: Vector2;
1414

1515
var active: bool = false;
16-
1716
signal ui_close
1817

1918
func change_dir(path) -> void:
@@ -31,7 +30,7 @@ func change_dir(path) -> void:
3130
%Cam.focus_on(gp(), zoom)
3231

3332
func setup() -> void:
34-
active = false
33+
active = true
3534
change_dir(editor.current_dir)
3635

3736
update_ui()

Scripts/file_manager.gd

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ extends Node2D
33

44
@onready var Code: CodeEdit = %Code;
55
@onready var file_dialog = %FileDialog
6+
@onready var canvas_layer: CanvasLayer = $CanvasLayer
7+
const NOTICE = preload("res://Scenes/notice.tscn")
68

79
var current_file: String;
810
var current_dir: String = "/";
911

1012
func _ready():
1113
if (OS.get_name() == "Windows"):
1214
current_dir = "C:/"
13-
print(current_dir)
15+
1416
inject_lua()
1517
check_for_reserved()
1618

@@ -27,6 +29,7 @@ func _ready():
2729
if !current_file:
2830
Code.toggle(%FileDialog)
2931
%Intro.show()
32+
warn("Welcome to [color=#c9daf8]Bussin[/color] [color=#85c6ff]GriddyCode[/color]! Please select a file, then press CTRL + I to get started! :D")
3033

3134
func check_for_reserved() -> void:
3235
var folders = ["langs", "themes"]
@@ -61,6 +64,17 @@ func copy_if_not_exist(user_path: String, res_path: String, file: String) -> voi
6164
if !exists:
6265
DirAccess.copy_absolute(current_path, path)
6366

67+
func warn(notice: String) -> void:
68+
var node = NOTICE.instantiate()
69+
70+
canvas_layer.add_child(node)
71+
72+
node.set_notice(notice)
73+
74+
get_tree().create_timer(3).timeout.connect(func():
75+
node.queue_free()
76+
)
77+
6478
func open_file(path: String) -> void:
6579
var src = Fs._load(path)
6680

@@ -136,6 +150,8 @@ func load_game():
136150
LuaSingleton.settings.remove_at(index)
137151
LuaSingleton.settings.append(dic);
138152

153+
LuaSingleton.settings = node_data["settings"]
154+
139155
LuaSingleton.on_settings_change.emit()
140156

141157
func _on_auto_save_timer_timeout():

Scripts/lua_singleton.gd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ var comments: Array = []
197197
const SUNLIGHT = preload("res://Shaders/sunlight.gdshader")
198198
const VHS_AND_CRT = preload("res://Shaders/vhs_and_crt.gdshader")
199199

200+
@onready var editor: FileManager = $/root/Editor;
200201
@onready var code: CodeEdit = $/root/Editor/Code;
201202
@onready var world_environment: WorldEnvironment = $/root/Editor/WorldEnvironment
202203
@onready var shader_layer: ColorRect = $/root/Editor/ShaderLayer
@@ -339,6 +340,7 @@ func setup_extension(extension):
339340

340341
var err: LuaError = lua.do_file("user://langs/" + extension + ".lua")
341342
if err is LuaError:
343+
editor.warn("[color=yellow]WARNING[/color]: This file isn’t supported. Highlighting, autocomplete, comments and other features won’t work properly.")
342344
print("ERROR %d: %s" % [err.type, err.message])
343345
return
344346

@@ -352,6 +354,8 @@ func setup_theme(given_theme: String) -> void:
352354

353355
var theme_err: LuaError = theme_lua.do_file("user://themes/" + given_theme + ".lua")
354356
if theme_err is LuaError:
357+
editor.warn("[color=yellow]WARNING[/color]: Failed to load theme: " + theme_err.message)
358+
355359
print("ERROR %d: %s" % [theme_err.type, theme_err.message])
356360
return
357361

Scripts/notice.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extends Control
2+
@onready var rich_text_label: RichTextLabel = $RichTextLabel
3+
4+
func set_notice(notice: String) -> void:
5+
rich_text_label.text = notice

0 commit comments

Comments
 (0)