Skip to content

Commit

Permalink
Add tooltips (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyjor authored Oct 18, 2024
1 parent 0f1ff8b commit 314ca7d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/editor/JulGameEditor/Components/CameraWindow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function show_camera_window(this::CameraWindow)
@cstatic begin
#region Scene List
CImGui.Begin("Camera")

show_help_marker("This is where we will display editable properties of the camera. Check the Game tab to see the changes. This is what your game should actually look like when ran in a separate window.")
if this.camera === nothing || !this.open
CImGui.Text("Open a scene to view the camera settings.")
return
Expand Down
10 changes: 8 additions & 2 deletions src/editor/JulGameEditor/Editor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ module Editor
@cstatic begin
#region Scene List
CImGui.Begin("Scene List")
show_help_marker("This is where we will display our scenes. Scenes are where the gameplay happens.")
# txt = currentSceneMain === nothing ? "Load Scene" : "Change Scene"
# CImGui.Text(txt)

Expand Down Expand Up @@ -274,7 +275,8 @@ module Editor
try
#region Hierarchy
CImGui.Begin("Hierarchy")


show_help_marker("This is where we will display a list of entities and textboxes for the scene")
currentSceneMain === nothing && CImGui.Text("No scene loaded.")
if currentSceneMain !== nothing && CImGui.TreeNode("Entities")
# remove other entities from hierarchyEntitySelections if currentSceneMain.selectedEntity is not in hierarchyEntitySelections
Expand Down Expand Up @@ -388,6 +390,8 @@ module Editor
try
#region Entity Inspector
CImGui.Begin("Entity Inspector")

show_help_marker("This is where we will display editable properties of entities")
if currentSceneMain !== nothing && currentSceneMain.selectedEntity !== nothing
CImGui.PushID("AddMenu")
if CImGui.BeginMenu("Add")
Expand Down Expand Up @@ -417,6 +421,7 @@ module Editor

#region UI Inspector
CImGui.Begin("UI Inspector")
show_help_marker("This is where we will display editable properties of textboxes and screen buttons")
for uiElementIndex = eachindex(hierarchyUISelections)
if hierarchyUISelections[uiElementIndex] # || currentSceneMain.selectedEntity == filteredEntities[entityIndex]
if length(currentSceneMain.scene.uiElements) < uiElementIndex
Expand Down Expand Up @@ -460,6 +465,7 @@ module Editor
#region Config Window
try
CImGui.Begin("Project Config")
show_help_marker("This tab contains configuration fields for the game when it is launched separately (command line or executable)")
if currentSelectedProjectPath[] !== ""
show_config_fields(currentProjectConfig, currentSelectedProjectPath)
end
Expand Down Expand Up @@ -703,4 +709,4 @@ module Editor

return (Width=Width, Height=Height, FrameRate=FrameRate, WindowName=WindowName, PixelsPerUnit=PixelsPerUnit, AutoScaleZoom=AutoScaleZoom, IsResizable=IsResizable, Fullscreen=Fullscreen)
end
end # module
end # module
5 changes: 2 additions & 3 deletions src/editor/JulGameEditor/Windows/GameControls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ function show_game_controls()
CImGui.Begin("Controls")
CImGui.Text("Pan scene: Arrow keys/Hold middle mouse button and move mouse")
CImGui.NewLine()
CImGui.Text("Zoom in/out: Hold spacebar and left and right arrow keys")
CImGui.NewLine()
CImGui.Text("Select entity: Click on entity in scene window or in hierarchy window")
CImGui.NewLine()
CImGui.Text("Move entity: Hold left mouse button and drag entity")
CImGui.NewLine()
CImGui.Text("Duplicate entity: Select entity and click 'Duplicate' in hierarchy window or press 'LCTRL+D' keys")
CImGui.NewLine()
CImGui.Text("Duplicate entity brush: Select entity and press 'Shift+LCTRL+D' keys to activate and deactivate")
CImGui.End()
end
end
end
61 changes: 33 additions & 28 deletions src/editor/JulGameEditor/src/imgui.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Collapsed=0

[Window][Hierarchy]
Pos=0,19
Size=475,332
Size=403,332
Collapsed=0
DockId=0x00000006,0

[Window][Debug##Default]
Pos=60,60
Pos=114,63
Size=400,400
Collapsed=0

Expand All @@ -20,14 +20,14 @@ Size=825,481
Collapsed=0

[Window][Debug]
Pos=477,688
Size=371,32
Pos=405,540
Size=393,180
Collapsed=0
DockId=0x00000003,0

[Window][Scene]
Pos=477,19
Size=371,667
Pos=405,19
Size=393,519
Collapsed=0
DockId=0x00000002,0

Expand All @@ -42,14 +42,14 @@ Size=825,1358
Collapsed=0

[Window][Controls]
Pos=477,688
Size=371,32
Pos=405,540
Size=393,180
Collapsed=0
DockId=0x00000003,1

[Window][Dear ImGui Demo]
Pos=850,19
Size=430,451
Pos=800,19
Size=480,451
Collapsed=0
DockId=0x00000001,1

Expand All @@ -71,13 +71,13 @@ DockId=0x00000009,0

[Window][Entity Inspector]
Pos=0,353
Size=475,367
Size=403,367
Collapsed=0
DockId=0x0000000B,1

[Window][UI Inspector]
Pos=0,353
Size=475,367
Size=403,367
Collapsed=0
DockId=0x0000000B,0

Expand All @@ -87,8 +87,8 @@ Size=1280,701
Collapsed=0

[Window][Scene List]
Pos=850,19
Size=430,451
Pos=800,19
Size=480,451
Collapsed=0
DockId=0x00000001,0

Expand Down Expand Up @@ -153,8 +153,8 @@ Collapsed=0
DockId=0x00000002,1

[Window][Game]
Pos=477,19
Size=371,667
Pos=405,19
Size=393,519
Collapsed=0
DockId=0x00000002,1

Expand All @@ -169,14 +169,14 @@ Size=500,114
Collapsed=0

[Window][Camera]
Pos=850,472
Size=430,248
Pos=800,472
Size=480,248
Collapsed=0
DockId=0x0000000C,0

[Window][Project Config]
Pos=850,472
Size=430,248
Pos=800,472
Size=480,248
Collapsed=0
DockId=0x0000000C,1

Expand All @@ -191,6 +191,11 @@ Size=1011,776
Collapsed=0
DockId=0x00000002,2

[Window][Select Project]
Pos=703,448
Size=514,114
Collapsed=0

[Table][0x45A0E60D,7]
RefScale=13
Column 0 Width=49
Expand Down Expand Up @@ -245,16 +250,16 @@ Column 2 Weight=1.0000

[Docking][Data]
DockSpace ID=0x7C6B3D9B Window=0xA87D555D Pos=0,19 Size=1280,701 Split=X
DockNode ID=0x00000007 Parent=0x7C6B3D9B SizeRef=848,828 Split=X
DockNode ID=0x00000004 Parent=0x00000007 SizeRef=475,828 Split=Y Selected=0xC7219E3D
DockNode ID=0x00000007 Parent=0x7C6B3D9B SizeRef=798,828 Split=X
DockNode ID=0x00000004 Parent=0x00000007 SizeRef=403,828 Split=Y Selected=0xC7219E3D
DockNode ID=0x00000006 Parent=0x00000004 SizeRef=316,473 Selected=0x29EABFBD
DockNode ID=0x0000000B Parent=0x00000004 SizeRef=316,523 Selected=0x60AF69E6
DockNode ID=0x00000005 Parent=0x00000007 SizeRef=1651,828 Split=Y
DockNode ID=0x00000002 Parent=0x00000005 SizeRef=1440,776 Selected=0xE192E354
DockNode ID=0x00000003 Parent=0x00000005 SizeRef=1440,214 CentralNode=1 Selected=0x67284010
DockNode ID=0x00000008 Parent=0x7C6B3D9B SizeRef=430,828 Split=Y Selected=0xD04A4B96
DockNode ID=0x00000005 Parent=0x00000007 SizeRef=393,828 Split=Y
DockNode ID=0x00000002 Parent=0x00000005 SizeRef=1440,519 Selected=0x26816F31
DockNode ID=0x00000003 Parent=0x00000005 SizeRef=1440,180 CentralNode=1 Selected=0x67284010
DockNode ID=0x00000008 Parent=0x7C6B3D9B SizeRef=480,828 Split=Y Selected=0xD04A4B96
DockNode ID=0x00000009 Parent=0x00000008 SizeRef=503,414 Selected=0xD04A4B96
DockNode ID=0x0000000A Parent=0x00000008 SizeRef=503,412 Split=Y Selected=0x77FEF510
DockNode ID=0x00000001 Parent=0x0000000A SizeRef=430,451 Selected=0x77FEF510
DockNode ID=0x0000000C Parent=0x0000000A SizeRef=430,248 Selected=0x0545BD69
DockNode ID=0x00000001 Parent=0x0000000A SizeRef=430,451 Selected=0xE87781F4
DockNode ID=0x0000000C Parent=0x0000000A SizeRef=430,248 Selected=0xBC8B194A

4 changes: 2 additions & 2 deletions src/engine/Camera/Camera.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module CameraModule
rgba = (r = Ref(UInt8(0)), g = Ref(UInt8(0)), b = Ref(UInt8(0)), a = Ref(UInt8(255)))
SDL2.SDL_GetRenderDrawColor(JulGame.Renderer::Ptr{SDL2.SDL_Renderer}, rgba.r, rgba.g, rgba.b, rgba.a)
SDL2.SDL_SetRenderDrawColor(Renderer, this.backgroundColor[1], this.backgroundColor[2], this.backgroundColor[3], this.backgroundColor[4]);
#SDL2.SDL_RenderFillRectF(Renderer, Ref(SDL2.SDL_FRect(this.windowPos.x, this.windowPos.y, this.size.x, this.size.y)))
SDL2.SDL_RenderFillRectF(Renderer, Ref(SDL2.SDL_FRect(this.windowPos.x, this.windowPos.y, this.size.x, this.size.y)))
SDL2.SDL_SetRenderDrawColor(JulGame.Renderer::Ptr{SDL2.SDL_Renderer}, rgba.r[], rgba.g[], rgba.b[], rgba.a[]);

center = Vector2f(this.size.x/SCALE_UNITS/2, this.size.y/SCALE_UNITS/2)
Expand All @@ -51,4 +51,4 @@ module CameraModule
end
this.position = newPosition
end
end
end

0 comments on commit 314ca7d

Please sign in to comment.