Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyjor committed Aug 24, 2024
1 parent aebf4af commit d9ec8a5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/editor/JulGameEditor/Components/ComponentInputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

Expand Down
4 changes: 2 additions & 2 deletions src/editor/JulGameEditor/Components/ScreenButtonFields.jl
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -67,6 +67,6 @@ function show_screenbutton_fields(selectedScreenButton, screenButtonField)
end
end

function getFieldName(field)
function getFieldName1(field)
return "$(field)"
end
7 changes: 5 additions & 2 deletions src/editor/JulGameEditor/Editor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ module Editor

duplicationMode = false

startTime = Ref(UInt64(0))
lastPhysicsTime = Ref(UInt64(SDL2.SDL_GetTicks()))

try
while !quit
try
Expand Down Expand Up @@ -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()
Expand All @@ -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)

Expand Down
9 changes: 6 additions & 3 deletions src/editor/JulGameEditor/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit d9ec8a5

Please sign in to comment.