Merge pull request #258 from Areloch/BaseGameThemeUpdate

Updates the BaseGame UI theme
This commit is contained in:
Brian Roberts 2020-07-26 13:09:00 -05:00 committed by GitHub
commit 4890ed8789
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
96 changed files with 1669 additions and 2612 deletions

View file

@ -278,7 +278,7 @@ void GuiGameListMenuCtrl::onRenderSliderOption(Row* row, Point2I currentOffset)
bool isRowSelected = (getSelected() != NO_ROW) && (row == mRows[getSelected()]);
bool isRowHighlighted = (getHighlighted() != NO_ROW) ? ((row == mRows[getHighlighted()]) && (row->mEnabled)) : false;
if (profileHasArrows)
/*if (profileHasArrows)
{
// render the left arrow
bool arrowOnL = (isRowSelected || isRowHighlighted) && (row->mValue > row->mRange.x);
@ -297,7 +297,7 @@ void GuiGameListMenuCtrl::onRenderSliderOption(Row* row, Point2I currentOffset)
drawer->clearBitmapModulation();
drawer->drawBitmapStretchSR(profile->mTextureObject, RectI(arrowOffset, arrowExtent), profile->getBitmapArrayRect((U32)iconIndex));
}
}*/
//Draw the slider bar
if (row->mEnabled)
@ -324,8 +324,8 @@ void GuiGameListMenuCtrl::onRenderSliderOption(Row* row, Point2I currentOffset)
ColorI barOutlineColor;
if (isRowSelected)
{
barColor = profile->mFillColorHL;
barOutlineColor = profile->mFillColor;
barColor = profile->mFillColor;
barOutlineColor = profile->mFillColorSEL;
}
else
{
@ -818,6 +818,8 @@ bool GuiGameListMenuCtrl::onInputEvent(const InputEventInfo& event)
{
bool isModifier = false;
bool state = event.action == SI_MAKE;
switch (event.objInst)
{
case KEY_LCONTROL:
@ -837,12 +839,12 @@ bool GuiGameListMenuCtrl::onInputEvent(const InputEventInfo& event)
if (!ActionMap::getKeyString(event.objInst, keyString))
return false;
onInputEvent_callback(deviceString, keyString, event.action);
onInputEvent_callback(deviceString, keyString, state);
}
else
{
const char* actionString = ActionMap::buildActionString(&event);
onInputEvent_callback(deviceString, actionString, event.action);
onInputEvent_callback(deviceString, actionString, state);
}
}
else if (event.objType == SI_AXIS || event.objType == SI_INT || event.objType == SI_FLOAT)
@ -1159,10 +1161,22 @@ void GuiGameListMenuCtrl::changeOption(Row* row, S32 delta)
}
row->mSelectedOption = newSelection;
if (row->mMode == GuiGameListMenuCtrl::Row::Slider)
{
row->mValue += row->mStepSize * delta;
row->mValue = mRound(row->mValue / row->mStepSize) * row->mStepSize;
if (row->mValue < row->mRange.x)
row->mValue = row->mRange.x;
if (row->mValue > row->mRange.y)
row->mValue = row->mRange.y;
}
static StringTableEntry LEFT = StringTable->insert("LEFT", true);
static StringTableEntry RIGHT = StringTable->insert("RIGHT", true);
if (row->mScriptCallback != NULL)
if (row->mScriptCallback != NULL && (row->mSelectedOption != NO_OPTION && row->mMode != GuiGameListMenuCtrl::Row::Slider))
{
setThisControl();
StringTableEntry direction = NULL;
@ -1712,9 +1726,6 @@ void GuiGameListMenuProfile::initPersistFields()
removeField("modal");
removeField("opaque");
removeField("fillColor");
removeField("fillColorHL");
removeField("fillColorNA");
removeField("border");
removeField("borderThickness");
removeField("borderColor");

View file

@ -1075,14 +1075,12 @@ bool GuiCanvas::processGamepadEvent(InputEventInfo &inputEvent)
switch (inputEvent.objInst)
{
case XI_LEFT_TRIGGER:
case XI_RIGHT_TRIGGER:
case SI_ZAXIS:
case SI_RZAXIS:
return mFirstResponder->onGamepadTrigger(mLastEvent);
case SI_ZAXIS:
case SI_YAXIS:
case XI_THUMBLY:
case XI_THUMBRY:
case SI_RYAXIS:
if (!negative)
{
return mFirstResponder->onGamepadAxisDown(mLastEvent);
@ -1093,8 +1091,7 @@ bool GuiCanvas::processGamepadEvent(InputEventInfo &inputEvent)
}
case SI_XAXIS:
case XI_THUMBLX:
case XI_THUMBRX:
case SI_RXAXIS:
default:
if (negative)
{

View file

@ -132,6 +132,12 @@ bool GuiFadeinBitmapCtrl::onKeyDown(const GuiEvent &)
return true;
}
bool GuiFadeinBitmapCtrl::onGamepadButtonDown(const GuiEvent& event)
{
click_callback();
return true;
}
//-----------------------------------------------------------------------------
bool GuiFadeinBitmapCtrl::onWake()

View file

@ -72,6 +72,7 @@ class GuiFadeinBitmapCtrl : public GuiBitmapCtrl
virtual void onPreRender();
virtual void onMouseDown(const GuiEvent &);
virtual bool onKeyDown(const GuiEvent &);
virtual bool onGamepadButtonDown(const GuiEvent& event);
virtual bool onWake();
virtual void onRender(Point2I offset, const RectI &updateRect);