mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-05 11:45:34 +00:00
spell window layout & opening/closing/pinning logic
This commit is contained in:
parent
1b561ce91f
commit
c7268233df
8 changed files with 75 additions and 6 deletions
|
@ -28,7 +28,7 @@ add_openmw_dir (mwgui
|
|||
dialogue_history window_base stats_window messagebox journalwindow charactercreation
|
||||
map_window window_pinnable_base cursorreplace tooltips scrollwindow bookwindow list
|
||||
formatting inventorywindow container hud countdialog tradewindow settingswindow
|
||||
confirmationdialog alchemywindow referenceinterface
|
||||
confirmationdialog alchemywindow referenceinterface spellwindow
|
||||
)
|
||||
|
||||
add_openmw_dir (mwdialogue
|
||||
|
|
|
@ -91,7 +91,7 @@ namespace MWGui
|
|||
|
||||
mFilterAll->setStateSelected(true);
|
||||
|
||||
setCoord(0, 342, 600, 258);
|
||||
setCoord(0, 342, 498, 258);
|
||||
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
openContainer(player);
|
||||
|
|
20
apps/openmw/mwgui/spellwindow.cpp
Normal file
20
apps/openmw/mwgui/spellwindow.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include "spellwindow.hpp"
|
||||
|
||||
#include "window_manager.hpp"
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
SpellWindow::SpellWindow(WindowManager& parWindowManager)
|
||||
: WindowPinnableBase("openmw_spell_window_layout.xml", parWindowManager)
|
||||
{
|
||||
getWidget(mSpellView, "SpellView");
|
||||
getWidget(mEffectBox, "EffectsBox");
|
||||
|
||||
setCoord(498, 300, 302, 300);
|
||||
}
|
||||
|
||||
void SpellWindow::onPinToggled()
|
||||
{
|
||||
mWindowManager.setSpellVisibility(!mPinned);
|
||||
}
|
||||
}
|
21
apps/openmw/mwgui/spellwindow.hpp
Normal file
21
apps/openmw/mwgui/spellwindow.hpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
#ifndef MWGUI_SPELLWINDOW_H
|
||||
#define MWGUI_SPELLWINDOW_H
|
||||
|
||||
#include "window_pinnable_base.hpp"
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
class SpellWindow : public WindowPinnableBase
|
||||
{
|
||||
public:
|
||||
SpellWindow(WindowManager& parWindowManager);
|
||||
|
||||
protected:
|
||||
MyGUI::ScrollView* mSpellView;
|
||||
MyGUI::Widget* mEffectBox;
|
||||
|
||||
virtual void onPinToggled();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
|
@ -19,6 +19,7 @@
|
|||
#include "settingswindow.hpp"
|
||||
#include "confirmationdialog.hpp"
|
||||
#include "alchemywindow.hpp"
|
||||
#include "spellwindow.hpp"
|
||||
|
||||
#include "../mwmechanics/mechanicsmanager.hpp"
|
||||
#include "../mwinput/inputmanager.hpp"
|
||||
|
@ -56,6 +57,7 @@ WindowManager::WindowManager(
|
|||
, mSettingsWindow(NULL)
|
||||
, mConfirmationDialog(NULL)
|
||||
, mAlchemyWindow(NULL)
|
||||
, mSpellWindow(NULL)
|
||||
, mCharGen(NULL)
|
||||
, playerClass()
|
||||
, playerName()
|
||||
|
@ -124,6 +126,7 @@ WindowManager::WindowManager(
|
|||
mSettingsWindow = new SettingsWindow(*this);
|
||||
mConfirmationDialog = new ConfirmationDialog(*this);
|
||||
mAlchemyWindow = new AlchemyWindow(*this);
|
||||
mSpellWindow = new SpellWindow(*this);
|
||||
|
||||
// The HUD is always on
|
||||
hud->setVisible(true);
|
||||
|
@ -167,6 +170,7 @@ WindowManager::~WindowManager()
|
|||
delete mSettingsWindow;
|
||||
delete mConfirmationDialog;
|
||||
delete mAlchemyWindow;
|
||||
delete mSpellWindow;
|
||||
|
||||
cleanupGarbage();
|
||||
}
|
||||
|
@ -211,6 +215,7 @@ void WindowManager::updateVisible()
|
|||
mTradeWindow->setVisible(false);
|
||||
mSettingsWindow->setVisible(false);
|
||||
mAlchemyWindow->setVisible(false);
|
||||
mSpellWindow->setVisible(false);
|
||||
|
||||
// Mouse is visible whenever we're not in game mode
|
||||
MyGUI::PointerManager::getInstance().setVisible(isGuiMode());
|
||||
|
@ -224,7 +229,7 @@ void WindowManager::updateVisible()
|
|||
|
||||
setMinimapVisibility((allowed & GW_Map) && !map->pinned());
|
||||
setWeaponVisibility((allowed & GW_Inventory) && !mInventoryWindow->pinned());
|
||||
setSpellVisibility((allowed & GW_Magic)); /// \todo add pin state when spells window is implemented
|
||||
setSpellVisibility((allowed & GW_Magic) && !mSpellWindow->pinned());
|
||||
setHMSVisibility((allowed & GW_Stats) && !mStatsWindow->pinned());
|
||||
|
||||
// If in game mode, don't show anything.
|
||||
|
@ -271,9 +276,10 @@ void WindowManager::updateVisible()
|
|||
int eff = shown & allowed;
|
||||
|
||||
// Show the windows we want
|
||||
map -> setVisible( (eff & GW_Map) );
|
||||
mStatsWindow -> setVisible( (eff & GW_Stats) );
|
||||
mInventoryWindow->setVisible( (eff & GW_Inventory));
|
||||
map -> setVisible(eff & GW_Map);
|
||||
mStatsWindow -> setVisible(eff & GW_Stats);
|
||||
mInventoryWindow->setVisible(eff & GW_Inventory);
|
||||
mSpellWindow->setVisible(eff & GW_Magic);
|
||||
break;
|
||||
}
|
||||
case GM_Container:
|
||||
|
|
|
@ -81,6 +81,7 @@ namespace MWGui
|
|||
class SettingsWindow;
|
||||
class ConfirmationDialog;
|
||||
class AlchemyWindow;
|
||||
class SpellWindow;
|
||||
|
||||
struct ClassPoint
|
||||
{
|
||||
|
@ -250,6 +251,7 @@ namespace MWGui
|
|||
SettingsWindow* mSettingsWindow;
|
||||
ConfirmationDialog* mConfirmationDialog;
|
||||
AlchemyWindow* mAlchemyWindow;
|
||||
SpellWindow* mSpellWindow;
|
||||
|
||||
CharacterCreation* mCharGen;
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ configure_file("${SDIR}/openmw_trade_window_layout.xml" "${DDIR}/openmw_trade_wi
|
|||
configure_file("${SDIR}/openmw_settings_window_layout.xml" "${DDIR}/openmw_settings_window_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_confirmation_dialog_layout.xml" "${DDIR}/openmw_confirmation_dialog_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_alchemy_window_layout.xml" "${DDIR}/openmw_alchemy_window_layout.xml" COPYONLY)
|
||||
configure_file("${SDIR}/openmw_spell_window_layout.xml" "${DDIR}/openmw_spell_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}/EBGaramond-Regular.ttf" "${DDIR}/EBGaramond-Regular.ttf" COPYONLY)
|
||||
|
|
19
files/mygui/openmw_spell_window_layout.xml
Normal file
19
files/mygui/openmw_spell_window_layout.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<MyGUI type="Layout">
|
||||
<Widget type="Window" skin="MW_Window_Pinnable" layer="Windows" position="0 0 300 600" name="_Main">
|
||||
|
||||
<!-- Effect box-->
|
||||
<Widget type="Widget" skin="MW_Box" position="8 8 268 24" align="Left Top HStretch">
|
||||
<Widget type="Widget" skin="" position="4 4 260 16" align="Left Top Stretch" name="EffectsBox">
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
<!-- Spell list -->
|
||||
<Widget type="Widget" skin="MW_Box" position="8 38 268 518" align="Left Top Stretch">
|
||||
<Widget type="ScrollView" skin="MW_ScrollView" position="4 4 260 510" align="Left Top Stretch" name="SpellView">
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
||||
</Widget>
|
||||
</MyGUI>
|
Loading…
Reference in a new issue