Przeglądaj źródła

Adjusts guiGameListMenuCtrl.cpp to handle Left and Right keys to adjust options, which simultaneously fixes the 'jiggle' issue on the options menu of the BaseGame base UI
Per Steve's suggestion, put a pause on gameplay sounds alongside the game sim being paused when the pause menu is opened.
Nudges the keybind preview image for guiGameListMenuCtrl to be better centered

Areloch 4 lat temu
rodzic
commit
db6c63d424

+ 9 - 1
Engine/source/gui/controls/guiGameListMenuCtrl.cpp

@@ -391,7 +391,7 @@ void GuiGameListMenuCtrl::onRenderKeybindOption(Row* row, Point2I currentOffset)
    //drawer->drawBitmap(row->mBitmap, )
    //drawer->drawBitmap(row->mBitmap, )
 
 
    Point2I button;
    Point2I button;
-   button.x = currentOffset.x + columnSplit + (columnSplit / 2)/* + (optionWidth / 2)*/;
+   button.x = currentOffset.x + columnSplit + (columnSplit / 2.5)/* + (optionWidth / 2)*/;
    button.y = currentOffset.y + (rowHeight / 4);
    button.y = currentOffset.y + (rowHeight / 4);
 
 
    Point2I buttonSize;
    Point2I buttonSize;
@@ -885,6 +885,14 @@ bool GuiGameListMenuCtrl::onKeyDown(const GuiEvent &event)
          changeRow(1);
          changeRow(1);
          return true;
          return true;
 
 
+      case KEY_LEFT:
+         changeOption(-1);
+         return true;
+
+      case KEY_RIGHT:
+         changeOption(1);
+         return true;
+
       case KEY_A:
       case KEY_A:
       case KEY_RETURN:
       case KEY_RETURN:
       case KEY_NUMPADENTER:
       case KEY_NUMPADENTER:

+ 1 - 1
Templates/BaseGame/game/data/ui/guis/optionsMenu.gui

@@ -206,7 +206,7 @@
          willFirstRespond = "1";
          willFirstRespond = "1";
          hScrollBar = "alwaysOff";
          hScrollBar = "alwaysOff";
          vScrollBar = "dynamic";
          vScrollBar = "dynamic";
-         lockHorizScroll = "0";
+         lockHorizScroll = "1";
          lockVertScroll = "0";
          lockVertScroll = "0";
          constantThumbHeight = "0";
          constantThumbHeight = "0";
          childMargin = "0 0";
          childMargin = "0 0";

+ 2 - 0
Templates/BaseGame/game/data/ui/guis/pauseMenu.cs

@@ -9,6 +9,7 @@ function PauseMenu::onWake(%this)
 {
 {
    $timescale = 0;
    $timescale = 0;
    
    
+   sfxSetChannelVolume( $SimAudioType, $pref::SFX::channelVolume[ 0 ] );
    PauseMenuList.hidden = false;
    PauseMenuList.hidden = false;
    PauseMenuList.setFirstResponder();
    PauseMenuList.setFirstResponder();
    PauseButtonHolder.setActive();
    PauseButtonHolder.setActive();
@@ -18,6 +19,7 @@ function PauseMenu::onWake(%this)
 function PauseMenu::onSleep(%this)
 function PauseMenu::onSleep(%this)
 {
 {
    $timescale = 1;
    $timescale = 1;
+   sfxSetChannelVolume( $SimAudioType, $pref::SFX::channelVolume[ $SimAudioType ] );
 }
 }
 
 
 function PauseMenu::onReturnTo(%this)
 function PauseMenu::onReturnTo(%this)