Fixed inventory window display bugs using old parent position code for rendering.
This commit is contained in:
parent
92133061c3
commit
fe8cbb022a
@ -341,6 +341,7 @@
|
|||||||
<ClCompile Include="MenuAnimatedIconButton.h" />
|
<ClCompile Include="MenuAnimatedIconButton.h" />
|
||||||
<ClCompile Include="MenuComponent.cpp" />
|
<ClCompile Include="MenuComponent.cpp" />
|
||||||
<ClCompile Include="Meteor.cpp" />
|
<ClCompile Include="Meteor.cpp" />
|
||||||
|
<ClCompile Include="OverworldDisplayWindow.cpp" />
|
||||||
<ClCompile Include="RunAway.cpp" />
|
<ClCompile Include="RunAway.cpp" />
|
||||||
<ClCompile Include="RunTowards.cpp" />
|
<ClCompile Include="RunTowards.cpp" />
|
||||||
<ClCompile Include="Pathfinding.cpp" />
|
<ClCompile Include="Pathfinding.cpp" />
|
||||||
|
@ -383,6 +383,9 @@
|
|||||||
<ClCompile Include="Unlock.cpp">
|
<ClCompile Include="Unlock.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="OverworldDisplayWindow.cpp">
|
||||||
|
<Filter>Source Files\Interface</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="cpp.hint" />
|
<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.
|
//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);
|
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};
|
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);
|
inventoryWindow->AddComponent("itemDescription",itemDescriptionLabel);
|
||||||
|
0
Crawler/OverworldDisplayWindow.cpp
Normal file
0
Crawler/OverworldDisplayWindow.cpp
Normal file
@ -122,11 +122,11 @@ protected:
|
|||||||
|
|
||||||
virtual inline void DrawDecal(Crawler*game,vf2d parentPos,bool focused)override{
|
virtual inline void DrawDecal(Crawler*game,vf2d parentPos,bool focused)override{
|
||||||
MenuComponent::DrawDecal(game,parentPos,focused);
|
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){
|
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{
|
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());
|
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){
|
for(ConnectionPoint&cp:connections){
|
||||||
if(game->GetMouse(Mouse::LEFT).bPressed&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect)){
|
if(game->GetMouse(Mouse::LEFT).bPressed&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect)){
|
||||||
|
Menu::OpenMenu(MenuType::INVENTORY);
|
||||||
for(int neighborInd:currentConnectionPoint->neighbors){
|
for(int neighborInd:currentConnectionPoint->neighbors){
|
||||||
if(neighborInd==-1)continue;
|
if(neighborInd==-1)continue;
|
||||||
ConnectionPoint&neighbor=ConnectionPointFromIndex(neighborInd);
|
ConnectionPoint&neighbor=ConnectionPointFromIndex(neighborInd);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 1
|
#define VERSION_PATCH 1
|
||||||
#define VERSION_BUILD 2527
|
#define VERSION_BUILD 2536
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user