mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 09:09:47 +00:00
New theme-related methods to ExtensionsAPI (#733)
* hide accidentally visible dialog * added new theme methods * Wait for themes to add from api * remove `find_theme` * revert last commit * Formatting * Some code changes * update to godot 3.5
This commit is contained in:
parent
afe5a90722
commit
8a6e393d69
|
@ -62,7 +62,7 @@ You can find Online Documentation for Pixelorama here: https://orama-interactive
|
|||
It's still work in progress so there are some pages missing. If you want to contribute, you can do so in [Pixelorama-Docs' GitHub Repository](https://github.com/Orama-Interactive/Pixelorama-Docs).
|
||||
|
||||
## Cloning Instructions
|
||||
Pixelorama uses Godot 3.4, so you will need to have it in order to run the project. Older versions may not work.
|
||||
Pixelorama uses Godot 3.5, so you will need to have it in order to run the project. Older versions may not work.
|
||||
As of right now, most of the code is written using GDScript, so the mono version of Godot is not required, but Pixelorama should also work with it.
|
||||
|
||||
## Current features:
|
||||
|
|
|
@ -192,9 +192,23 @@ func add_theme(theme: Theme) -> void:
|
|||
themes.add_theme(theme)
|
||||
|
||||
|
||||
func find_theme_index(theme: Theme) -> int:
|
||||
var themes: BoxContainer = Global.preferences_dialog.find_node("Themes")
|
||||
return themes.themes.find(theme)
|
||||
|
||||
|
||||
func get_theme() -> Theme:
|
||||
return Global.control.theme
|
||||
|
||||
|
||||
func set_theme(idx: int) -> bool:
|
||||
var themes: BoxContainer = Global.preferences_dialog.find_node("Themes")
|
||||
if idx >= 0 and idx < themes.themes.size():
|
||||
themes.buttons_container.get_child(idx).emit_signal("pressed")
|
||||
return true
|
||||
else:
|
||||
return false
|
||||
|
||||
|
||||
func remove_theme(theme: Theme) -> void:
|
||||
Global.preferences_dialog.themes.remove_theme(theme)
|
||||
|
|
|
@ -20,6 +20,7 @@ onready var theme_color_preview_scene = preload("res://src/Preferences/ThemeColo
|
|||
func _ready() -> void:
|
||||
for theme in themes:
|
||||
add_theme(theme)
|
||||
yield(get_tree(), "idle_frame")
|
||||
|
||||
var theme_id: int = Global.config_cache.get_value("preferences", "theme", 0)
|
||||
if theme_id >= themes.size():
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
blend_mode = 4
|
||||
|
||||
[node name="TileModeOffsetsDialog" type="ConfirmationDialog"]
|
||||
visible = true
|
||||
margin_right = 301.0
|
||||
margin_bottom = 422.0
|
||||
rect_min_size = Vector2( 172, 422 )
|
||||
|
|
Loading…
Reference in a new issue