From f987e51324773d112f09fece5420d6f069697b3e Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Fri, 29 Dec 2023 02:49:37 -0600 Subject: [PATCH] Locked item display changes. --- Crawler/ConsumableCraftingWindow.cpp | 4 +++- Crawler/RowItemDisplay.h | 9 ++++++++- Crawler/Version.h | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Crawler/ConsumableCraftingWindow.cpp b/Crawler/ConsumableCraftingWindow.cpp index d20d8880..456e7993 100644 --- a/Crawler/ConsumableCraftingWindow.cpp +++ b/Crawler/ConsumableCraftingWindow.cpp @@ -62,7 +62,9 @@ void Menu::InitializeConsumableCraftingWindow(){ Component(CONSUMABLE_CRAFT_ITEM,"Item Name Header")->SetLabel(std::format("Crafting {}",item.lock()->DisplayName())); Component(CONSUMABLE_CRAFT_ITEM,"Required Materials List")->SetItem(item); Component(CONSUMABLE_CRAFT_ITEM,"Craft Button")->SetGrayedOut(!item.lock()->CanEnhanceItem()); - Menu::OpenMenu(CONSUMABLE_CRAFT_ITEM); + if(item.lock()->GetEnhancementInfo().AvailableChapter()<=game->GetCurrentChapter()){ + Menu::OpenMenu(CONSUMABLE_CRAFT_ITEM); + } return true; }, [](MenuFuncData data){ diff --git a/Crawler/RowItemDisplay.h b/Crawler/RowItemDisplay.h index 8ee0d04e..46437eb5 100644 --- a/Crawler/RowItemDisplay.h +++ b/Crawler/RowItemDisplay.h @@ -77,11 +77,18 @@ public: window.FillRectDecal(rect.pos+vf2d{1,1},rect.size-vf2d{1,1},col); } + if(locked){ + window.FillRectDecal(rect.pos+vf2d{1,1},rect.size-vf2d{1,1},BLACK); + } + float scaleFactor=(rect.size.y-4)/24; vf2d iconSize=vf2d{scaleFactor,scaleFactor}*24.f; Pixel tint=WHITE; - if(locked)tint=BLACK; + if(locked){ + window.FillRectDecal(rect.pos+vf2d{2,2},iconSize); + tint=BLACK; + } window.DrawDecal(rect.pos+vf2d{2,2},const_cast(itemRef.lock()->Decal()),{scaleFactor,scaleFactor},tint); window.DrawRectDecal(rect.pos+vf2d{2,2},iconSize); diff --git a/Crawler/Version.h b/Crawler/Version.h index 5eaf4523..0be92f1e 100644 --- a/Crawler/Version.h +++ b/Crawler/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 2 #define VERSION_PATCH 1 -#define VERSION_BUILD 5077 +#define VERSION_BUILD 5079 #define stringify(a) stringify_(a) #define stringify_(a) #a