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