Skip to content

Commit

Permalink
Fixed a couple of bugs with editor. Still not working correctly, but …
Browse files Browse the repository at this point in the history
…is atleast runnable.
  • Loading branch information
fLindahl committed Jan 23, 2024
1 parent 92d12dc commit 3e2538d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
13 changes: 6 additions & 7 deletions toolkit/editor/editor/ui/windows/outline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,7 @@ Outline::Run()
// @todo: The order of the entites is arbitrary. We should allow the user to move and sort the entities as they like.
ImGui::BeginChild("ScrollingRegion", ImVec2(0, -ImGui::GetFrameHeightWithSpacing()), false, ImGuiWindowFlags_HorizontalScrollbar);
{
Game::FilterBuilder::FilterCreateInfo filterInfo;
filterInfo.inclusive[0] = Game::GetComponentId("Owner"_atm);
filterInfo.access [0] = Game::AccessMode::READ;
filterInfo.numInclusive = 1;

Game::Filter filter = Game::FilterBuilder::CreateFilter(filterInfo);
Game::Filter filter = Game::FilterBuilder::FilterBuilder().Including<Game::Entity>().Build();
Game::Dataset data = state.editorWorld->Query(filter);

bool contextMenuOpened = false;
Expand Down Expand Up @@ -149,7 +144,11 @@ Outline::Run()
ImGui::SetCursorPosX(xPos);
ImGui::TextDisabled("|-");
ImGui::SameLine();
ImGui::Image(&UIManager::Icons::game, {20,20});

// TODO: make this work again
//ImGui::Image(&UIManager::Icons::game, {20,20});
ImGui::Text(" "); // hack: this just replaces the image until that works again

ImGui::SameLine();
ImGui::SetCursorPosY(yPos + 3);
ImGui::Text(edit.name.AsCharPtr());
Expand Down
12 changes: 9 additions & 3 deletions toolkit/editor/editor/ui/windows/toolbar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,17 @@ Toolbar::Run()

IMGUI_VERTICAL_SEPARATOR;

if (ImGui::ImageButton("playimage", &UIManager::Icons::play, buttonSize, {0,0}, {1,1})) { PlayGame(); }
//if (ImGui::ImageButton("playimage", &UIManager::Icons::play, buttonSize, {0,0}, {1,1})) { PlayGame(); }
//ImGui::SameLine();
//if (ImGui::ImageButton("pauseimage", &UIManager::Icons::pause, buttonSize, {0,0}, {1,1})) { PauseGame(); }
//ImGui::SameLine();
//if (ImGui::ImageButton("stopimage", &UIManager::Icons::stop, buttonSize, {0,0}, {1,1})) { StopGame(); }

if (ImGui::Button("Play")) { PlayGame(); }
ImGui::SameLine();
if (ImGui::ImageButton("pauseimage", &UIManager::Icons::pause, buttonSize, {0,0}, {1,1})) { PauseGame(); }
if (ImGui::Button("Pause")) { PauseGame(); }
ImGui::SameLine();
if (ImGui::ImageButton("stopimage", &UIManager::Icons::stop, buttonSize, {0,0}, {1,1})) { StopGame(); }
if (ImGui::Button("Stop")) { StopGame(); }
}

} // namespace Presentation

0 comments on commit 3e2538d

Please sign in to comment.