Commit bbd58a22 authored by Aloshi's avatar Aloshi

Fixed help style not changing between systems in SystemView.

Fixed Ctrl-R not updating help style in SystemView.
parent 7661fdc2
......@@ -36,19 +36,26 @@ bool GuiComponent::input(InputConfig* config, Input input)
return false;
}
void GuiComponent::update(int deltaTime)
void GuiComponent::updateSelf(int deltaTime)
{
for(unsigned char i = 0; i < MAX_ANIMATIONS; i++)
{
advanceAnimation(i, deltaTime);
}
}
void GuiComponent::updateChildren(int deltaTime)
{
for(unsigned int i = 0; i < getChildCount(); i++)
{
getChild(i)->update(deltaTime);
}
}
void GuiComponent::update(int deltaTime)
{
updateSelf(deltaTime);
updateChildren(deltaTime);
}
void GuiComponent::render(const Eigen::Affine3f& parentTrans)
{
Eigen::Affine3f trans = parentTrans * getTransform();
......
......@@ -25,7 +25,7 @@ public:
//Return true if the input is consumed, false if it should continue to be passed to other children.
virtual bool input(InputConfig* config, Input input);
//Called when time passes. Default implementation also calls update(deltaTime) on children - so you should probably call GuiComponent::update(deltaTime) at some point.
//Called when time passes. Default implementation calls updateSelf(deltaTime) and updateChildren(deltaTime) - so you should probably call GuiComponent::update(deltaTime) at some point (or at least updateSelf so animations work).
virtual void update(int deltaTime);
//Called when it's time to render. By default, just calls renderChildren(parentTrans * getTransform()).
......@@ -92,6 +92,8 @@ public:
protected:
void renderChildren(const Eigen::Affine3f& transform) const;
void updateSelf(int deltaTime); // updates animations
void updateChildren(int deltaTime); // updates animations
unsigned char mOpacity;
Window* mWindow;
......
......@@ -103,6 +103,7 @@ bool SystemView::input(InputConfig* config, Input input)
it->object->loadTheme();
populate();
updateHelpPrompts();
return true;
}
if(config->isMappedTo("left", input))
......@@ -137,6 +138,9 @@ void SystemView::update(int deltaTime)
void SystemView::onCursorChanged(const CursorState& state)
{
// update help style
updateHelpPrompts();
float startPos = mCamOffset;
float posMax = (float)mEntries.size();
......
......@@ -214,6 +214,8 @@ std::shared_ptr<IGameListView> ViewController::getGameListView(SystemData* syste
int id = std::find(sysVec.begin(), sysVec.end(), system) - sysVec.begin();
view->setPosition(id * (float)Renderer::getScreenWidth(), (float)Renderer::getScreenHeight() * 2);
addChild(view.get());
mGameListViews[system] = view;
return view;
}
......@@ -225,6 +227,7 @@ std::shared_ptr<SystemView> ViewController::getSystemListView()
return mSystemListView;
mSystemListView = std::shared_ptr<SystemView>(new SystemView(mWindow));
addChild(mSystemListView.get());
mSystemListView->setPosition(0, (float)Renderer::getScreenHeight());
return mSystemListView;
}
......@@ -256,7 +259,7 @@ void ViewController::update(int deltaTime)
mCurrentView->update(deltaTime);
}
GuiComponent::update(deltaTime);
updateSelf(deltaTime);
}
void ViewController::render(const Eigen::Affine3f& parentTrans)
......@@ -355,6 +358,8 @@ void ViewController::reloadAll()
}else{
goToSystemView(SystemData::sSystemVector.front());
}
updateHelpPrompts();
}
std::vector<HelpPrompt> ViewController::getHelpPrompts()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment