mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
Add message box when item is added to player's inventory
This commit is contained in:
parent
170a9762ac
commit
e1ca0a15ae
@ -60,6 +60,27 @@ namespace MWScript
|
|||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).getContainerStore (ptr).add (ref.getPtr());
|
MWWorld::Class::get (ptr).getContainerStore (ptr).add (ref.getPtr());
|
||||||
|
|
||||||
|
// The two GMST entries below expand to strings informing the player of what, and how many of it has been added to their inventory
|
||||||
|
std::string msgBox;
|
||||||
|
std::string itemName = MWWorld::Class::get(ref.getPtr()).getName(ref.getPtr());
|
||||||
|
if (count == 1)
|
||||||
|
{
|
||||||
|
msgBox = MyGUI::LanguageManager::getInstance().replaceTags("#{sNotifyMessage60}");
|
||||||
|
std::stringstream temp;
|
||||||
|
temp << boost::format(msgBox) % itemName;
|
||||||
|
msgBox = temp.str();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msgBox = MyGUI::LanguageManager::getInstance().replaceTags("#{sNotifyMessage61}");
|
||||||
|
std::stringstream temp;
|
||||||
|
temp << boost::format(msgBox) % (count) % itemName;
|
||||||
|
msgBox = temp.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(count > 0)
|
||||||
|
MWBase::Environment::get().getWindowManager()->messageBox(msgBox, std::vector<std::string>());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -130,7 +151,7 @@ namespace MWScript
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The two GMST entries below expand to strings informing the player of what, and how many of it has been removed from their inventory */
|
// The two GMST entries below expand to strings informing the player of what, and how many of it has been removed from their inventory
|
||||||
std::string msgBox;
|
std::string msgBox;
|
||||||
if(originalCount - count > 1)
|
if(originalCount - count > 1)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user