mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-21 13:20:54 +00:00
Address jvoisin's remarks
This commit is contained in:
parent
6e5b423d04
commit
9663f4f473
@ -27,7 +27,7 @@
|
||||
namespace
|
||||
{
|
||||
constexpr unsigned int sMaxCoins = 3;
|
||||
constexpr int sCols[] = { 32, 218 };
|
||||
constexpr int sColumnOffsets[] = { 32, 218 };
|
||||
}
|
||||
namespace MWGui
|
||||
{
|
||||
@ -47,11 +47,11 @@ namespace MWGui
|
||||
{
|
||||
const auto& store = MWBase::Environment::get().getESMStore()->get<ESM::Attribute>();
|
||||
const size_t perCol
|
||||
= static_cast<size_t>(std::ceil(store.getSize() / static_cast<float>(std::size(sCols))));
|
||||
= static_cast<size_t>(std::ceil(store.getSize() / static_cast<float>(std::size(sColumnOffsets))));
|
||||
size_t i = 0;
|
||||
for (const ESM::Attribute& attribute : store)
|
||||
{
|
||||
const int offset = sCols[i / perCol];
|
||||
const int offset = sColumnOffsets[i / perCol];
|
||||
const int row = static_cast<int>(i % perCol);
|
||||
Widgets widgets;
|
||||
widgets.mMultiplier = mAssignWidget->createWidget<MyGUI::TextBox>(
|
||||
|
@ -47,17 +47,17 @@ namespace MWGui
|
||||
const MWWorld::ESMStore& store = *MWBase::Environment::get().getESMStore();
|
||||
MyGUI::Widget* attributeView = getWidget("AttributeView");
|
||||
MyGUI::IntCoord coord{ 0, 0, 204, 18 };
|
||||
const MyGUI::Align align = MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch;
|
||||
const MyGUI::Align alignment = MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch;
|
||||
for (const ESM::Attribute& attribute : store.get<ESM::Attribute>())
|
||||
{
|
||||
auto* box = attributeView->createWidget<MyGUI::Button>({}, coord, align);
|
||||
auto* box = attributeView->createWidget<MyGUI::Button>({}, coord, alignment);
|
||||
box->setUserString("ToolTipType", "Layout");
|
||||
box->setUserString("ToolTipLayout", "AttributeToolTip");
|
||||
box->setUserString("Caption_AttributeName", attribute.mName);
|
||||
box->setUserString("Caption_AttributeDescription", attribute.mDescription);
|
||||
box->setUserString("ImageTexture_AttributeImage", attribute.mIcon);
|
||||
coord.top += coord.height;
|
||||
auto* name = box->createWidget<MyGUI::TextBox>("SandText", { 0, 0, 160, 18 }, align);
|
||||
auto* name = box->createWidget<MyGUI::TextBox>("SandText", { 0, 0, 160, 18 }, alignment);
|
||||
name->setNeedMouseFocus(false);
|
||||
name->setCaption(attribute.mName);
|
||||
auto* value = box->createWidget<MyGUI::TextBox>(
|
||||
|
Loading…
x
Reference in New Issue
Block a user