feat: add PieceInfo display

This commit is contained in:
2026-02-05 11:08:07 +08:00
parent 38c6c7474d
commit dd8b57c306
12 changed files with 78 additions and 4 deletions

View File

@@ -21,6 +21,7 @@ public:
label->setText(text, {"SourceHanSansSC-Regular.otf", UI::UI_NORMAL_FONT_SIZE, {0, 0, 0, 255}});
label->setName(name);
label->setVisible(true);
label->setBackgroundColor({0, 0, 0, 0});
return label;
}

View File

@@ -177,6 +177,15 @@ void GameUIManager::setupUIComponents() {
);
m_labels.emplace(playerLabel->getNameHash(), std::move(playerLabel));
auto pieceInfoLabel = UIWidgetFactory::createStandardLabel(
"PieceInfoLabel",
"HP: 0\nATK: 0",
120,
0
);
pieceInfoLabel->setVisible(false);
m_labels.emplace(pieceInfoLabel->getNameHash(), std::move(pieceInfoLabel));
}