mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 20:19:57 +00:00
added settings for crosshair & subtitles
This commit is contained in:
parent
e9b2f4ee74
commit
6ad08dfd33
8 changed files with 51 additions and 3 deletions
|
@ -180,6 +180,7 @@ namespace MWBase
|
||||||
virtual void unsetSelectedWeapon() = 0;
|
virtual void unsetSelectedWeapon() = 0;
|
||||||
|
|
||||||
virtual void showCrosshair(bool show) = 0;
|
virtual void showCrosshair(bool show) = 0;
|
||||||
|
virtual bool getSubtitlesEnabled() = 0;
|
||||||
|
|
||||||
virtual void disallowMouse() = 0;
|
virtual void disallowMouse() = 0;
|
||||||
virtual void allowMouse() = 0;
|
virtual void allowMouse() = 0;
|
||||||
|
|
|
@ -85,6 +85,8 @@ namespace MWGui
|
||||||
WindowBase("openmw_settings_window.layout", parWindowManager)
|
WindowBase("openmw_settings_window.layout", parWindowManager)
|
||||||
{
|
{
|
||||||
getWidget(mOkButton, "OkButton");
|
getWidget(mOkButton, "OkButton");
|
||||||
|
getWidget(mSubtitlesButton, "SubtitlesButton");
|
||||||
|
getWidget(mCrosshairButton, "CrosshairButton");
|
||||||
getWidget(mResolutionList, "ResolutionList");
|
getWidget(mResolutionList, "ResolutionList");
|
||||||
getWidget(mMenuTransparencySlider, "MenuTransparencySlider");
|
getWidget(mMenuTransparencySlider, "MenuTransparencySlider");
|
||||||
getWidget(mToolTipDelaySlider, "ToolTipDelaySlider");
|
getWidget(mToolTipDelaySlider, "ToolTipDelaySlider");
|
||||||
|
@ -121,6 +123,8 @@ namespace MWGui
|
||||||
getWidget(mUISensitivitySlider, "UISensitivitySlider");
|
getWidget(mUISensitivitySlider, "UISensitivitySlider");
|
||||||
getWidget(mCameraSensitivitySlider, "CameraSensitivitySlider");
|
getWidget(mCameraSensitivitySlider, "CameraSensitivitySlider");
|
||||||
|
|
||||||
|
mSubtitlesButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onButtonToggled);
|
||||||
|
mCrosshairButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onButtonToggled);
|
||||||
mInvertYButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onButtonToggled);
|
mInvertYButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onButtonToggled);
|
||||||
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onOkButtonClicked);
|
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onOkButtonClicked);
|
||||||
mUnderwaterButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onButtonToggled);
|
mUnderwaterButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onButtonToggled);
|
||||||
|
@ -192,6 +196,9 @@ namespace MWGui
|
||||||
int tooltip_delay = (mToolTipDelaySlider->getScrollRange()-1) * Settings::Manager::getFloat("tooltip delay", "GUI");
|
int tooltip_delay = (mToolTipDelaySlider->getScrollRange()-1) * Settings::Manager::getFloat("tooltip delay", "GUI");
|
||||||
mToolTipDelaySlider->setScrollPosition(tooltip_delay);
|
mToolTipDelaySlider->setScrollPosition(tooltip_delay);
|
||||||
|
|
||||||
|
mSubtitlesButton->setCaptionWithReplacing(Settings::Manager::getBool("subtitles", "GUI") ? "#{sOn}" : "#{sOff}");
|
||||||
|
mCrosshairButton->setCaptionWithReplacing(Settings::Manager::getBool("crosshair", "HUD") ? "#{sOn}" : "#{sOff}");
|
||||||
|
|
||||||
float fovVal = (Settings::Manager::getFloat("field of view", "General")-sFovMin)/(sFovMax-sFovMin);
|
float fovVal = (Settings::Manager::getFloat("field of view", "General")-sFovMin)/(sFovMax-sFovMin);
|
||||||
mFOVSlider->setScrollPosition(fovVal * (mFOVSlider->getScrollRange()-1));
|
mFOVSlider->setScrollPosition(fovVal * (mFOVSlider->getScrollRange()-1));
|
||||||
MyGUI::TextBox* fovText;
|
MyGUI::TextBox* fovText;
|
||||||
|
@ -403,6 +410,10 @@ namespace MWGui
|
||||||
Settings::Manager::setBool("debug", "Shadows", newState);
|
Settings::Manager::setBool("debug", "Shadows", newState);
|
||||||
else if (_sender == mInvertYButton)
|
else if (_sender == mInvertYButton)
|
||||||
Settings::Manager::setBool("invert y axis", "Input", newState);
|
Settings::Manager::setBool("invert y axis", "Input", newState);
|
||||||
|
else if (_sender == mCrosshairButton)
|
||||||
|
Settings::Manager::setBool("crosshair", "HUD", newState);
|
||||||
|
else if (_sender == mSubtitlesButton)
|
||||||
|
Settings::Manager::setBool("subtitles", "GUI", newState);
|
||||||
|
|
||||||
apply();
|
apply();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,8 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::ScrollBar* mMenuTransparencySlider;
|
MyGUI::ScrollBar* mMenuTransparencySlider;
|
||||||
MyGUI::ScrollBar* mToolTipDelaySlider;
|
MyGUI::ScrollBar* mToolTipDelaySlider;
|
||||||
|
MyGUI::Button* mSubtitlesButton;
|
||||||
|
MyGUI::Button* mCrosshairButton;
|
||||||
|
|
||||||
// graphics
|
// graphics
|
||||||
MyGUI::ListBox* mResolutionList;
|
MyGUI::ListBox* mResolutionList;
|
||||||
|
|
|
@ -84,6 +84,8 @@ WindowManager::WindowManager(
|
||||||
, mFPS(0.0f)
|
, mFPS(0.0f)
|
||||||
, mTriangleCount(0)
|
, mTriangleCount(0)
|
||||||
, mBatchCount(0)
|
, mBatchCount(0)
|
||||||
|
, mCrosshairEnabled(Settings::Manager::getBool ("crosshair", "HUD"))
|
||||||
|
, mSubtitlesEnabled(Settings::Manager::getBool ("subtitles", "GUI"))
|
||||||
{
|
{
|
||||||
|
|
||||||
// Set up the GUI system
|
// Set up the GUI system
|
||||||
|
@ -644,6 +646,10 @@ void WindowManager::processChangedSettings(const Settings::CategorySettingVector
|
||||||
{
|
{
|
||||||
changeRes = true;
|
changeRes = true;
|
||||||
}
|
}
|
||||||
|
else if (it->first == "HUD" && it->second == "crosshair")
|
||||||
|
mCrosshairEnabled = Settings::Manager::getBool ("crosshair", "HUD");
|
||||||
|
else if (it->first == "GUI" && it->second == "subtitles")
|
||||||
|
mSubtitlesEnabled = Settings::Manager::getBool ("subtitles", "GUI");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changeRes)
|
if (changeRes)
|
||||||
|
@ -857,10 +863,15 @@ void WindowManager::notifyInputActionBound ()
|
||||||
|
|
||||||
void WindowManager::showCrosshair (bool show)
|
void WindowManager::showCrosshair (bool show)
|
||||||
{
|
{
|
||||||
mHud->setCrosshairVisible (show);
|
mHud->setCrosshairVisible (show && mCrosshairEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::activateQuickKey (int index)
|
void WindowManager::activateQuickKey (int index)
|
||||||
{
|
{
|
||||||
mQuickKeysMenu->activateQuickKey(index);
|
mQuickKeysMenu->activateQuickKey(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WindowManager::getSubtitlesEnabled ()
|
||||||
|
{
|
||||||
|
return mSubtitlesEnabled;
|
||||||
|
}
|
||||||
|
|
|
@ -161,6 +161,7 @@ namespace MWGui
|
||||||
virtual void unsetSelectedWeapon();
|
virtual void unsetSelectedWeapon();
|
||||||
|
|
||||||
virtual void showCrosshair(bool show);
|
virtual void showCrosshair(bool show);
|
||||||
|
virtual bool getSubtitlesEnabled();
|
||||||
|
|
||||||
virtual void disallowMouse();
|
virtual void disallowMouse();
|
||||||
virtual void allowMouse();
|
virtual void allowMouse();
|
||||||
|
@ -220,6 +221,9 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::Widget* mInputBlocker;
|
MyGUI::Widget* mInputBlocker;
|
||||||
|
|
||||||
|
bool mCrosshairEnabled;
|
||||||
|
bool mSubtitlesEnabled;
|
||||||
|
|
||||||
/// \todo get rid of this stuff. Move it to the respective UI element classes, if needed.
|
/// \todo get rid of this stuff. Move it to the respective UI element classes, if needed.
|
||||||
// Various stats about player as needed by window manager
|
// Various stats about player as needed by window manager
|
||||||
ESM::Class mPlayerClass;
|
ESM::Class mPlayerClass;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
#include "../mwbase/soundmanager.hpp"
|
#include "../mwbase/soundmanager.hpp"
|
||||||
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
#include "interpretercontext.hpp"
|
#include "interpretercontext.hpp"
|
||||||
#include "ref.hpp"
|
#include "ref.hpp"
|
||||||
|
@ -37,7 +38,9 @@ namespace MWScript
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWBase::Environment::get().getSoundManager()->say (ptr, file);
|
MWBase::Environment::get().getSoundManager()->say (ptr, file);
|
||||||
context.messageBox (text);
|
|
||||||
|
if (MWBase::Environment::get().getWindowManager ()->getSubtitlesEnabled())
|
||||||
|
context.messageBox (text);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,18 @@
|
||||||
<Property key="Caption" value="#{sSlow}"/>
|
<Property key="Caption" value="#{sSlow}"/>
|
||||||
<Property key="TextAlign" value="Right"/>
|
<Property key="TextAlign" value="Right"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
|
|
||||||
|
<Widget type="Button" skin="MW_Button" position="4 200 34 24" align="Left Top" name="SubtitlesButton"/>
|
||||||
|
<Widget type="TextBox" skin="SandText" position="44 200 200 24" align="Left Top">
|
||||||
|
<Property key="Caption" value="#{sSubtitles}"/>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
<Widget type="Button" skin="MW_Button" position="4 230 34 24" align="Left Top" name="CrosshairButton"/>
|
||||||
|
<Widget type="TextBox" skin="SandText" position="44 230 200 24" align="Left Top">
|
||||||
|
<Property key="Caption" value="#{sCursorOff}"/>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
</Widget>
|
</Widget>
|
||||||
<Widget type="TabItem" skin="" position="4 28 360 312">
|
<Widget type="TabItem" skin="" position="4 28 360 312">
|
||||||
<Property key="Caption" value=" #{sAudio} "/>
|
<Property key="Caption" value=" #{sAudio} "/>
|
||||||
|
|
|
@ -29,7 +29,9 @@ vsync = false
|
||||||
menu transparency = 0.84
|
menu transparency = 0.84
|
||||||
|
|
||||||
# 0 - instantly, 1 - max. delay
|
# 0 - instantly, 1 - max. delay
|
||||||
tooltip delay = 0.2
|
tooltip delay = 0
|
||||||
|
|
||||||
|
subtitles = false
|
||||||
|
|
||||||
[General]
|
[General]
|
||||||
# Camera field of view
|
# Camera field of view
|
||||||
|
@ -85,6 +87,8 @@ debug = false
|
||||||
# 2: advanced FPS display (batches, triangles)
|
# 2: advanced FPS display (batches, triangles)
|
||||||
fps = 0
|
fps = 0
|
||||||
|
|
||||||
|
crosshair = true
|
||||||
|
|
||||||
[Objects]
|
[Objects]
|
||||||
shaders = true
|
shaders = true
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue