diff --git a/src/editor/JulGameEditor/Components/ComponentInputs.jl b/src/editor/JulGameEditor/Components/ComponentInputs.jl index b185071..408805e 100644 --- a/src/editor/JulGameEditor/Components/ComponentInputs.jl +++ b/src/editor/JulGameEditor/Components/ComponentInputs.jl @@ -398,7 +398,7 @@ function show_textbox_fields(textbox) end end -function show_screenbutton_fields(screenButton) +function show_screenbutton_fields1(screenButton) for field in fieldnames(typeof(screenButton)) fieldString = "$(field)" diff --git a/src/editor/JulGameEditor/Components/ScreenButtonFields.jl b/src/editor/JulGameEditor/Components/ScreenButtonFields.jl index d20aa52..45b030f 100644 --- a/src/editor/JulGameEditor/Components/ScreenButtonFields.jl +++ b/src/editor/JulGameEditor/Components/ScreenButtonFields.jl @@ -1,5 +1,5 @@ function show_screenbutton_fields(selectedScreenButton, screenButtonField) - fieldName = getFieldName(screenButtonField) + fieldName = getFieldName1(screenButtonField) unusedFields = ["alpha","clickEvents", "currentTexture", "buttonDownSprite", "buttonDownSpritePath", "buttonDownTexture", "buttonUpSprite", "buttonUpSpritePath", "buttonUpTexture", "fontPath", "isInitialized", "mouseOverSprite", "textTexture"] # TODO: push!(unusedFields, "text") @@ -67,6 +67,6 @@ function show_screenbutton_fields(selectedScreenButton, screenButtonField) end end -function getFieldName(field) +function getFieldName1(field) return "$(field)" end \ No newline at end of file diff --git a/src/editor/JulGameEditor/Editor.jl b/src/editor/JulGameEditor/Editor.jl index 28b98df..56d481d 100644 --- a/src/editor/JulGameEditor/Editor.jl +++ b/src/editor/JulGameEditor/Editor.jl @@ -62,6 +62,9 @@ module Editor duplicationMode = false + startTime = Ref(UInt64(0)) + lastPhysicsTime = Ref(UInt64(SDL2.SDL_GetTicks())) + try while !quit try @@ -297,7 +300,7 @@ module Editor if contains("$(typeof(currentSceneMain.scene.uiElements[uiElementIndex]))", "TextBox") show_textbox_fields(currentSceneMain.scene.uiElements[uiElementIndex]) else - show_screenbutton_fields(currentSceneMain.scene.uiElements[uiElementIndex]) + show_screenbutton_fields1(currentSceneMain.scene.uiElements[uiElementIndex]) end # CImGui.Separator() @@ -324,7 +327,7 @@ module Editor SDL2.SDL_SetRenderTarget(renderer, sceneTexture) SDL2.SDL_RenderClear(renderer) - gameInfo = currentSceneMain === nothing ? [] : JulGame.MainLoop.game_loop(currentSceneMain, Ref(UInt64(0)), Ref(UInt64(0)), true, Math.Vector2(sceneWindowPos.x + 8, sceneWindowPos.y + 25), Math.Vector2(sceneWindowSize.x, sceneWindowSize.y)) # Magic numbers for the border of the imgui window. TODO: Make this dynamic if possible + gameInfo = currentSceneMain === nothing ? [] : JulGame.MainLoop.game_loop(currentSceneMain, startTime, lastPhysicsTime, true, Math.Vector2(sceneWindowPos.x + 8, sceneWindowPos.y + 25), Math.Vector2(sceneWindowSize.x, sceneWindowSize.y)) # Magic numbers for the border of the imgui window. TODO: Make this dynamic if possible SDL2.SDL_SetRenderTarget(renderer, C_NULL) SDL2.SDL_RenderClear(renderer) diff --git a/src/editor/JulGameEditor/Project.toml b/src/editor/JulGameEditor/Project.toml index eca6dcc..875e50e 100644 --- a/src/editor/JulGameEditor/Project.toml +++ b/src/editor/JulGameEditor/Project.toml @@ -5,14 +5,17 @@ repo = "https://github.com/Kyjor/JulGame.jl.git" version = "0.1.0" [deps] +JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" SimpleDirectMediaLayer = "98e33af6-2ee5-5afd-9e75-cbc738b767c4" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" CImGui = "5d785b6c-b76f-510e-a07c-3070796c7e87" -JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" -JulGame = "4850f9bb-d191-4a1e-9f97-ee64062927c3" NativeFileDialog = "e1fe445b-aa65-4df4-81c1-2041507f0fd4" +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" +UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" +JulGame = "4850f9bb-d191-4a1e-9f97-ee64062927c3" [compat] -CImGui = "~2.0" JSON3 = "1" SimpleDirectMediaLayer = "0.5" +CImGui = "~2.0" julia = "1.9" \ No newline at end of file