mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-10 04:26:50 +03:00
Use std::unique_ptr in HUD
This commit is contained in:
parent
b21c77a026
commit
fd720c0a7b
2 changed files with 4 additions and 4 deletions
|
@ -163,7 +163,7 @@ namespace MWGui
|
||||||
mMainWidget->eventMouseMove += MyGUI::newDelegate(this, &HUD::onWorldMouseOver);
|
mMainWidget->eventMouseMove += MyGUI::newDelegate(this, &HUD::onWorldMouseOver);
|
||||||
mMainWidget->eventMouseLostFocus += MyGUI::newDelegate(this, &HUD::onWorldMouseLostFocus);
|
mMainWidget->eventMouseLostFocus += MyGUI::newDelegate(this, &HUD::onWorldMouseLostFocus);
|
||||||
|
|
||||||
mSpellIcons = new SpellIcons();
|
mSpellIcons = std::make_unique<SpellIcons>();
|
||||||
}
|
}
|
||||||
|
|
||||||
HUD::~HUD()
|
HUD::~HUD()
|
||||||
|
@ -171,8 +171,6 @@ namespace MWGui
|
||||||
mMainWidget->eventMouseLostFocus.clear();
|
mMainWidget->eventMouseLostFocus.clear();
|
||||||
mMainWidget->eventMouseMove.clear();
|
mMainWidget->eventMouseMove.clear();
|
||||||
mMainWidget->eventMouseButtonClick.clear();
|
mMainWidget->eventMouseButtonClick.clear();
|
||||||
|
|
||||||
delete mSpellIcons;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HUD::setValue(const std::string& id, const MWMechanics::DynamicStat<float>& value)
|
void HUD::setValue(const std::string& id, const MWMechanics::DynamicStat<float>& value)
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef OPENMW_GAME_MWGUI_HUD_H
|
#ifndef OPENMW_GAME_MWGUI_HUD_H
|
||||||
#define OPENMW_GAME_MWGUI_HUD_H
|
#define OPENMW_GAME_MWGUI_HUD_H
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "mapwindow.hpp"
|
#include "mapwindow.hpp"
|
||||||
#include "statswatcher.hpp"
|
#include "statswatcher.hpp"
|
||||||
|
|
||||||
|
@ -95,7 +97,7 @@ namespace MWGui
|
||||||
|
|
||||||
bool mWorldMouseOver;
|
bool mWorldMouseOver;
|
||||||
|
|
||||||
SpellIcons* mSpellIcons;
|
std::unique_ptr<SpellIcons> mSpellIcons;
|
||||||
|
|
||||||
int mEnemyActorId;
|
int mEnemyActorId;
|
||||||
float mEnemyHealthTimer;
|
float mEnemyHealthTimer;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue