Incorporate dynamic pointer cast fix
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
@@ -93,7 +93,7 @@ void Menu::InitializeBlacksmithCraftingWindow(){
|
||||
#pragma region Weapon Inventory Display
|
||||
auto weaponsDisplay=blacksmithWindow->ADD("Weapon Inventory Display",RowInventoryScrollableWindowComponent)(geom2d::rect<float>{{2,28},{220,blacksmithWindow->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();
|
||||
|
||||
std::string label="";
|
||||
@@ -109,7 +109,7 @@ void Menu::InitializeBlacksmithCraftingWindow(){
|
||||
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());
|
||||
Component<MenuItemItemButton>(BLACKSMITH,"Item Icon")->SetItem(rowItem.lock()->GetItem());
|
||||
return true;
|
||||
},
|
||||
@@ -128,7 +128,7 @@ void Menu::InitializeBlacksmithCraftingWindow(){
|
||||
auto armorDisplay=blacksmithWindow->ADD("Armor Inventory Display",RowInventoryScrollableWindowComponent)(geom2d::rect<float>{{2,28},{220,blacksmithWindow->size.y-44}},"Item Name Label","Item Description Label",
|
||||
[](MenuFuncData data){
|
||||
Menu::OpenMenu(CRAFT_ITEM);
|
||||
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();
|
||||
|
||||
std::string label="";
|
||||
@@ -143,7 +143,7 @@ void Menu::InitializeBlacksmithCraftingWindow(){
|
||||
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());
|
||||
Component<MenuItemItemButton>(BLACKSMITH,"Item Icon")->SetItem(rowItem.lock()->GetItem());
|
||||
return true;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user