mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-10 20:46:47 +03:00
Rename AddDisplayString to SetDisplayString. Make it call insert_or_assign instead of just insert.
Add GetDisplayString and assorted types/static functions.
This commit is contained in:
parent
501be9c594
commit
9a2d1a0f2d
3 changed files with 27 additions and 6 deletions
|
@ -46,9 +46,11 @@ DisplayStringIDType GameScriptDisplayString::GetID() const
|
|||
}
|
||||
|
||||
AddItemCallback GameScriptDisplayString::s_addItemCallback = [](DisplayStringIDType, UserDisplayString)
|
||||
SetItemCallback GameScriptDisplayString::s_setItemCallback = [](DisplayStringIDType, UserDisplayString)
|
||||
{
|
||||
std::string err = "\"Add string\" callback is not set.";
|
||||
std::string err = "\"Set string\" callback is not set.";
|
||||
throw TENScriptException(err);
|
||||
return false;
|
||||
};
|
||||
|
||||
// This is called by a destructor (or will be if we forget to assign it during a refactor)
|
||||
|
@ -57,5 +59,13 @@ RemoveItemCallback GameScriptDisplayString::s_removeItemCallback = [](DisplayStr
|
|||
{
|
||||
TENLog("\"Remove string\" callback is not set.", LogLevel::Error);
|
||||
std::terminate();
|
||||
return false;
|
||||
};
|
||||
|
||||
GetItemCallback GameScriptDisplayString::s_getItemCallback = [](DisplayStringIDType)
|
||||
{
|
||||
std::string err = "\"Get string\" callback is not set.";
|
||||
throw TENScriptException(err);
|
||||
return std::nullopt;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue