mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 01:49:41 +00:00
settings window (hotkey F2) which does nothing. Yay!
This commit is contained in:
parent
b25d62a7e2
commit
313294c522
9 changed files with 93 additions and 2 deletions
|
@ -27,7 +27,7 @@ add_openmw_dir (mwgui
|
|||
text_input widgets race class birth review window_manager console dialogue
|
||||
dialogue_history window_base stats_window messagebox journalwindow charactercreation
|
||||
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
|
||||
|
|
|
@ -6,6 +6,7 @@ namespace MWGui
|
|||
enum GuiMode
|
||||
{
|
||||
GM_Game, // Game mode, only HUD
|
||||
GM_Settings, // Settings window
|
||||
GM_Inventory, // Inventory mode
|
||||
GM_Container,
|
||||
GM_MainMenu, // Main menu mode
|
||||
|
|
25
apps/openmw/mwgui/settingswindow.cpp
Normal file
25
apps/openmw/mwgui/settingswindow.cpp
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
26
apps/openmw/mwgui/settingswindow.hpp
Normal file
26
apps/openmw/mwgui/settingswindow.hpp
Normal file
|
@ -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 "countdialog.hpp"
|
||||
#include "tradewindow.hpp"
|
||||
#include "settingswindow.hpp"
|
||||
|
||||
#include "../mwmechanics/mechanicsmanager.hpp"
|
||||
#include "../mwinput/inputmanager.hpp"
|
||||
|
@ -45,11 +46,12 @@ WindowManager::WindowManager(
|
|||
, mMessageBoxManager(NULL)
|
||||
, console(NULL)
|
||||
, mJournal(NULL)
|
||||
, mDialogueWindow(nullptr)
|
||||
, mDialogueWindow(NULL)
|
||||
, mBookWindow(NULL)
|
||||
, mScrollWindow(NULL)
|
||||
, mCountDialog(NULL)
|
||||
, mTradeWindow(NULL)
|
||||
, mSettingsWindow(NULL)
|
||||
, mCharGen(NULL)
|
||||
, playerClass()
|
||||
, playerName()
|
||||
|
@ -118,6 +120,7 @@ WindowManager::WindowManager(
|
|||
mScrollWindow = new ScrollWindow(*this);
|
||||
mBookWindow = new BookWindow(*this);
|
||||
mCountDialog = new CountDialog(*this);
|
||||
mSettingsWindow = new SettingsWindow(*this);
|
||||
|
||||
// The HUD is always on
|
||||
hud->setVisible(true);
|
||||
|
@ -217,6 +220,7 @@ void WindowManager::updateVisible()
|
|||
mScrollWindow->setVisible(false);
|
||||
mBookWindow->setVisible(false);
|
||||
mTradeWindow->setVisible(false);
|
||||
mSettingsWindow->setVisible(false);
|
||||
|
||||
// Mouse is visible whenever we're not in game mode
|
||||
MyGUI::PointerManager::getInstance().setVisible(isGuiMode());
|
||||
|
@ -233,6 +237,9 @@ void WindowManager::updateVisible()
|
|||
case GM_MainMenu:
|
||||
menu->setVisible(true);
|
||||
break;
|
||||
case GM_Settings:
|
||||
mSettingsWindow->setVisible(true);
|
||||
break;
|
||||
case GM_Console:
|
||||
console->enable();
|
||||
break;
|
||||
|
|
|
@ -77,6 +77,7 @@ namespace MWGui
|
|||
class MessageBoxManager;
|
||||
class CountDialog;
|
||||
class TradeWindow;
|
||||
class SettingsWindow;
|
||||
|
||||
struct ClassPoint
|
||||
{
|
||||
|
@ -230,6 +231,7 @@ namespace MWGui
|
|||
BookWindow* mBookWindow;
|
||||
CountDialog* mCountDialog;
|
||||
TradeWindow* mTradeWindow;
|
||||
SettingsWindow* mSettingsWindow;
|
||||
|
||||
CharacterCreation* mCharGen;
|
||||
|
||||
|
|
|
@ -71,6 +71,8 @@ namespace MWInput
|
|||
|
||||
A_ToggleFps, // Toggle FPS display (this is temporary)
|
||||
|
||||
A_Settings, // Temporary hotkey
|
||||
|
||||
A_LAST // Marker for the last item
|
||||
};
|
||||
|
||||
|
@ -140,6 +142,16 @@ namespace MWInput
|
|||
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. */
|
||||
void toggleInventory()
|
||||
{
|
||||
|
@ -261,6 +273,8 @@ namespace MWInput
|
|||
"Ready hands");
|
||||
disp->funcs.bind(A_ToggleFps, boost::bind(&InputImpl::toggleFps, this),
|
||||
"Toggle FPS display");
|
||||
disp->funcs.bind(A_Settings, boost::bind(&InputImpl::showSettings, this),
|
||||
"Show settings window");
|
||||
// Add the exit listener
|
||||
ogre.getRoot()->addFrameListener(&exit);
|
||||
|
||||
|
@ -308,6 +322,7 @@ namespace MWInput
|
|||
disp->bind(A_ToggleWeapon,KC_F);
|
||||
disp->bind(A_ToggleSpell,KC_R);
|
||||
disp->bind(A_ToggleFps, KC_F10);
|
||||
disp->bind(A_Settings, KC_F2);
|
||||
|
||||
// Key bindings for polled keys
|
||||
// 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_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_settings_window_layout.xml" "${DDIR}/openmw_settings_window_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/atlas1.cfg" "${DDIR}/atlas1.cfg" COPYONLY)
|
||||
configure_file("${SDIR}/smallbars.png" "${DDIR}/smallbars.png" COPYONLY)
|
||||
configure_file("${SDIR}/transparent.png" "${DDIR}/transparent.png" COPYONLY)
|
||||
|
|
14
files/mygui/openmw_settings_window_layout.xml
Normal file
14
files/mygui/openmw_settings_window_layout.xml
Normal file
|
@ -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…
Reference in a new issue