diff --git a/src/engine/SceneManagement/SceneBuilder.jl b/src/engine/SceneManagement/SceneBuilder.jl index 29a6a43..17ae4a8 100644 --- a/src/engine/SceneManagement/SceneBuilder.jl +++ b/src/engine/SceneManagement/SceneBuilder.jl @@ -246,22 +246,18 @@ module SceneBuilderModule constructor = Base.invokelatest(getfield, module_name, Symbol(script.name)) newScript = Base.invokelatest(constructor) scriptFields = get(script, "fields", Dict()) - + @debug("getting fields for: $(script)") for (key, value) in scriptFields ftype = nothing try ftype = fieldtype(typeof(newScript), Symbol(key)) - if ftype == Float64 - value = Float64(value) - elseif ftype == Int32 - value = Int32(value) - elseif ftype == Int64 - value = Int64(value) - elseif ftype == EditorExport + @debug("type: $(ftype)") + if ftype <: EditorExport + @debug "Overwriting $(key) to $(value) using scene file" Base.invokelatest(setfield!, newScript, key, EditorExport(value)) - @info "Overwriting $(key) to $(value) using scene file" continue elseif value === nothing + @debug "Value is nothing" continue end catch e diff --git a/src/engine/UI/ScreenButton.jl b/src/engine/UI/ScreenButton.jl index a9ab81a..0a367ec 100644 --- a/src/engine/UI/ScreenButton.jl +++ b/src/engine/UI/ScreenButton.jl @@ -16,6 +16,7 @@ module ScreenButtonModule buttonUpSpritePath::String buttonUpTexture fontPath::Union{String, Ptr{Nothing}} + isActive::Bool isHovered::Bool isInitialized::Bool mouseOverSprite @@ -48,6 +49,7 @@ module ScreenButtonModule this.isInitialized = false this.persistentBetweenScenes = false this.isHovered = false + this.isActive = true return this end @@ -58,6 +60,10 @@ module ScreenButtonModule UI.initialize(this) end + if !this.isActive + return + end + if !this.mouseOverSprite && this.currentTexture == this.buttonDownTexture #TODO: this.currentTexture = this.buttonUpTexture end