Fixed inventory window display bugs using old parent position code for rendering.

pull/28/head
sigonasr2 1 year ago
parent 92133061c3
commit fe8cbb022a
  1. 1
      Crawler/Crawler.vcxproj
  2. 3
      Crawler/Crawler.vcxproj.filters
  3. 2
      Crawler/InventoryWindow.cpp
  4. 0
      Crawler/OverworldDisplayWindow.cpp
  5. 6
      Crawler/ScrollableWindowComponent.h
  6. 1
      Crawler/State_OverworldMap.cpp
  7. 2
      Crawler/Version.h

@ -341,6 +341,7 @@
<ClCompile Include="MenuAnimatedIconButton.h" />
<ClCompile Include="MenuComponent.cpp" />
<ClCompile Include="Meteor.cpp" />
<ClCompile Include="OverworldDisplayWindow.cpp" />
<ClCompile Include="RunAway.cpp" />
<ClCompile Include="RunTowards.cpp" />
<ClCompile Include="Pathfinding.cpp" />

@ -383,6 +383,9 @@
<ClCompile Include="Unlock.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="OverworldDisplayWindow.cpp">
<Filter>Source Files\Interface</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="cpp.hint" />

@ -30,7 +30,7 @@ void Menu::InitializeInventoryWindow(){
//We don't have to actually populate the inventory list because now when an item gets added, it will automatically add the correct component in for us.
MenuLabel*itemNameLabel=new MenuLabel{INVENTORY,geom2d::rect<float>(vf2d{2,float(initialInvHeight*totalSpacing-4)},windowSize),"",1,false,true};
MenuLabel*itemNameLabel=new MenuLabel{INVENTORY,geom2d::rect<float>(vf2d{2,float(initialInvHeight*totalSpacing+itemSpacing-16)},{windowSize.x-4,windowSize.y-108}),"",1,false,true};
inventoryWindow->AddComponent("itemName",itemNameLabel);
MenuLabel*itemDescriptionLabel=new MenuLabel{INVENTORY,geom2d::rect<float>(vf2d{2,float(initialInvHeight*totalSpacing+itemSpacing)},{windowSize.x-4,windowSize.y-108}),"",1,true,true};
inventoryWindow->AddComponent("itemDescription",itemDescriptionLabel);

@ -122,11 +122,11 @@ protected:
virtual inline void DrawDecal(Crawler*game,vf2d parentPos,bool focused)override{
MenuComponent::DrawDecal(game,parentPos,focused);
game->DrawRectDecal(rect.pos+parentPos,rect.size);
game->DrawRectDecal(rect.pos+Menu::menus[parentMenu]->pos,rect.size);
for(MenuComponent*component:components){
component->_DrawDecal(game,rect.pos+parentPos+V(A::SCROLL_OFFSET),focused);
component->_DrawDecal(game,rect.pos+Menu::menus[parentMenu]->pos+V(A::SCROLL_OFFSET),focused);
}
DrawScrollbar(game,parentPos,focused);
DrawScrollbar(game,Menu::menus[parentMenu]->pos,focused);
}
virtual bool GetHoverState(Crawler*game,MenuComponent*child)override{
return geom2d::overlaps(geom2d::rect<float>{Menu::menus[parentMenu]->pos+rect.pos+child->rect.pos+V(A::SCROLL_OFFSET),child->rect.size},game->GetMousePos());

@ -38,6 +38,7 @@ void State_OverworldMap::OnUserUpdate(Crawler*game){
for(ConnectionPoint&cp:connections){
if(game->GetMouse(Mouse::LEFT).bPressed&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect)){
Menu::OpenMenu(MenuType::INVENTORY);
for(int neighborInd:currentConnectionPoint->neighbors){
if(neighborInd==-1)continue;
ConnectionPoint&neighbor=ConnectionPointFromIndex(neighborInd);

@ -2,7 +2,7 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 1
#define VERSION_BUILD 2527
#define VERSION_BUILD 2536
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Loading…
Cancel
Save