MCPcopy Create free account
hub / github.com/TurningWheel/Barony / createItemEffectMenu

Method createItemEffectMenu

src/interface/interface.cpp:26998–27327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26996}
26997
26998void GenericGUIMenu::ItemEffectGUI_t::createItemEffectMenu()
26999{
27000 const int player = parentGUI.getPlayer();
27001 if ( !gui || !itemEffectFrame || !players[player]->inventoryUI.frame )
27002 {
27003 return;
27004 }
27005 if ( ItemEffectHasBeenCreated() )
27006 {
27007 return;
27008 }
27009
27010 SDL_Rect basePos{ 0, 0, itemEffectBaseWidth, 242 };
27011 const char* baseWindow = "*images/ui/ScrollSpells/Scroll_Window_00.png";
27012 if ( modeHasCostEffect == COST_EFFECT_GOLD
27013 || modeHasCostEffect == COST_EFFECT_MANA )
27014 {
27015 baseWindow = "*images/ui/ScrollSpells/Scroll_Window_GoldCost_00.png";
27016 basePos.h = 268;
27017 }
27018 else if ( modeHasCostEffect == COST_EFFECT_MANA_RETURN_GOLD
27019 || modeHasCostEffect == COST_EFFECT_MANA_AND_GOLD )
27020 {
27021 baseWindow = "*images/ui/ScrollSpells/Scroll_Window_GoldManaCost_00.png";
27022 basePos.h = 296;
27023 }
27024
27025 {
27026 auto bgFrame = itemEffectFrame->addFrame("itemfx base");
27027 bgFrame->setSize(basePos);
27028 bgFrame->setHollow(false);
27029 bgFrame->setDisabled(true);
27030 auto bg = bgFrame->addImage(SDL_Rect{ 0, 0, basePos.w, basePos.h },
27031 makeColor(255, 255, 255, 255),
27032 baseWindow, "itemfx base img");
27033
27034 auto skillIcon = bgFrame->addImage(SDL_Rect{ 270, 36, 24, 24 },
27035 makeColor(255, 255, 255, 255),
27036 "", "itemfx skill img");
27037 skillIcon->disabled = true;
27038
27039 auto itemIcon = bgFrame->addImage(SDL_Rect{ 270, 36, 24, 24 },
27040 makeColor(255, 255, 255, 255),
27041 "", "itemfx item img");
27042 itemIcon->disabled = true;
27043
27044 auto headerFont = "fonts/pixel_maz_multiline.ttf#16#2";
27045 auto itemFxTitle = bgFrame->addField("itemfx title", 128);
27046 itemFxTitle->setFont(headerFont);
27047 itemFxTitle->setText("");
27048 itemFxTitle->setHJustify(Field::justify_t::CENTER);
27049 itemFxTitle->setVJustify(Field::justify_t::TOP);
27050 itemFxTitle->setSize(SDL_Rect{ 0, 0, 0, 0 });
27051 itemFxTitle->setTextColor(hudColors.characterSheetLightNeutral);
27052 itemFxTitle->setOutlineColor(makeColor(29, 16, 11, 255));
27053 auto itemFxStatus = bgFrame->addField("itemfx status", 128);
27054 itemFxStatus->setFont(headerFont);
27055 itemFxStatus->setText("");

Callers

nothing calls this directly

Calls 15

makeColorFunction · 0.85
addFrameMethod · 0.80
setHollowMethod · 0.80
addImageMethod · 0.80
addFieldMethod · 0.80
setOutlineColorMethod · 0.80
addButtonMethod · 0.80
setHideGlyphsMethod · 0.80
setHideKeyboardGlyphsMethod · 0.80
setHideSelectorsMethod · 0.80

Tested by

no test coverage detected