My first 2D game in Godot 4.4

This commit is contained in:
2025-08-18 19:39:33 -04:00
commit 35600f72f9
83 changed files with 2512 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
# GDQuest ColorPicker Presets
Reads a color presets `gpl` (GIMP Palette) file in the addon local directory, called `presets.gpl`. It adds the colors to the editor ColorPicker for quick access.
This repository includes a `presets.gpl` file as an example. It's the official GDQuest color palette.
## ✗ WARNING
> Compatible: Godot `>= v4.0`
The addon:
1. Doesn't check the length of the color palette/file.
1. Overwrites the _ColorPicker_ presets whenever you reopen the project or re-enable the addon.
## ✓ Install
### Using [Godot Package Manager](https://github.com/godot-package-manager)
1. `gpm init`.
1. Follow instructions with [NPMjs package](https://www.npmjs.com/package/gdquest.colorpicker_presets).
1. Enable the addon from `Project > Project Settings... > Plugins`.
1. Profit.
### Manual
1. Make a new folder at `res://addons/colorpicker_presets/`.
1. Copy the contents of this repository into `res://addons/colorpicker_presets/`.
1. Replace `res://addons/colorpicker_presets/presets.gpl` with your preferred version.
1. Enable the addon from `Project > Project Settings... > Plugins`.
1. Profit.
![install project settings](readme/install_project_settings.png)
## Where do I find the presets?
They'll be available in the editor _ColorPicker_.
![ColorPicker presets](readme/colorpicker_presets.png)

View File

@@ -0,0 +1,26 @@
@tool
extends EditorPlugin
const PRESETS_FILENAME := 'presets.gpl'
func _enter_tree() -> void:
var presets_path: String = get_script().resource_path.get_base_dir().path_join(PRESETS_FILENAME)
var presets_file := FileAccess.open(presets_path, FileAccess.READ)
if FileAccess.get_open_error() == OK:
var presets_raw := presets_file.get_as_text(true).strip_edges().split("\n")
presets_file.close()
presets_raw = presets_raw.slice(presets_raw.find("#") + 1)
var presets := Array(presets_raw).map(
func(s: String):
var rgb := (Array(s.strip_edges().split(" ").slice(0, -1))
.filter(func(s: String): return not s.is_empty())
.map(func(s: String): return s.to_int())
)
return Color8(rgb[0], rgb[1], rgb[2])
)
get_editor_interface().get_editor_settings().set_project_metadata(
"color_picker", "presets", presets
)

View File

@@ -0,0 +1 @@
uid://efuldfeh4dud

View File

@@ -0,0 +1,9 @@
[plugin]
name="GDQuest ColorPicker Presets"
description="Sets the editor color picker presets from
`presets.hex`, if it exists. The file is local to the
addon folder."
author="razcore-rad"
version="0.0.2-beta"
script="colorpicker_presets.gd"

View File

@@ -0,0 +1,31 @@
GIMP Palette
Name: gdquest.gpl
#
0 122 195 Blue
16 178 239 BlueAlt
6 29 84 BlueDark
207 221 255 BlueLight
108 44 218 Purple
141 25 215 PurpleAlt
40 20 78 PurpleDark
235 224 255 PurpleLight
196 29 61 Red
255 65 125 RedAlt/Pink
115 39 92 RedDark
255 219 244 RedLight
255 183 48 Yellow
255 213 0 YellowAlt
222 80 43 YellowDark/Orange
255 236 201 YellowLight
99 204 95 Green
159 221 81 GreenAlt/Lime
21 89 63 GreenDark
221 255 242 GreenLight/Mint
109 61 44 Brown
176 87 55 BrownAlt
106 25 0 BrownDark
255 227 227 BrownLight
202 202 202 Gray
255 255 255 White
39 43 48 Deep
243 248 254 Light

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB