Skip to content

Commit

Permalink
ODYSSEY: Enable progress bars to change fill texture
Browse files Browse the repository at this point in the history
  • Loading branch information
Nostritius authored and DrMcCoy committed May 26, 2019
1 parent 7bc48cf commit d8238af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/engines/odyssey/progressbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ int WidgetProgressbar::getMaxValue() const {
return _maxValue;
}

void WidgetProgressbar::setProgressFill(const Common::UString &fill) {
_progress->hide();
float x, y, z;
_progress->getPosition(x, y, z);
_progress.reset(new Graphics::Aurora::GUIQuad(fill, 0.0f, 0.0f, getWidth(), getHeight()));
_progress->setPosition(x, y, z);
update();
_progress->show();
}

void WidgetProgressbar::update() {
if (_horizontal) {
if ((_maxValue <= 0) || (_curValue >= _maxValue))
Expand Down
2 changes: 2 additions & 0 deletions src/engines/odyssey/progressbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class WidgetProgressbar : public Widget {
void show();
void hide();

void setProgressFill(const Common::UString &fill);

// Positioning

void setPosition(float x, float y, float z);
Expand Down

0 comments on commit d8238af

Please sign in to comment.