mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-17 23:15:11 -05:00
Uses more descriptive type name for ItemIDs for creating custom messages.
This commit is contained in:
parent
01dbfc71ad
commit
10c05892bf
@ -47,7 +47,7 @@ void CustomMessageManager::ReplaceColors(std::string& string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomMessageManager::FormatCustomMessage(std::string& message, uint16_t iid) {
|
void CustomMessageManager::FormatCustomMessage(std::string& message, ItemID iid) {
|
||||||
message.insert(0, ITEM_OBTAINED(iid));
|
message.insert(0, ITEM_OBTAINED(iid));
|
||||||
size_t start_pos = 0;
|
size_t start_pos = 0;
|
||||||
std::replace(message.begin(), message.end(), '&', NEWLINE()[0]);
|
std::replace(message.begin(), message.end(), '&', NEWLINE()[0]);
|
||||||
@ -81,7 +81,7 @@ bool CustomMessageManager::InsertCustomMessage(std::string tableID, uint16_t tex
|
|||||||
return messageInsertResult.second;
|
return messageInsertResult.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CustomMessageManager::CreateGetItemMessage(std::string tableID, uint16_t giid, uint16_t iid,
|
bool CustomMessageManager::CreateGetItemMessage(std::string tableID, uint16_t giid, ItemID iid,
|
||||||
CustomMessageEntry messageEntry) {
|
CustomMessageEntry messageEntry) {
|
||||||
FormatCustomMessage(messageEntry.english, iid);
|
FormatCustomMessage(messageEntry.english, iid);
|
||||||
FormatCustomMessage(messageEntry.german, iid);
|
FormatCustomMessage(messageEntry.german, iid);
|
||||||
|
@ -89,7 +89,7 @@ class CustomMessageManager {
|
|||||||
with the provided giid (getItemID) as its key. This function also inserts the icon corresponding to
|
with the provided giid (getItemID) as its key. This function also inserts the icon corresponding to
|
||||||
the provided iid (itemID) at the beginning of each page of the textbox.
|
the provided iid (itemID) at the beginning of each page of the textbox.
|
||||||
*/
|
*/
|
||||||
bool CreateGetItemMessage(std::string tableID, uint16_t giid, uint16_t iid, CustomMessageEntry messages);
|
bool CreateGetItemMessage(std::string tableID, uint16_t giid, ItemID iid, CustomMessageEntry messages);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Formats the provided Custom Message Entry and inserts it into the table with the provided tableID,
|
Formats the provided Custom Message Entry and inserts it into the table with the provided tableID,
|
||||||
@ -122,7 +122,7 @@ class CustomMessageManager {
|
|||||||
& for newline, ^ for wait-for-input, and @ for the player name,
|
& for newline, ^ for wait-for-input, and @ for the player name,
|
||||||
as well as %<letter> for colors (i.e. %r for red and %w for white).
|
as well as %<letter> for colors (i.e. %r for red and %w for white).
|
||||||
*/
|
*/
|
||||||
void FormatCustomMessage(std::string& message, uint16_t iid);
|
void FormatCustomMessage(std::string& message, ItemID iid);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Replaces special characters and certain symbols with control codes
|
Replaces special characters and certain symbols with control codes
|
||||||
|
Loading…
Reference in New Issue
Block a user