Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/windowing/StarItemSlotWidget.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-21 00:58:49 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-21 00:58:49 +1000
commit4b0bc220e4da1173f742a4973939b139bef562db (patch)
tree0ff66d5957575fa814fc10b8cd93e3dd378f45dc /source/windowing/StarItemSlotWidget.cpp
parent607be749451aa40e3619e7ceab0927d1fcec8233 (diff)
Support for changing the game's timescale
Context-specific (like per-world) timescales can also be added later
Diffstat (limited to 'source/windowing/StarItemSlotWidget.cpp')
-rw-r--r--source/windowing/StarItemSlotWidget.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/windowing/StarItemSlotWidget.cpp b/source/windowing/StarItemSlotWidget.cpp
index cc9ff50..4d67175 100644
--- a/source/windowing/StarItemSlotWidget.cpp
+++ b/source/windowing/StarItemSlotWidget.cpp
@@ -56,8 +56,12 @@ ItemSlotWidget::ItemSlotWidget(ItemPtr const& item, String const& backingImage)
disableScissoring();
}
-void ItemSlotWidget::update() {
- Widget::update();
+void ItemSlotWidget::update(float dt) {
+ if (m_item)
+ m_newItemIndicator.update(dt);
+ if (m_highlightEnabled)
+ m_highlightAnimation.update(dt);
+ Widget::update(dt);
}
bool ItemSlotWidget::sendEvent(InputEvent const& event) {
@@ -159,7 +163,6 @@ void ItemSlotWidget::renderImpl() {
for (auto i : iconDrawables)
context()->drawInterfaceDrawable(i, Vec2F(screenPosition() + size() / 2));
- m_newItemIndicator.update(WorldTimestep);
if (!m_newItemIndicator.isComplete())
context()->drawInterfaceDrawable(m_newItemIndicator.drawable(1.0), Vec2F(screenPosition() + size() / 2), Color::White.toRgba());
@@ -195,7 +198,6 @@ void ItemSlotWidget::renderImpl() {
}
if (m_highlightEnabled) {
- m_highlightAnimation.update(WorldTimestep);
context()->drawInterfaceDrawable(m_highlightAnimation.drawable(1.0), Vec2F(screenPosition() + size() / 2), Color::White.toRgba());
}