Skip to content

Commit

Permalink
Added a transfert-all button to atomic compressor gui.
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackvoxel committed Aug 5, 2021
1 parent 6522307 commit 6409c94
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
Binary file modified gui/gui_tiles_1_3.bmp
Binary file not shown.
32 changes: 31 additions & 1 deletion src/ZGameWindow_Storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ void ZGameWindow_Storage::Show()
MainWindow->AddFrame(&MainTitle);
Rp.y += Size.y + 20.0f;

// Transfert button

Size.x = 32.0f; Size.y = 32.0f;
Arrow_Transfert.SetPosition( 670.0f , Rp.y-20.0);
Arrow_Transfert.SetTileSet(GameEnv->GuiTileset);
Arrow_Transfert.SetTile(12);
Arrow_Transfert.SetSize(Size.x, Size.y);

MainWindow->AddFrame(&Arrow_Transfert);

// Tools Title

StorageTitle.SetStyle(GameEnv->TileSetStyles->GetStyle(ZGame::FONTSIZE_1));
Expand Down Expand Up @@ -123,7 +133,6 @@ void ZGameWindow_Storage::Show()
MainWindow->AddFrame(&InventoryTitle);
Rp.y += Size.y + 5.0f;


// Inventory

for (y=0;y<4;y++)
Expand Down Expand Up @@ -173,5 +182,26 @@ Bool ZGameWindow_Storage::MouseButtonClick(UShort nButton, Short Absolute_x, Sho
Hide();
}

if (Arrow_Transfert.Is_MouseClick(true))
{
ULong i;
ZActor * Actor = GameEnv->PhysicEngine->GetSelectedActor();
if (Actor)
{
for (i=0;i<ZVoxelExtension_Storage::Storage_NumSlots;i++)
{
if (VoxelExtension_Storage->VoxelType[i]!=0 && VoxelExtension_Storage->VoxelQuantity[i]>0)
{
if (Actor->Inventory->StoreBlocks(VoxelExtension_Storage->VoxelType[i],VoxelExtension_Storage->VoxelQuantity[i]))
{
VoxelExtension_Storage->VoxelType[i] = 0;
VoxelExtension_Storage->VoxelQuantity[i] = 0;
}
}
}
}

}

return (Res);
}
1 change: 1 addition & 0 deletions src/ZGameWindow_Storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class ZGameWindow_Storage : public ZFrame
ZFrame_FontFrame MainTitle;
ZFrame_FontFrame StorageTitle;
ZFrame_FontFrame InventoryTitle;
ZTileFrame Arrow_Transfert;

ZInventoryBox * MainStorage;

Expand Down

0 comments on commit 6409c94

Please sign in to comment.