Set up xdg thing, now for the loader modification nyaa ^.^

This commit is contained in:
sapient_cogbag 2020-04-11 03:13:35 +01:00
parent 89c125a4a9
commit 1593c5c12b
No known key found for this signature in database
GPG key ID: 9DA0A435732D7C4A
3 changed files with 77 additions and 2 deletions

View file

@ -2,6 +2,7 @@ extends GridContainer
const palette_button = preload("res://Prefabs/PaletteButton.tscn")
var palettes_path := "Palettes"
var current_palette = "Default"
var from_palette : Palette
@ -154,9 +155,16 @@ func on_color_select(index : int) -> void:
Global.update_right_custom_brush()
func _load_palettes() -> void:
# These are the paths for looking for palettes.
# The user path for palettes.
# this directory is created if it does not exist.
var user_palette_directory := Global.directory_module.get_palette_write_path()
palettes_path = Global.root_directory.plus_file("Palettes")
var dir := Directory.new()
dir.open(Global.root_directory)
if not dir.dir_exists(palettes_path):
dir.make_dir(palettes_path)
@ -194,6 +202,7 @@ func get_palette_files(path : String) -> Array:
func save_palette(palette_name : String, filename : String) -> void:
var palette = Global.palettes[palette_name]
var palettes_write_path:= Global.directory_module.get_palette_write_path()
palette.save_to_file(palettes_path.plus_file(filename))