Skip to content

Commit

Permalink
added stuff related to the active palette
Browse files Browse the repository at this point in the history
  • Loading branch information
roby2014 committed Oct 15, 2023
1 parent c314425 commit 40fa299
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions engine/src/cubos/engine/tools/voxel_palette_editor/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ static void checkAssetEventSystem(EventReader<AssetSelectedEvent> reader, Write<
savePaletteUiGuard(assets, selectedPalette);
}

static void voxelPaletteEditorSystem(Write<Assets> assets, Write<Renderer> renderer,
Write<SelectedPaletteInfo> selectedPalette)
static void voxelPaletteEditorSystem(Write<Assets> assets, Write<Renderer>, Write<SelectedPaletteInfo> selectedPalette,
Write<ActiveVoxelPalette> activePalette)
{
if (assets->status(selectedPalette->asset) != Assets::Status::Loaded)
{
Expand Down Expand Up @@ -149,8 +149,7 @@ static void voxelPaletteEditorSystem(Write<Assets> assets, Write<Renderer> rende

if (ImGui::Button("Make Active"))
{
(*renderer)->setPalette(selectedPalette->paletteCopy);
ImGui::TextColored({0, 255, 0, 255}, "This is your current active palette!");
activePalette->asset = selectedPalette->asset;
}

ImGui::SameLine();
Expand All @@ -162,6 +161,13 @@ static void voxelPaletteEditorSystem(Write<Assets> assets, Write<Renderer> rende
selectedPalette->modified = false;
}

CUBOS_DEBUG("active = {}", Debug(activePalette->asset));
CUBOS_DEBUG("selected = {}", Debug(selectedPalette->asset));
if (activePalette->asset == selectedPalette->asset) // FIXME: what?
{
ImGui::TextColored({0, 255, 0, 255}, "This is your current active palette!");
}

ImGui::End();
}

Expand Down

0 comments on commit 40fa299

Please sign in to comment.