settings window (hotkey F2) which does nothing. Yay!

actorid
scrawl 13 years ago
parent b25d62a7e2
commit 313294c522

@ -27,7 +27,7 @@ add_openmw_dir (mwgui
text_input widgets race class birth review window_manager console dialogue text_input widgets race class birth review window_manager console dialogue
dialogue_history window_base stats_window messagebox journalwindow charactercreation dialogue_history window_base stats_window messagebox journalwindow charactercreation
map_window window_pinnable_base cursorreplace tooltips scrollwindow bookwindow list map_window window_pinnable_base cursorreplace tooltips scrollwindow bookwindow list
formatting itemwidget inventorywindow container hud countdialog tradewindow formatting itemwidget inventorywindow container hud countdialog tradewindow settingswindow
) )
add_openmw_dir (mwdialogue add_openmw_dir (mwdialogue

@ -6,6 +6,7 @@ namespace MWGui
enum GuiMode enum GuiMode
{ {
GM_Game, // Game mode, only HUD GM_Game, // Game mode, only HUD
GM_Settings, // Settings window
GM_Inventory, // Inventory mode GM_Inventory, // Inventory mode
GM_Container, GM_Container,
GM_MainMenu, // Main menu mode GM_MainMenu, // Main menu mode

@ -0,0 +1,25 @@
#include "settingswindow.hpp"
#include "window_manager.hpp"
namespace MWGui
{
SettingsWindow::SettingsWindow(WindowManager& parWindowManager) :
WindowBase("openmw_settings_window_layout.xml", parWindowManager)
{
getWidget(mOkButton, "OkButton");
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onOkButtonClicked);
center();
int okSize = mOkButton->getTextSize().width + 24;
mOkButton->setCoord(mMainWidget->getWidth()-16-okSize, mOkButton->getTop(),
okSize, mOkButton->getHeight());
}
void SettingsWindow::onOkButtonClicked(MyGUI::Widget* _sender)
{
mWindowManager.setGuiMode(GM_Game);
}
}

@ -0,0 +1,26 @@
#ifndef MWGUI_SETTINGS_H
#define MWGUI_SETTINGS_H
#include "window_base.hpp"
namespace MWGui
{
class WindowManager;
}
namespace MWGui
{
class SettingsWindow : public WindowBase
{
public:
SettingsWindow(WindowManager& parWindowManager);
protected:
MyGUI::Button* mOkButton;
void onOkButtonClicked(MyGUI::Widget* _sender);
};
}
#endif

@ -16,6 +16,7 @@
#include "mainmenu.hpp" #include "mainmenu.hpp"
#include "countdialog.hpp" #include "countdialog.hpp"
#include "tradewindow.hpp" #include "tradewindow.hpp"
#include "settingswindow.hpp"
#include "../mwmechanics/mechanicsmanager.hpp" #include "../mwmechanics/mechanicsmanager.hpp"
#include "../mwinput/inputmanager.hpp" #include "../mwinput/inputmanager.hpp"
@ -45,11 +46,12 @@ WindowManager::WindowManager(
, mMessageBoxManager(NULL) , mMessageBoxManager(NULL)
, console(NULL) , console(NULL)
, mJournal(NULL) , mJournal(NULL)
, mDialogueWindow(nullptr) , mDialogueWindow(NULL)
, mBookWindow(NULL) , mBookWindow(NULL)
, mScrollWindow(NULL) , mScrollWindow(NULL)
, mCountDialog(NULL) , mCountDialog(NULL)
, mTradeWindow(NULL) , mTradeWindow(NULL)
, mSettingsWindow(NULL)
, mCharGen(NULL) , mCharGen(NULL)
, playerClass() , playerClass()
, playerName() , playerName()
@ -118,6 +120,7 @@ WindowManager::WindowManager(
mScrollWindow = new ScrollWindow(*this); mScrollWindow = new ScrollWindow(*this);
mBookWindow = new BookWindow(*this); mBookWindow = new BookWindow(*this);
mCountDialog = new CountDialog(*this); mCountDialog = new CountDialog(*this);
mSettingsWindow = new SettingsWindow(*this);
// The HUD is always on // The HUD is always on
hud->setVisible(true); hud->setVisible(true);
@ -217,6 +220,7 @@ void WindowManager::updateVisible()
mScrollWindow->setVisible(false); mScrollWindow->setVisible(false);
mBookWindow->setVisible(false); mBookWindow->setVisible(false);
mTradeWindow->setVisible(false); mTradeWindow->setVisible(false);
mSettingsWindow->setVisible(false);
// Mouse is visible whenever we're not in game mode // Mouse is visible whenever we're not in game mode
MyGUI::PointerManager::getInstance().setVisible(isGuiMode()); MyGUI::PointerManager::getInstance().setVisible(isGuiMode());
@ -233,6 +237,9 @@ void WindowManager::updateVisible()
case GM_MainMenu: case GM_MainMenu:
menu->setVisible(true); menu->setVisible(true);
break; break;
case GM_Settings:
mSettingsWindow->setVisible(true);
break;
case GM_Console: case GM_Console:
console->enable(); console->enable();
break; break;

@ -77,6 +77,7 @@ namespace MWGui
class MessageBoxManager; class MessageBoxManager;
class CountDialog; class CountDialog;
class TradeWindow; class TradeWindow;
class SettingsWindow;
struct ClassPoint struct ClassPoint
{ {
@ -230,6 +231,7 @@ namespace MWGui
BookWindow* mBookWindow; BookWindow* mBookWindow;
CountDialog* mCountDialog; CountDialog* mCountDialog;
TradeWindow* mTradeWindow; TradeWindow* mTradeWindow;
SettingsWindow* mSettingsWindow;
CharacterCreation* mCharGen; CharacterCreation* mCharGen;

@ -71,6 +71,8 @@ namespace MWInput
A_ToggleFps, // Toggle FPS display (this is temporary) A_ToggleFps, // Toggle FPS display (this is temporary)
A_Settings, // Temporary hotkey
A_LAST // Marker for the last item A_LAST // Marker for the last item
}; };
@ -140,6 +142,16 @@ namespace MWInput
windows.messageBox ("Screenshot saved", empty); windows.messageBox ("Screenshot saved", empty);
} }
void showSettings()
{
if (mDragDrop)
return;
MWGui::GuiMode mode = windows.getMode();
if (mode != MWGui::GM_Settings)
setGuiMode(MWGui::GM_Settings);
}
/* toggleInventory() is called when the user presses the button to toggle the inventory screen. */ /* toggleInventory() is called when the user presses the button to toggle the inventory screen. */
void toggleInventory() void toggleInventory()
{ {
@ -261,6 +273,8 @@ namespace MWInput
"Ready hands"); "Ready hands");
disp->funcs.bind(A_ToggleFps, boost::bind(&InputImpl::toggleFps, this), disp->funcs.bind(A_ToggleFps, boost::bind(&InputImpl::toggleFps, this),
"Toggle FPS display"); "Toggle FPS display");
disp->funcs.bind(A_Settings, boost::bind(&InputImpl::showSettings, this),
"Show settings window");
// Add the exit listener // Add the exit listener
ogre.getRoot()->addFrameListener(&exit); ogre.getRoot()->addFrameListener(&exit);
@ -308,6 +322,7 @@ namespace MWInput
disp->bind(A_ToggleWeapon,KC_F); disp->bind(A_ToggleWeapon,KC_F);
disp->bind(A_ToggleSpell,KC_R); disp->bind(A_ToggleSpell,KC_R);
disp->bind(A_ToggleFps, KC_F10); disp->bind(A_ToggleFps, KC_F10);
disp->bind(A_Settings, KC_F2);
// Key bindings for polled keys // Key bindings for polled keys
// NOTE: These keys are constantly being polled. Only add keys that must be checked each frame. // NOTE: These keys are constantly being polled. Only add keys that must be checked each frame.

@ -57,6 +57,7 @@ configure_file("${SDIR}/openmw_scroll_skin.xml" "${DDIR}/openmw_scroll_skin.xml"
configure_file("${SDIR}/openmw_book_layout.xml" "${DDIR}/openmw_book_layout.xml" COPYONLY) configure_file("${SDIR}/openmw_book_layout.xml" "${DDIR}/openmw_book_layout.xml" COPYONLY)
configure_file("${SDIR}/openmw_count_window_layout.xml" "${DDIR}/openmw_count_window_layout.xml" COPYONLY) configure_file("${SDIR}/openmw_count_window_layout.xml" "${DDIR}/openmw_count_window_layout.xml" COPYONLY)
configure_file("${SDIR}/openmw_trade_window_layout.xml" "${DDIR}/openmw_trade_window_layout.xml" COPYONLY) configure_file("${SDIR}/openmw_trade_window_layout.xml" "${DDIR}/openmw_trade_window_layout.xml" COPYONLY)
configure_file("${SDIR}/openmw_settings_window_layout.xml" "${DDIR}/openmw_settings_window_layout.xml" COPYONLY)
configure_file("${SDIR}/atlas1.cfg" "${DDIR}/atlas1.cfg" COPYONLY) configure_file("${SDIR}/atlas1.cfg" "${DDIR}/atlas1.cfg" COPYONLY)
configure_file("${SDIR}/smallbars.png" "${DDIR}/smallbars.png" COPYONLY) configure_file("${SDIR}/smallbars.png" "${DDIR}/smallbars.png" COPYONLY)
configure_file("${SDIR}/transparent.png" "${DDIR}/transparent.png" COPYONLY) configure_file("${SDIR}/transparent.png" "${DDIR}/transparent.png" COPYONLY)

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 390 390" name="_Main">
<Widget type="Widget" skin="MW_Box" position="8 8 368 340" align="Left Top">
</Widget>
<Widget type="Button" skin="MW_Button" position="0 351 60 24" name="OkButton" align="Right Bottom">
<Property key="Caption" value="#{sOk}"/>
</Widget>
</Widget>
</MyGUI>
Loading…
Cancel
Save