1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-29 03:33:48 +00:00

Highlight bound slots and correct highlight shift by a few pixels (now properly centered!)

This commit is contained in:
fgenesis 2017-02-19 03:48:05 +01:00
parent 7f20f79d97
commit d0bb8746ae
2 changed files with 18 additions and 3 deletions

View file

@ -493,14 +493,26 @@ AquariaKeyConfig::AquariaKeyConfig(const std::string &actionInputName, InputSetT
, rejectJoyAxis(false) , rejectJoyAxis(false)
{ {
bg = new Quad(); bg = new Quad();
bg2 = new Quad();
if (inputSetType == INPUTSET_OTHER) if (inputSetType == INPUTSET_OTHER)
{
bg->setWidthHeight(40, 20); bg->setWidthHeight(40, 20);
bg2->setWidthHeight(40, 20);
}
else else
{
bg->setWidthHeight(90, 20); bg->setWidthHeight(90, 20);
bg2->setWidthHeight(90, 20);
}
bg->color = Vector(0.5, 0.5, 0.5); bg->color = Vector(0.5f, 0.5f, 0.5f);
bg->alphaMod = 0; bg->alphaMod = 0;
bg->position = Vector(0, -3);
bg2->color = Vector(0.4f, 0.4f, 0.6f);
bg2->alphaMod = 0;
bg2->position = Vector(0, -3);
addChild(bg, PM_POINTER); addChild(bg, PM_POINTER);
addChild(bg2, PM_POINTER);
@ -618,6 +630,9 @@ void AquariaKeyConfig::onUpdate(float dt)
k = &as.joycfg.s2ay; k = &as.joycfg.s2ay;
} }
if(k && *k)
bg2->alphaMod = 0.3f;
if (waitingForInput == this) if (waitingForInput == this)
{ {
std::string s; std::string s;
@ -890,7 +905,7 @@ void AquariaKeyConfig::onUpdate(float dt)
} }
} }
Vector p = getWorldPosition(); Vector p = bg->getWorldPosition();
if (waitingForInput == this || (!waitingForInput && if (waitingForInput == this || (!waitingForInput &&
(core->mouse.position.x > (p.x - bg->getWidth()*0.5f) && core->mouse.position.x < (p.x + bg->getWidth()*0.5f) (core->mouse.position.x > (p.x - bg->getWidth()*0.5f) && core->mouse.position.x < (p.x + bg->getWidth()*0.5f)

View file

@ -190,7 +190,7 @@ protected:
InputSetType inputSetType; InputSetType inputSetType;
int inputIdx; int inputIdx;
TTFText *keyConfigFont; TTFText *keyConfigFont;
Quad *bg; Quad *bg, *bg2;
size_t actionSetIndex; size_t actionSetIndex;
bool acceptEsc; bool acceptEsc;
bool rejectJoyAxis; bool rejectJoyAxis;