Skip to content

An OpenMW mod that lets you play the whole Elder Scrolls III: Morrowind as a top-down isometric game — with full online co-op or MMO modes.

C++

Menus: the inventory screen's windows are pages under a tab bar, with the mouse and keyboard too

Alan Saundersa170cdf7997d
diff --git a/apps/openmw/mwbase/windowmanager.hpp b/apps/openmw/mwbase/windowmanager.hpp
index 88024b6..c204bbd 100644
--- a/apps/openmw/mwbase/windowmanager.hpp
+++ b/apps/openmw/mwbase/windowmanager.hpp
@@ -431,6 +431,9 @@ namespace MWBase
/// Restore tooltip visibility if user has them enabled but they were hidden by mouse movement
virtual void restoreControllerTooltips() = 0;
virtual void updateControllerButtonsOverlay() = 0;
+ /// Isowind: places one of the inventory screen's pages (MWGui::WindowBase::setInventoryPage), of up to this
+ /// size, under the tab bar; or out of sight if not shown
+ virtual void placeInventoryPage(MyGUI::Widget* window, int width, int height, bool shown) = 0;
/// Isowind: the keyboard on the screen, for typing with a controller
virtual bool isOnScreenKeyboardVisible() const = 0;
/// Isowind: brings it up for the text box that has the keyboard focus
diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp
index a4be55b..5731f60 100644
--- a/apps/openmw/mwgui/container.cpp
+++ b/apps/openmw/mwgui/container.cpp
@@ -622,8 +622,7 @@ namespace MWGui
&& (arg.button == SDL_CONTROLLER_BUTTON_LEFTSHOULDER || arg.button == SDL_CONTROLLER_BUTTON_RIGHTSHOULDER))
{
// Isowind: the tabs (the triggers, where the bumpers switch windows: they come here as the bumpers)
- selectTab(wrap(mTab, mTabButtons.size(), arg.button == SDL_CONTROLLER_BUTTON_RIGHTSHOULDER ? 1 : -1));
- MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click"));
+ stepTab(arg.button == SDL_CONTROLLER_BUTTON_RIGHTSHOULDER ? 1 : -1);
}
else if (arg.button == SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
{
@@ -903,6 +902,15 @@ namespace MWGui
selectTab(wrap(mTab, mTabButtons.size(), 1));
}
+ bool ContainerWindow::stepTab(int delta)
+ {
+ if (mTabButtons.empty())
+ return false;
+ selectTab(wrap(mTab, mTabButtons.size(), delta));
+ MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click"));
+ return true;
+ }
+
void ContainerWindow::onTabWheel(MyGUI::Widget* /*sender*/, int rel)
{
if (!mTabButtons.empty() && rel != 0)
diff --git a/apps/openmw/mwgui/container.hpp b/apps/openmw/mwgui/container.hpp
index 80c0b68..401cc71 100644
--- a/apps/openmw/mwgui/container.hpp
+++ b/apps/openmw/mwgui/container.hpp
@@ -54,6 +54,7 @@ namespace MWGui
ControllerButtons* getControllerButtons() override;
bool onControllerButtonEvent(const SDL_ControllerButtonEvent& arg) override;
void setActiveControllerWindow(bool active) override;
+ bool stepTab(int delta) override;
MWGui::ItemView* getItemView() { return mItemView; }
diff --git a/apps/openmw/mwgui/inventorytabsoverlay.cpp b/apps/openmw/mwgui/inventorytabsoverlay.cpp
index 8fcfc64..fc6e32b 100644
--- a/apps/openmw/mwgui/inventorytabsoverlay.cpp
+++ b/apps/openmw/mwgui/inventorytabsoverlay.cpp
@@ -4,6 +4,9 @@
#include <MyGUI_ImageBox.h>
#include <MyGUI_Window.h>
+#include <components/settings/values.hpp>
+#include <components/widgets/box.hpp>
+
#include "../mwbase/environment.hpp"
#include "../mwbase/inputmanager.hpp"
#include "../mwbase/windowmanager.hpp"
@@ -23,6 +26,8 @@ namespace MWGui
mTabs.push_back(tab);
}
+ getWidget(mTabBox, "TabBox");
+
MyGUI::ImageBox* image;
// Isowind: the bumpers switch between these windows
getWidget(image, "BtnL2Image");
@@ -32,6 +37,23 @@ namespace MWGui
getWidget(image, "BtnR2Image");
image->setImageTexture(MWBase::Environment::get().getInputManager()->getControllerButtonIcon(
SDL_CONTROLLER_BUTTON_RIGHTSHOULDER));
+
+ // Isowind: and the keyboard's Q and E, which are shown without a controller (the bar is for the mouse and
+ // keyboard too)
+ if (!Settings::gui().mControllerMenus)
+ {
+ const auto show = [this](std::string_view id, bool shown) {
+ MyGUI::Widget* widget;
+ getWidget(widget, id);
+ widget->setVisible(shown);
+ widget->setUserString("Hidden", shown ? "false" : "true");
+ };
+ show("BtnL2Image", false);
+ show("BtnR2Image", false);
+ show("KeyPrevText", true);
+ show("KeyNextText", true);
+ mTabBox->notifyChildrenSizeChanged();
+ }
}
int InventoryTabsOverlay::getHeight()
@@ -61,4 +83,13 @@ namespace MWGui
for (size_t i = 0; i < mTabs.size(); ++i)
mTabs[i]->setStateSelected(i == index);
}
+
+ void InventoryTabsOverlay::setTabAvailable(size_t index, bool available)
+ {
+ if (index >= mTabs.size() || mTabs[index]->getVisible() == available)
+ return;
+ mTabs[index]->setVisible(available);
+ mTabs[index]->setUserString("Hidden", available ? "false" : "true");
+ mTabBox->notifyChildrenSizeChanged();
+ }
}
diff --git a/apps/openmw/mwgui/inventorytabsoverlay.hpp b/apps/openmw/mwgui/inventorytabsoverlay.hpp
index 7211e87..739b6dc 100644
--- a/apps/openmw/mwgui/inventorytabsoverlay.hpp
+++ b/apps/openmw/mwgui/inventorytabsoverlay.hpp
@@ -8,6 +8,11 @@ namespace MyGUI
class Button;
}
+namespace Gui
+{
+ class HBox;
+}
+
namespace MWGui
{
class InventoryTabsOverlay : public WindowBase
@@ -17,9 +22,12 @@ namespace MWGui
int getHeight();
void setTab(size_t index);
+ /// Isowind: a tab only for a page open (character creation opens them one by one)
+ void setTabAvailable(size_t index, bool available);
private:
std::vector<MyGUI::Button*> mTabs;
+ Gui::HBox* mTabBox = nullptr;
void onTabClicked(MyGUI::Widget* sender);
};
diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp
index b50a2ec..689fa3e 100644
--- a/apps/openmw/mwgui/inventorywindow.cpp
+++ b/apps/openmw/mwgui/inventorywindow.cpp
@@ -137,6 +137,8 @@ namespace MWGui
mFilterAll->setStateSelected(true);
setGuiMode(mGuiMode);
+ // Isowind: the inventory screen's windows are pages, and only the map can be pinned
+ setPinButtonVisible(false);
if (Settings::gui().mControllerMenus)
{
@@ -234,13 +236,12 @@ namespace MWGui
void InventoryWindow::setGuiMode(GuiMode mode)
{
- if (Settings::gui().mControllerMenus && mGuiMode == mode && isVisible())
+ // (Isowind: nor on the inventory screen, where the window is a page)
+ if ((Settings::gui().mControllerMenus || mode == GM_Inventory) && mGuiMode == mode && isVisible())
return;
mGuiMode = mode;
const WindowSettingValues settings = getModeSettings(mGuiMode);
- setPinButtonVisible(
- mode != GM_Container && mode != GM_Companion && mode != GM_Barter && !Settings::gui().mControllerMenus);
const WindowRectSettingValues& rect = settings.mIsMaximized ? settings.mMaximized : settings.mRegular;
@@ -601,7 +602,8 @@ namespace MWGui
void InventoryWindow::onTitleDoubleClicked()
{
- if (Settings::gui().mControllerMenus && mGuiMode == GM_Inventory)
+ // Isowind: on the inventory screen the window is a page
+ if (mGuiMode == GM_Inventory)
return;
else if (MyGUI::InputManager::getInstance().isShiftPressed())
toggleMaximized();
@@ -1063,33 +1065,9 @@ namespace MWGui
}
}
else if (arg.button == SDL_CONTROLLER_BUTTON_LEFTSHOULDER)
- {
- if (mFilterAll->getStateSelected())
- onFilterChanged(mFilterMisc);
- else if (mFilterWeapon->getStateSelected())
- onFilterChanged(mFilterAll);
- else if (mFilterApparel->getStateSelected())
- onFilterChanged(mFilterWeapon);
- else if (mFilterMagic->getStateSelected())
- onFilterChanged(mFilterApparel);
- else if (mFilterMisc->getStateSelected())
- onFilterChanged(mFilterMagic);
- MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click"));
- }
+ stepTab(-1);
else if (arg.button == SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
- {
- if (mFilterAll->getStateSelected())
- onFilterChanged(mFilterWeapon);
- else if (mFilterWeapon->getStateSelected())
- onFilterChanged(mFilterApparel);
- else if (mFilterApparel->getStateSelected())
- onFilterChanged(mFilterMagic);
- else if (mFilterMagic->getStateSelected())
- onFilterChanged(mFilterMisc);
- else if (mFilterMisc->getStateSelected())
- onFilterChanged(mFilterAll);
- MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click"));
- }
+ stepTab(1);
else
{
mItemView->onControllerButton(arg.button);
@@ -1103,16 +1081,6 @@ namespace MWGui
if (!Settings::gui().mControllerMenus)
return;
- MWBase::WindowManager* winMgr = MWBase::Environment::get().getWindowManager();
- if (winMgr->getMode() == MWGui::GM_Inventory)
- {
- // Isowind: the windows keep Morrowind's layout (the active one is lit, see WindowBase)
- MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>();
-
- adjustPanes();
- updatePreviewSize();
- }
-
// Show L1 and R1 buttons next to tabs
MyGUI::Widget* image;
getWidget(image, "BtnL1Image");
@@ -1124,4 +1092,28 @@ namespace MWGui
mItemView->setActiveControllerWindow(active);
WindowBase::setActiveControllerWindow(active);
}
+
+ void InventoryWindow::setInventoryPage(bool shown)
+ {
+ // Fill the screen, or limit to a certain size on large screens. Size chosen to
+ // match the size of the stats window.
+ MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
+ MWBase::Environment::get().getWindowManager()->placeInventoryPage(
+ mMainWidget, std::min(viewSize.width, 1600), StatsWindow::getIdealHeight(), shown);
+
+ adjustPanes();
+ updatePreviewSize();
+ }
+
+ bool InventoryWindow::stepTab(int delta)
+ {
+ const std::vector<MyGUI::Button*> filters
+ = { mFilterAll, mFilterWeapon, mFilterApparel, mFilterMagic, mFilterMisc };
+ size_t selected = 0;
+ while (selected < filters.size() - 1 && !filters[selected]->getStateSelected())
+ ++selected;
+ onFilterChanged(filters[wrap(selected, filters.size(), delta)]);
+ MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click"));
+ return true;
+ }
}
diff --git a/apps/openmw/mwgui/inventorywindow.hpp b/apps/openmw/mwgui/inventorywindow.hpp
index 7039d1a..b46092d 100644
--- a/apps/openmw/mwgui/inventorywindow.hpp
+++ b/apps/openmw/mwgui/inventorywindow.hpp
@@ -81,6 +81,8 @@ namespace MWGui
void onTitleDoubleClicked() override;
bool onControllerButtonEvent(const SDL_ControllerButtonEvent& arg) override;
void setActiveControllerWindow(bool active) override;
+ void setInventoryPage(bool shown) override;
+ bool stepTab(int delta) override;
private:
Misc::NotNullPtr<DragAndDrop> mDragAndDrop;
diff --git a/apps/openmw/mwgui/mapwindow.cpp b/apps/openmw/mwgui/mapwindow.cpp
index 06ca82d..7ca2050 100644
--- a/apps/openmw/mwgui/mapwindow.cpp
+++ b/apps/openmw/mwgui/mapwindow.cpp
@@ -1137,7 +1137,8 @@ namespace MWGui
MWGui::GuiMode mode = MWBase::Environment::get().getWindowManager()->getMode();
mButton->setVisible(visible && mode != MWGui::GM_None);
- if (Settings::gui().mControllerMenus && mode == MWGui::GM_None && pinned() && visible)
+ // (Isowind: for the mouse and keyboard too, as the inventory screen's windows are pages for them as well)
+ if (mode == MWGui::GM_None && pinned() && visible)
{
// Restore the window to pinned size.
MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>();
@@ -1387,7 +1388,9 @@ namespace MWGui
void MapWindow::onTitleDoubleClicked()
{
- if (Settings::gui().mControllerMenus)
+ // (Isowind: on the inventory screen the window is a page)
+ if (Settings::gui().mControllerMenus
+ || MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Inventory)
return;
else if (MyGUI::InputManager::getInstance().isShiftPressed())
MWBase::Environment::get().getWindowManager()->toggleMaximized(this);
@@ -1585,15 +1588,22 @@ namespace MWGui
}
}
- void MapWindow::setActiveControllerWindow(bool active)
+ void MapWindow::setInventoryPage(bool shown)
{
- MWBase::WindowManager* winMgr = MWBase::Environment::get().getWindowManager();
- if (winMgr->getMode() == MWGui::GM_Inventory)
- {
- // Isowind: the windows keep Morrowind's layout (the active one is lit, see WindowBase)
- }
+ // Fill the screen, or limit to a certain size on large screens. Size chosen to
+ // show the entire local map without scrolling.
+ MyGUI::IntSize canvasSize = mLocalMap->getCanvasSize();
+ MyGUI::IntSize borderSize = mMainWidget->getSize() - mMainWidget->getClientWidget()->getSize();
+ MWBase::Environment::get().getWindowManager()->placeInventoryPage(
+ mMainWidget, canvasSize.width + borderSize.width, canvasSize.height + borderSize.height, shown);
+ }
- WindowBase::setActiveControllerWindow(active);
+ bool MapWindow::stepTab(int /*delta*/)
+ {
+ // Isowind: the local map and the world map, as the two tabs
+ onWorldButtonClicked(mButton);
+ MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click"));
+ return true;
}
// -------------------------------------------------------------------
diff --git a/apps/openmw/mwgui/mapwindow.hpp b/apps/openmw/mwgui/mapwindow.hpp
index c13f507..0012bb1 100644
--- a/apps/openmw/mwgui/mapwindow.hpp
+++ b/apps/openmw/mwgui/mapwindow.hpp
@@ -290,7 +290,8 @@ namespace MWGui
protected:
bool onControllerButtonEvent(const SDL_ControllerButtonEvent& arg) override;
- void setActiveControllerWindow(bool active) override;
+ void setInventoryPage(bool shown) override;
+ bool stepTab(int delta) override;
private:
void onDragStart(MyGUI::Widget* sender, int left, int top, MyGUI::MouseButton id);
diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp
index 3793faf..2f2f8c2 100644
--- a/apps/openmw/mwgui/settingswindow.cpp
+++ b/apps/openmw/mwgui/settingswindow.cpp
@@ -1143,6 +1143,13 @@ namespace MWGui
mControlsBox->setViewOffset(MyGUI::IntPoint(0, 0));
}
+ bool SettingsWindow::stepTab(int delta)
+ {
+ mSettingsTab->setIndexSelected(wrap(mSettingsTab->getIndexSelected(), mSettingsTab->getItemCount(), delta));
+ MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click"));
+ return true;
+ }
+
bool SettingsWindow::onControllerButtonEvent(const SDL_ControllerButtonEvent& arg)
{
if (arg.button == SDL_CONTROLLER_BUTTON_B)
@@ -1150,21 +1157,9 @@ namespace MWGui
onOkButtonClicked(mOkButton);
return true;
}
- else if (arg.button == SDL_CONTROLLER_BUTTON_LEFTSHOULDER)
- {
- size_t index = mSettingsTab->getIndexSelected();
- index = wrap(index, mSettingsTab->getItemCount(), -1);
- mSettingsTab->setIndexSelected(index);
- MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click"));
- pointAtFirstControl();
- return true;
- }
- else if (arg.button == SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
+ else if (arg.button == SDL_CONTROLLER_BUTTON_LEFTSHOULDER || arg.button == SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
{
- size_t index = mSettingsTab->getIndexSelected();
- index = wrap(index, mSettingsTab->getItemCount(), 1);
- mSettingsTab->setIndexSelected(index);
- MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click"));
+ stepTab(arg.button == SDL_CONTROLLER_BUTTON_RIGHTSHOULDER ? 1 : -1);
pointAtFirstControl();
return true;
}
diff --git a/apps/openmw/mwgui/settingswindow.hpp b/apps/openmw/mwgui/settingswindow.hpp
index d005b28..f45451d 100644
--- a/apps/openmw/mwgui/settingswindow.hpp
+++ b/apps/openmw/mwgui/settingswindow.hpp
@@ -32,6 +32,7 @@ namespace MWGui
void onResChange(int, int) override;
bool onControllerButtonEvent(const SDL_ControllerButtonEvent& arg) override;
+ bool stepTab(int delta) override;
protected:
MyGUI::TabControl* mSettingsTab;
diff --git a/apps/openmw/mwgui/spellwindow.cpp b/apps/openmw/mwgui/spellwindow.cpp
index 356722b..6f4d163 100644
--- a/apps/openmw/mwgui/spellwindow.cpp
+++ b/apps/openmw/mwgui/spellwindow.cpp
@@ -63,9 +63,11 @@ namespace MWGui
int filterWidth = mSpellView->getSize().width - deleteButton->getSize().width - 3;
mFilterEdit->setSize(filterWidth, mFilterEdit->getSize().height);
+ // Isowind: the inventory screen's windows are pages, and only the map can be pinned
+ setPinButtonVisible(false);
+
if (Settings::gui().mControllerMenus)
{
- setPinButtonVisible(false);
mControllerButtons.mA = "#{Interface:Select}";
mControllerButtons.mB = "#{Interface:Back}";
mControllerButtons.mY = "#{sQuickMenuTitle}";
@@ -82,7 +84,9 @@ namespace MWGui
void SpellWindow::onTitleDoubleClicked()
{
- if (Settings::gui().mControllerMenus)
+ // (Isowind: on the inventory screen the window is a page)
+ if (Settings::gui().mControllerMenus
+ || MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Inventory)
return;
else if (MyGUI::InputManager::getInstance().isShiftPressed())
MWBase::Environment::get().getWindowManager()->toggleMaximized(this);
@@ -338,16 +342,18 @@ namespace MWGui
{
MWBase::WindowManager* winMgr = MWBase::Environment::get().getWindowManager();
if (winMgr->getMode() == MWGui::GM_Inventory)
- {
- // Isowind: the windows keep Morrowind's layout (the active one is lit, see WindowBase)
- MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>();
-
- MWBase::Environment::get().getWindowManager()->setControllerTooltipVisible(
- active && Settings::gui().mControllerTooltips);
- }
+ winMgr->setControllerTooltipVisible(active && Settings::gui().mControllerTooltips);
mSpellView->setActiveControllerWindow(active);
WindowBase::setActiveControllerWindow(active);
}
+
+ void SpellWindow::setInventoryPage(bool shown)
+ {
+ // Fill the screen, or limit to a certain size on large screens. Size chosen to
+ // match the size of the stats window.
+ MWBase::Environment::get().getWindowManager()->placeInventoryPage(
+ mMainWidget, StatsWindow::getIdealWidth(), StatsWindow::getIdealHeight(), shown);
+ }
}
diff --git a/apps/openmw/mwgui/spellwindow.hpp b/apps/openmw/mwgui/spellwindow.hpp
index c27ec27..6fe457d 100644
--- a/apps/openmw/mwgui/spellwindow.hpp
+++ b/apps/openmw/mwgui/spellwindow.hpp
@@ -43,6 +43,7 @@ namespace MWGui
void onOpen() override;
bool onControllerButtonEvent(const SDL_ControllerButtonEvent& arg) override;
void setActiveControllerWindow(bool active) override;
+ void setInventoryPage(bool shown) override;
SpellView* mSpellView;
std::unique_ptr<SpellIcons> mSpellIcons;
diff --git a/apps/openmw/mwgui/statswindow.cpp b/apps/openmw/mwgui/statswindow.cpp
index 708a715..7497592 100644
--- a/apps/openmw/mwgui/statswindow.cpp
+++ b/apps/openmw/mwgui/statswindow.cpp
@@ -81,9 +81,11 @@ namespace MWGui
MyGUI::Window* t = mMainWidget->castType<MyGUI::Window>();
t->eventWindowChangeCoord += MyGUI::newDelegate(this, &StatsWindow::onWindowResize);
+ // Isowind: the inventory screen's windows are pages, and only the map can be pinned
+ setPinButtonVisible(false);
+
if (Settings::gui().mControllerMenus)
{
- setPinButtonVisible(false);
mControllerButtons.mLStick = "#{Interface:Mouse}";
mControllerButtons.mRStick = "#{Interface:ScrollDown}";
mControllerButtons.mB = "#{Interface:Back}";
@@ -723,7 +725,9 @@ namespace MWGui
void StatsWindow::onTitleDoubleClicked()
{
- if (Settings::gui().mControllerMenus)
+ // (Isowind: on the inventory screen the window is a page)
+ if (Settings::gui().mControllerMenus
+ || MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Inventory)
return;
else if (MyGUI::InputManager::getInstance().isShiftPressed())
{
@@ -743,18 +747,14 @@ namespace MWGui
return true;
}
- void StatsWindow::setActiveControllerWindow(bool active)
+ void StatsWindow::setInventoryPage(bool shown)
{
- MWBase::WindowManager* winMgr = MWBase::Environment::get().getWindowManager();
- if (winMgr->getMode() == MWGui::GM_Inventory)
- {
- // Isowind: the windows keep Morrowind's layout (the active one is lit, see WindowBase)
- MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>();
-
- if (active)
- onWindowResize(window);
- }
+ // Fill the screen, or limit to a certain size on large screens. Size chosen to
+ // show all stats.
+ MWBase::Environment::get().getWindowManager()->placeInventoryPage(
+ mMainWidget, getIdealWidth(), getIdealHeight(), shown);
- WindowBase::setActiveControllerWindow(active);
+ if (shown)
+ onWindowResize(mMainWidget->castType<MyGUI::Window>());
}
}
diff --git a/apps/openmw/mwgui/statswindow.hpp b/apps/openmw/mwgui/statswindow.hpp
index 0d81901..1dbe874 100644
--- a/apps/openmw/mwgui/statswindow.hpp
+++ b/apps/openmw/mwgui/statswindow.hpp
@@ -53,7 +53,7 @@ namespace MWGui
protected:
bool onControllerButtonEvent(const SDL_ControllerButtonEvent& arg) override;
- void setActiveControllerWindow(bool active) override;
+ void setInventoryPage(bool shown) override;
private:
void addSkills(const std::vector<ESM::RefId>& skills, const std::string& titleId,
diff --git a/apps/openmw/mwgui/tradewindow.cpp b/apps/openmw/mwgui/tradewindow.cpp
index 3acda3f..1bc1b2a 100644
--- a/apps/openmw/mwgui/tradewindow.cpp
+++ b/apps/openmw/mwgui/tradewindow.cpp
@@ -716,33 +716,9 @@ namespace MWGui
dialog->eventOkClicked += MyGUI::newDelegate(this, &TradeWindow::onOfferSubmitted);
}
else if (arg.button == SDL_CONTROLLER_BUTTON_LEFTSHOULDER)
- {
- if (mFilterAll->getStateSelected())
- onFilterChanged(mFilterMisc);
- else if (mFilterWeapon->getStateSelected())
- onFilterChanged(mFilterAll);
- else if (mFilterApparel->getStateSelected())
- onFilterChanged(mFilterWeapon);
- else if (mFilterMagic->getStateSelected())
- onFilterChanged(mFilterApparel);
- else if (mFilterMisc->getStateSelected())
- onFilterChanged(mFilterMagic);
- MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click"));
- }
+ stepTab(-1);
else if (arg.button == SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
- {
- if (mFilterAll->getStateSelected())
- onFilterChanged(mFilterWeapon);
- else if (mFilterWeapon->getStateSelected())
- onFilterChanged(mFilterApparel);
- else if (mFilterApparel->getStateSelected())
- onFilterChanged(mFilterMagic);
- else if (mFilterMagic->getStateSelected())
- onFilterChanged(mFilterMisc);
- else if (mFilterMisc->getStateSelected())
- onFilterChanged(mFilterAll);
- MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click"));
- }
+ stepTab(1);
else if (arg.button == SDL_CONTROLLER_BUTTON_RIGHTSTICK || arg.button == SDL_CONTROLLER_BUTTON_DPAD_UP
|| arg.button == SDL_CONTROLLER_BUTTON_DPAD_DOWN || arg.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT
|| arg.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT)
@@ -767,6 +743,18 @@ namespace MWGui
WindowBase::setActiveControllerWindow(active);
}
+ bool TradeWindow::stepTab(int delta)
+ {
+ const std::vector<MyGUI::Button*> filters
+ = { mFilterAll, mFilterWeapon, mFilterApparel, mFilterMagic, mFilterMisc };
+ size_t selected = 0;
+ while (selected < filters.size() - 1 && !filters[selected]->getStateSelected())
+ ++selected;
+ onFilterChanged(filters[wrap(selected, filters.size(), delta)]);
+ MWBase::Environment::get().getWindowManager()->playSound(ESM::RefId::stringRefId("Menu Click"));
+ return true;
+ }
+
void TradeWindow::updateItemView()
{
mItemView->update();
diff --git a/apps/openmw/mwgui/tradewindow.hpp b/apps/openmw/mwgui/tradewindow.hpp
index 3322f4c..0e1d108 100644
--- a/apps/openmw/mwgui/tradewindow.hpp
+++ b/apps/openmw/mwgui/tradewindow.hpp
@@ -48,6 +48,7 @@ namespace MWGui
bool onControllerButtonEvent(const SDL_ControllerButtonEvent& arg) override;
void setActiveControllerWindow(bool active) override;
+ bool stepTab(int delta) override;
private:
friend class InventoryWindow;
diff --git a/apps/openmw/mwgui/windowbase.hpp b/apps/openmw/mwgui/windowbase.hpp
index f33904b..f67cd02 100644
--- a/apps/openmw/mwgui/windowbase.hpp
+++ b/apps/openmw/mwgui/windowbase.hpp
@@ -103,6 +103,12 @@ namespace MWGui
/// (nullptr if none). By default the text field in this window with the keyboard focus; windows whose text
/// field keeps the focus while the controller works elsewhere say when it is selected.
virtual MyGUI::Widget* getControllerTextField();
+ /// Isowind: on the inventory screen its windows are pages, one on the screen at a time under a tab bar (for
+ /// the mouse and keyboard as for a controller): this one laid out as the page shown, or out of sight
+ virtual void setInventoryPage(bool shown) {}
+ /// Isowind: the keyboard's keys for the tabs inside a window (Z / C, as a controller's triggers) step through
+ /// this window's tabs; false if it has none
+ virtual bool stepTab(int delta) { return false; }
protected:
virtual void onTitleDoubleClicked();
diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp
index 3977520..526dc92 100644
--- a/apps/openmw/mwgui/windowmanagerimp.cpp
+++ b/apps/openmw/mwgui/windowmanagerimp.cpp
@@ -137,26 +137,6 @@
namespace MWGui
{
- namespace
- {
- Settings::SettingValue<bool>* findHiddenSetting(GuiWindow window)
- {
- switch (window)
- {
- case GW_Inventory:
- return &Settings::windows().mInventoryHidden;
- case GW_Map:
- return &Settings::windows().mMapHidden;
- case GW_Magic:
- return &Settings::windows().mSpellsHidden;
- case GW_Stats:
- return &Settings::windows().mStatsHidden;
- default:
- return nullptr;
- }
- }
- }
-
WindowManager::WindowManager(SDL_Window* window, osgViewer::Viewer* viewer, osg::Group* guiRoot,
Resource::ResourceSystem* resourceSystem, SceneUtil::WorkQueue* workQueue, const std::filesystem::path& logpath,
bool consoleOnlyScripts, Translation::Storage& translationDataStorage, ToUTF8::FromType encoding,
@@ -701,12 +681,12 @@ namespace MWGui
mSpellWindow->setVisible(
mSpellWindow->pinned() && !isConsoleMode() && !(mForceHidden & GW_Magic) && (mAllowed & GW_Magic));
+ if (mInventoryTabsOverlay)
+ mInventoryTabsOverlay->setVisible(false);
if (Settings::gui().mControllerMenus)
{
if (mControllerButtonsOverlay)
mControllerButtonsOverlay->setVisible(false);
- if (mInventoryTabsOverlay)
- mInventoryTabsOverlay->setVisible(false);
// Isowind: out of the menus no window is dimmed (the pinned map shows on the HUD)
for (WindowBase* window : { static_cast<WindowBase*>(mMap), static_cast<WindowBase*>(mStatsWindow),
static_cast<WindowBase*>(mInventoryWindow), static_cast<WindowBase*>(mSpellWindow) })
@@ -743,6 +723,8 @@ namespace MWGui
mInventoryWindow->setVisible(eff & GW_Inventory);
mSpellWindow->setVisible(eff & GW_Magic);
mStatsWindow->setVisible(eff & GW_Stats);
+ // Isowind: they are pages (one opened just now goes below the screen, or is the page shown)
+ layoutInventoryPages();
}
updateControllerButtonsOverlay();
@@ -966,9 +948,15 @@ namespace MWGui
return nullptr;
}
+ bool WindowManager::hasActiveControllerWindow() const
+ {
+ // Isowind: the inventory screen's pages go by it for the mouse and keyboard too
+ return !mGuiModes.empty() && (Settings::gui().mControllerMenus || mGuiModes.back() == GM_Inventory);
+ }
+
void WindowManager::cycleActiveControllerWindow(bool next)
{
- if (!Settings::gui().mControllerMenus || mGuiModes.empty())
+ if (!hasActiveControllerWindow())
return;
GuiMode mode = mGuiModes.back();
@@ -995,10 +983,15 @@ namespace MWGui
void WindowManager::reapplyActiveControllerWindow()
{
- if (!Settings::gui().mControllerMenus || mGuiModes.empty())
+ if (!hasActiveControllerWindow())
return;
const GuiMode mode = mGuiModes.back();
+ if (mode == GM_Inventory)
+ layoutInventoryPages();
+ if (!Settings::gui().mControllerMenus)
+ return;
+
size_t winCount = mGuiModeStates[mode].mWindows.size();
for (size_t i = 0; i < winCount; i++)
@@ -1013,7 +1006,7 @@ namespace MWGui
void WindowManager::setActiveControllerWindow(GuiMode mode, size_t activeIndex)
{
- if (!Settings::gui().mControllerMenus)
+ if (!Settings::gui().mControllerMenus && mode != GM_Inventory)
return;
size_t winCount = mGuiModeStates[mode].mWindows.size();
@@ -1025,20 +1018,45 @@ namespace MWGui
reapplyActiveControllerWindow();
- MWBase::Environment::get().getInputManager()->setGamepadGuiCursorEnabled(
- mGuiModeStates[mode].mWindows[activeIndex]->isGamepadCursorAllowed());
+ if (Settings::gui().mControllerMenus)
+ MWBase::Environment::get().getInputManager()->setGamepadGuiCursorEnabled(
+ mGuiModeStates[mode].mWindows[activeIndex]->isGamepadCursorAllowed());
WindowBase* activeWindow = mGuiModeStates[mode].mWindows[activeIndex];
if (activeWindow->isVisible())
MyGUI::LayerManager::getInstance().upLayerItem(activeWindow->mMainWidget);
updateControllerButtonsOverlay();
- setCursorActive(false);
+ // Isowind: the mouse pointer stays for the mouse and keyboard's tab bar (a page clicked or keyed to)
+ if (Settings::gui().mControllerMenus && MWBase::Environment::get().getInputManager()->joystickLastUsed())
+ setCursorActive(false);
if (winCount > 1)
playSound(ESM::RefId::stringRefId("Menu Size"));
}
+ void WindowManager::layoutInventoryPages()
+ {
+ const std::vector<WindowBase*>& pages = mGuiModeStates[GM_Inventory].mWindows;
+ for (size_t i = 0; i < pages.size(); ++i)
+ pages[i]->setInventoryPage(i == mActiveControllerWindows[GM_Inventory]);
+ }
+
+ void WindowManager::placeInventoryPage(MyGUI::Widget* window, int width, int height, bool shown)
+ {
+ // Centred between the tab bar and, with a controller, the legend of its buttons along the bottom
+ const MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
+ const int top = mInventoryTabsOverlay->getHeight();
+ int room = viewSize.height - top;
+ if (Settings::gui().mControllerMenus)
+ room -= mControllerButtonsOverlay->getHeight();
+ width = std::min(width, viewSize.width);
+ height = std::min(height, room);
+ // The pages not shown wait below the screen, still open (the tabs go through the open ones)
+ const int y = shown ? top + (room - height) / 2 : viewSize.height + 1;
+ window->setCoord((viewSize.width - width) / 2, y, width, height);
+ }
+
void WindowManager::update(float frameDuration)
{
handleScheduledMessageBoxes();
@@ -1511,7 +1529,7 @@ namespace MWGui
updateVisible();
MWBase::Environment::get().getLuaManager()->uiModeChanged(arg);
- if (Settings::gui().mControllerMenus)
+ if (hasActiveControllerWindow())
{
if (mode == GM_Container)
{
@@ -1523,7 +1541,11 @@ namespace MWGui
// Activate first visible window. This needs to be called after updateVisible.
if (mActiveControllerWindows[mode] != 0)
mActiveControllerWindows[mode] = mActiveControllerWindows[mode] - 1;
+ const size_t from = mActiveControllerWindows[mode];
cycleActiveControllerWindow(true);
+ // Isowind: the inventory screen's pages laid out even with no other one open to go on to
+ if (mode == GM_Inventory && mActiveControllerWindows[mode] == from)
+ setActiveControllerWindow(mode, from);
}
}
}
@@ -1581,17 +1603,14 @@ namespace MWGui
if (mConsole && mConsole->isVisible())
mConsole->onOpen();
- if (Settings::gui().mControllerMenus)
+ if (Settings::gui().mControllerMenus && mGuiModes.empty())
{
- if (mGuiModes.empty())
- {
- setControllerTooltipVisible(false);
- // When all windows are hidden, reset tooltip visibility to user's preference.
- mControllerTooltipEnabled = Settings::gui().mControllerTooltips;
- }
- else
- reapplyActiveControllerWindow();
+ setControllerTooltipVisible(false);
+ // When all windows are hidden, reset tooltip visibility to user's preference.
+ mControllerTooltipEnabled = Settings::gui().mControllerTooltips;
}
+ else
+ reapplyActiveControllerWindow();
}
void WindowManager::removeGuiMode(GuiMode mode)
@@ -1786,11 +1805,30 @@ namespace MWGui
if (getMode() != GM_Inventory)
return;
- if (Settings::SettingValue<bool>* const hidden = findHiddenSetting(wnd))
- hidden->set(!hidden->get());
-
- mShown = (GuiWindow)(mShown ^ wnd);
- updateVisible();
+ // Isowind: the inventory screen's windows are pages, none of them closed: the HUD's map, bars, weapon and
+ // spell each go to theirs
+ WindowBase* page = nullptr;
+ switch (wnd)
+ {
+ case GW_Map:
+ page = mMap;
+ break;
+ case GW_Inventory:
+ page = mInventoryWindow;
+ break;
+ case GW_Magic:
+ page = mSpellWindow;
+ break;
+ case GW_Stats:
+ page = mStatsWindow;
+ break;
+ default:
+ return;
+ }
+ const std::vector<WindowBase*>& pages = mGuiModeStates[GM_Inventory].mWindows;
+ const auto found = std::find(pages.begin(), pages.end(), page);
+ if (found != pages.end() && page->isVisible())
+ setActiveControllerWindow(GM_Inventory, static_cast<size_t>(found - pages.begin()));
}
void WindowManager::forceHide(GuiWindow wnd)
@@ -2125,6 +2163,13 @@ namespace MWGui
&& (window == mStatsWindow->mMainWidget->castType<MyGUI::Window>()
|| window == mSpellWindow->mMainWidget->castType<MyGUI::Window>()))
return;
+ // Isowind: nor the places of the inventory screen's pages (the map keeps where it is pinned)
+ if (getMode() == GM_Inventory)
+ {
+ for (const WindowBase* page : mGuiModeStates[GM_Inventory].mWindows)
+ if (window == page->mMainWidget)
+ return;
+ }
const auto it = mTrackedWindows.find(window);
if (it == mTrackedWindows.end())
@@ -2371,31 +2416,12 @@ namespace MWGui
void WindowManager::updatePinnedWindows()
{
- if (Settings::gui().mControllerMenus)
- {
- // In controller mode, don't hide any menus and only allow pinning the map.
- mInventoryWindow->setPinned(false);
- mMap->setPinned(Settings::windows().mMapPin);
- mSpellWindow->setPinned(false);
- mStatsWindow->setPinned(false);
- return;
- }
-
- mInventoryWindow->setPinned(Settings::windows().mInventoryPin);
- if (Settings::windows().mInventoryHidden)
- mShown = (GuiWindow)(mShown ^ GW_Inventory);
-
+ // Isowind: the inventory screen's windows are pages, for the mouse and keyboard as in controller mode, so
+ // none of them is hidden and only the map can be pinned
+ mInventoryWindow->setPinned(false);
mMap->setPinned(Settings::windows().mMapPin);
- if (Settings::windows().mMapHidden)
- mShown = (GuiWindow)(mShown ^ GW_Map);
-
- mSpellWindow->setPinned(Settings::windows().mSpellsPin);
- if (Settings::windows().mSpellsHidden)
- mShown = (GuiWindow)(mShown ^ GW_Magic);
-
- mStatsWindow->setPinned(Settings::windows().mStatsPin);
- if (Settings::windows().mStatsHidden)
- mShown = (GuiWindow)(mShown ^ GW_Stats);
+ mSpellWindow->setPinned(false);
+ mStatsWindow->setPinned(false);
}
void WindowManager::pinWindow(GuiWindow window)
@@ -2762,10 +2788,71 @@ namespace MWGui
return true;
}
+ bool WindowManager::injectTabKey(MyGUI::KeyCode key)
+ {
+ int delta = 0;
+ bool page = false;
+ switch (key.getValue())
+ {
+ case MyGUI::KeyCode::Q:
+ case MyGUI::KeyCode::E:
+ page = true;
+ delta = key == MyGUI::KeyCode::E ? 1 : -1;
+ break;
+ case MyGUI::KeyCode::Z:
+ case MyGUI::KeyCode::C:
+ delta = key == MyGUI::KeyCode::C ? 1 : -1;
+ break;
+ default:
+ return false;
+ }
+ if (isTextField(MyGUI::InputManager::getInstance().getKeyFocusWidget()) || !mCurrentModals.empty()
+ || isConsoleMode())
+ return false;
+
+ // Turning pages, as the controller's bumpers do: Options' tabs, the inventory screen's pages
+ if (page)
+ {
+ if (!isSettingsWindowVisible() && getMode() != GM_Inventory)
+ return false;
+ // (the pointer stays, as the keyboard has it: see setActiveControllerWindow)
+ MWBase::Environment::get().getInputManager()->setJoystickLastUsed(false);
+ if (isSettingsWindowVisible())
+ return mSettingsWindow->stepTab(delta);
+ cycleActiveControllerWindow(delta > 0);
+ return true;
+ }
+
+ // The tabs inside a window, as the controller's triggers do: the window's under the pointer, or else the
+ // first one open with tabs
+ if (mGuiModes.empty() || isSettingsWindowVisible())
+ return false;
+ const std::vector<WindowBase*>& windows = mGuiModeStates[mGuiModes.back()].mWindows;
+ MyGUI::Widget* underPointer = MyGUI::InputManager::getInstance().getMouseFocusWidget();
+ while (underPointer && underPointer->getParent())
+ underPointer = underPointer->getParent();
+ std::vector<WindowBase*> order;
+ for (WindowBase* window : windows)
+ if (window->mMainWidget == underPointer)
+ order.push_back(window);
+ order.insert(order.end(), windows.begin(), windows.end());
+ for (WindowBase* window : order)
+ {
+ // The inventory screen's pages not shown are open too, below the screen
+ if (!window->isVisible() || (getMode() == GM_Inventory && window != getActiveControllerWindow()))
+ continue;
+ if (window->stepTab(delta))
+ return true;
+ }
+ return false;
+ }
+
bool WindowManager::injectKeyPress(MyGUI::KeyCode key, unsigned int text, bool repeat)
{
if (!repeat && assignHoveredToQuickKey(key))
return true;
+ if (!repeat && injectTabKey(key))
+ return true;
if (!mKeyboardNavigation->injectKeyPress(key, text, repeat))
{
MyGUI::Widget* focus = MyGUI::InputManager::getInstance().getKeyFocusWidget();
@@ -2926,6 +3013,8 @@ namespace MWGui
void WindowManager::updateControllerButtonsOverlay()
{
+ updateInventoryTabs();
+
if (!Settings::gui().mControllerMenus || !mControllerButtonsOverlay)
return;
@@ -2936,7 +3025,6 @@ namespace MWGui
if (!topWin || !topWin->isVisible())
{
mControllerButtonsOverlay->setVisible(false);
- mInventoryTabsOverlay->setVisible(false);
return;
}
@@ -2946,13 +3034,23 @@ namespace MWGui
if (!isOnScreenKeyboardVisible() && topWin->getControllerTextField())
buttons.mX = "#{OMWEngine:Keyboard}";
mControllerButtonsOverlay->setButtons(&buttons);
- if (getMode() == GM_Inventory)
- {
- mInventoryTabsOverlay->setVisible(true);
- mInventoryTabsOverlay->setTab(mActiveControllerWindows[GM_Inventory]);
- }
- else
- mInventoryTabsOverlay->setVisible(false);
+ }
+
+ void WindowManager::updateInventoryTabs()
+ {
+ if (!mInventoryTabsOverlay)
+ return;
+
+ // Isowind: the inventory screen's tab bar, for the mouse and keyboard as for a controller, with a tab for each
+ // page open (character creation opens them one by one)
+ const bool shown = !mGuiModes.empty() && mGuiModes.back() == GM_Inventory;
+ mInventoryTabsOverlay->setVisible(shown);
+ if (!shown)
+ return;
+ const std::vector<WindowBase*>& pages = mGuiModeStates[GM_Inventory].mWindows;
+ for (size_t i = 0; i < pages.size(); ++i)
+ mInventoryTabsOverlay->setTabAvailable(i, pages[i]->isVisible());
+ mInventoryTabsOverlay->setTab(mActiveControllerWindows[GM_Inventory]);
}
bool WindowManager::isOnScreenKeyboardVisible() const
diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp
index 0f6ed17..cb84b03 100644
--- a/apps/openmw/mwgui/windowmanagerimp.hpp
+++ b/apps/openmw/mwgui/windowmanagerimp.hpp
@@ -394,6 +394,9 @@ namespace MWGui
bool injectKeyPress(MyGUI::KeyCode key, unsigned int text, bool repeat = false) override;
/// Isowind: 1 to 0 pressed over an item or spell in the inventory menus puts it on that quick key
bool assignHoveredToQuickKey(MyGUI::KeyCode key);
+ /// Isowind: Q / E turn the pages (the inventory screen's, Options' tabs) and Z / C the tabs inside a window,
+ /// as a controller's bumpers and triggers do
+ bool injectTabKey(MyGUI::KeyCode key);
bool injectKeyRelease(MyGUI::KeyCode key) override;
const std::string& getVersionDescription() const override;
@@ -413,6 +416,7 @@ namespace MWGui
void setControllerTooltipEnabled(bool enabled) override;
void restoreControllerTooltips() override;
void updateControllerButtonsOverlay() override;
+ void placeInventoryPage(MyGUI::Widget* window, int width, int height, bool shown) override;
bool isOnScreenKeyboardVisible() const override;
void openOnScreenKeyboard() override;
@@ -541,6 +545,11 @@ namespace MWGui
bool mControllerTooltipEnabled = false;
void reapplyActiveControllerWindow();
+ /// Whether the top mode's windows go by an active one: in controller mode, and (Isowind) on the inventory
+ /// screen, whose pages are its windows
+ bool hasActiveControllerWindow() const;
+ void layoutInventoryPages();
+ void updateInventoryTabs();
std::unique_ptr<SDLUtil::SDLCursorManager> mCursorManager;
diff --git a/files/data/mygui/openmw_inventory_tabs.layout b/files/data/mygui/openmw_inventory_tabs.layout
index d13361d..d142bda 100644
--- a/files/data/mygui/openmw_inventory_tabs.layout
+++ b/files/data/mygui/openmw_inventory_tabs.layout
@@ -15,6 +15,15 @@
<Property key="Colour" value="#ccb589"/>
<Property key="Alpha" value="0.7"/>
</Widget>
+ <!-- Isowind: the keys for the tabs, without a controller -->
+ <Widget type="AutoSizedTextBox" skin="SandText" align="Center" name="KeyPrevText">
+ <Property key="Caption" value="Q"/>
+ <Property key="TextShadow" value="true"/>
+ <Property key="TextShadowColour" value="0 0 0"/>
+ <Property key="Alpha" value="0.7"/>
+ <Property key="Visible" value="false"/>
+ <UserString key="Hidden" value="true"/>
+ </Widget>
<Widget type="Button" skin="SandTextButton" align="Center" position="0 0 100 48" name="TabMap">
<Property key="Caption" value="#{sMap}"/>
<Property key="TextAlign" value="Center"/>
@@ -39,6 +48,14 @@
<Property key="TextShadow" value="true"/>
<Property key="TextShadowColour" value="0 0 0"/>
</Widget>
+ <Widget type="AutoSizedTextBox" skin="SandText" align="Center" name="KeyNextText">
+ <Property key="Caption" value="E"/>
+ <Property key="TextShadow" value="true"/>
+ <Property key="TextShadowColour" value="0 0 0"/>
+ <Property key="Alpha" value="0.7"/>
+ <Property key="Visible" value="false"/>
+ <UserString key="Hidden" value="true"/>
+ </Widget>
<Widget type="ImageBox" skin="ImageBox" align="Stretch" position="0 0 24 24" name="BtnR2Image">
<Property key="ImageTexture" value="textures\omw_steam_button_r2.dds"/>
<Property key="Colour" value="#ccb589"/>
diff --git a/isowind/README.txt b/isowind/README.txt
index a93cd6f..5047116 100644
--- a/isowind/README.txt
+++ b/isowind/README.txt
@@ -114,6 +114,12 @@ E Use what is under the cursor, or the nearest thing in front of
Space Jump
F / R Ready weapon / ready magic
Tab Inventory
+Q / E In the menus: the previous / next page of the inventory screen (Map, Inventory,
+ Magic, Stats), or tab in Options. Click a page's tab along the top, or what it
+ stands for on the HUD (the bars, the weapon, the spell, the minimap), to go to it.
+Z / C In the menus: the previous / next tab inside a window - the kinds of item in the
+ inventory or a shop, a chest's containers opened together, the local or world map.
+ With a chest or shop open, the window under the pointer.
Mouse wheel Zoom, within the view you are in.
F7 Switch view: top-down, then Morrowind's third person view, then first person. Change the
key, or add a controller button for it, in Options > Scripts > Isowind (with a controller:
@@ -132,10 +138,11 @@ D-pad left (nothing for now)
D-pad right Quest log Start Menu
Back Inventory (hold: journal)
Left stick in Sneak Right stick in Rest
-Menus are made for the controller: the D-pad and A choose, B goes back, and where several windows are open
-side by side (the inventory screen, a chest, a shop) the bumpers switch between them, the one in use lit,
-while the triggers switch the tabs within a window. The right stick pressed in shows an item's info, and in
-the inventory and magic windows Y puts the item or spell on a quick key. In Options the bumpers switch tabs,
+Menus are made for the controller: the D-pad and A choose, B goes back, the bumpers switch the inventory
+screen's pages (Map, Inventory, Magic, Stats; one at a time, as with the mouse and keyboard) and, where two
+windows are open side by side (a chest, a shop), between them, the one in use lit, while the triggers switch
+the tabs within a window. The right stick pressed in shows an item's info, and in the inventory and magic
+windows Y puts the item or spell on a quick key. In Options the bumpers switch tabs,
the D-pad steps a pointer through the settings (up / down) and adjusts the one it is on (left / right), and A
works it, on the Scripts tab's pages too. The legend along the bottom of each menu says what the buttons do
there. To type something (your name, a server's password, a save's, potion's, spell's or class's name, a map
diff --git a/isowind/mod/scripts/isowind/topdown.lua b/isowind/mod/scripts/isowind/topdown.lua
index bb7f812..5d1dda2 100644
--- a/isowind/mod/scripts/isowind/topdown.lua
+++ b/isowind/mod/scripts/isowind/topdown.lua
@@ -29,8 +29,10 @@
-- there the ring and label stay on what X uses (friendly people, doors, containers and their locks), but the aim
-- never locks onto those. A lockpick or probe never locks on, and looks for doors and containers first.
-- The menus are the engine's controller menus ('controller menus' in the profile's settings.cfg): D-pad and A / B,
--- the triggers switch pages, Y puts an item or spell on a quick key, and X on a text field (moved onto with the
--- D-pad) brings up a keyboard on the screen to type with; it never comes up by itself.
+-- the bumpers switch the inventory screen's pages and the triggers the tabs inside a window, Y puts an item or spell
+-- on a quick key, and X on a text field (moved onto with the D-pad) brings up a keyboard on the screen to type with;
+-- it never comes up by itself. The inventory screen's map, inventory, magic and stats are pages, one at a time under a
+-- tab bar, with the mouse and keyboard too: Q / E turn its pages (and Options' tabs), Z / C the tabs inside a window.
--
-- The zoom distance says the view: TOPDOWN_FROM or farther is this top-down view; in closer, Morrowind's third person
-- view at that distance; closer than FIRST_PERSON_BELOW, first person. Zooming stays within the view's range and the