Incorporate dynamic pointer cast fix

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
2024-01-16 21:03:46 +00:00
parent 2ba989c6b5
commit 965d0afdb1
17 changed files with 50 additions and 44 deletions
@@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright � 2023 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/
@@ -55,7 +55,7 @@ void Menu::InitializeConsumableCraftingWindow(){
#pragma region Craftables Inventory Display
auto craftingItemsDisplay=consumableCraftingWindow->ADD("Crafting Inventory Display",RowInventoryScrollableWindowComponent)(geom2d::rect<float>{{2,28},{220,consumableCraftingWindow->size.y-44}},"Item Name Label","Item Description Label",
[](MenuFuncData data){
std::weak_ptr<RowItemDisplay>comp=dynamic_pointer_cast<RowItemDisplay>(data.component.lock());
std::weak_ptr<RowItemDisplay>comp=DYNAMIC_POINTER_CAST<RowItemDisplay>(data.component.lock());
const std::weak_ptr<Item>item=comp.lock()->GetItem();
Component<MenuLabel>(CONSUMABLE_CRAFT_ITEM,"Item Name Header")->GetString(A::ITEM_NAME)=item.lock()->ActualName();
Component<MenuLabel>(CONSUMABLE_CRAFT_ITEM,"Amount to Craft Amount Label")->SetLabel("1");
@@ -68,7 +68,7 @@ void Menu::InitializeConsumableCraftingWindow(){
return true;
},
[](MenuFuncData data){
std::weak_ptr<RowItemDisplay>rowItem=dynamic_pointer_cast<RowItemDisplay>(data.component.lock());
std::weak_ptr<RowItemDisplay>rowItem=DYNAMIC_POINTER_CAST<RowItemDisplay>(data.component.lock());
if(rowItem.lock()->GetItem().lock()->GetEnhancementInfo().AvailableChapter()<=game->GetCurrentChapter()){
Component<MenuItemItemButton>(CRAFT_CONSUMABLE,"Item Icon")->SetHideDetails(false);
}else{