Compare commits

...

2 Commits

  1. 96
      FiestaCraftingCalculator/FiestaCraftingCalculator.cpp
  2. 40
      FiestaCraftingCalculator/FiestaCraftingCalculator.vcxproj
  3. 13
      FiestaCraftingCalculator/FiestaCraftingCalculator.vcxproj.filters
  4. BIN
      FiestaCraftingCalculator/assets/AdlF_Karen.png
  5. BIN
      FiestaCraftingCalculator/assets/production_icons.png
  6. 1214
      FiestaCraftingCalculator/olcPGEX_QuickGUI.h
  7. 6695
      FiestaCraftingCalculator/olcPixelGameEngine.h

@ -0,0 +1,96 @@
#define OLC_PGE_APPLICATION
#include "olcPixelGameEngine.h"
#define OLC_PGEX_QUICKGUI
#include "olcPGEX_QuickGUI.h"
using namespace olc;
using namespace olc::QuickGUI;
#define PROGRAM_WIDTH 1600
int PANEL_WIDTH=620;
int PANEL_HEIGHT=240;
class FiestaCraftingCalculator : public olc::PixelGameEngine
{
static Renderable ProdIcon;
class Calculator{
Manager manager;
vf2d displayPos={10,10};
ImageCheckBox*PotionProd;
ImageCheckBox*StoneProd;
ImageCheckBox*ScrollProd;
ImageCheckBox*CompProd;
ImageCheckBox*DecompProd;
public:
Calculator(vf2d displayPos)
:displayPos(displayPos){
PotionProd=new ImageCheckBox(manager,FiestaCraftingCalculator::ProdIcon,false,displayPos+vi2d{10,10},{40,40},{192,128},{32,32});
StoneProd=new ImageCheckBox(manager,FiestaCraftingCalculator::ProdIcon,false,displayPos+vi2d{55,10},{40,40},{0,160},{32,32});
ScrollProd=new ImageCheckBox(manager,FiestaCraftingCalculator::ProdIcon,false,displayPos+vi2d{100,10},{40,40},{224,128},{32,32});
CompProd=new ImageCheckBox(manager,FiestaCraftingCalculator::ProdIcon,false,displayPos+vi2d{145,10},{40,40},{96,160},{32,32});
DecompProd=new ImageCheckBox(manager,FiestaCraftingCalculator::ProdIcon,false,displayPos+vi2d{190,10},{40,40},{64,160},{32,32});
}
void Update(FiestaCraftingCalculator*pge){
manager.Update(pge);
if(PotionProd->bPressed){
StoneProd->bChecked=ScrollProd->bChecked=CompProd->bChecked=DecompProd->bChecked=false;
}
if(StoneProd->bPressed){
PotionProd->bChecked=ScrollProd->bChecked=CompProd->bChecked=DecompProd->bChecked=false;
}
if(ScrollProd->bPressed){
StoneProd->bChecked=PotionProd->bChecked=CompProd->bChecked=DecompProd->bChecked=false;
}
if(CompProd->bPressed){
StoneProd->bChecked=ScrollProd->bChecked=PotionProd->bChecked=DecompProd->bChecked=false;
}
if(DecompProd->bPressed){
StoneProd->bChecked=ScrollProd->bChecked=CompProd->bChecked=PotionProd->bChecked=false;
}
pge->GradientFillRectDecal(displayPos-vf2d{2,2},{float(PANEL_WIDTH),float(PANEL_HEIGHT)},{49, 32, 61,216},{0,0,0,216},{0,0,0,216},{49, 32, 61,216});
pge->DrawRectDecal(displayPos-vf2d{1,1},{float(PANEL_WIDTH),float(PANEL_HEIGHT)},{131, 90, 161});
manager.DrawDecal(pge);
}
};
std::vector<Calculator*>calculators;
Renderable Karen;
public:
FiestaCraftingCalculator()
{
sAppName = "Fiesta Crafting Calculator";
}
public:
bool OnUserCreate() override
{
// Called once at the start, so create things here
ProdIcon.Load("assets/production_icons.png");
Karen.Load("assets/AdlF_Karen.png");
calculators.push_back(new Calculator({10,10}));
return true;
}
bool OnUserUpdate(float fElapsedTime) override
{
if(GetKey(SPACE).bPressed){
calculators.push_back(new Calculator(vf2d{float(10+calculators.size()%2*PANEL_WIDTH),float(10+calculators.size()/2*PANEL_HEIGHT)}));
}
DrawDecal({float(ScreenWidth()-Karen.Sprite()->width),float(ScreenHeight()-Karen.Sprite()->height)},Karen.Decal());
for(Calculator*c:calculators){
c->Update(this);
}
return true;
}
};
Renderable FiestaCraftingCalculator::ProdIcon;
int main()
{
FiestaCraftingCalculator calculator;
if (calculator.Construct(PROGRAM_WIDTH, 960, 1, 1))
calculator.Start();
return 0;
}

@ -17,7 +17,6 @@
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion> <VCProjectVersion>16.0</VCProjectVersion>
@ -53,27 +52,24 @@
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>
<ImportGroup Label="Shared" > <ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
@ -108,6 +104,7 @@
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
@ -130,8 +127,13 @@
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup>
<ItemGroup></ItemGroup> <ClCompile Include="FiestaCraftingCalculator.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="olcPGEX_QuickGUI.h" />
<ClInclude Include="olcPixelGameEngine.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>

@ -14,4 +14,17 @@
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup>
<ClCompile Include="FiestaCraftingCalculator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="olcPixelGameEngine.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="olcPGEX_QuickGUI.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project> </Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save