summaryrefslogtreecommitdiff
path: root/src/progs/manaplus
diff options
context:
space:
mode:
Diffstat (limited to 'src/progs/manaplus')
-rw-r--r--src/progs/manaplus/actions/actions.cpp120
-rw-r--r--src/progs/manaplus/actions/chat.cpp49
-rw-r--r--src/progs/manaplus/actions/commands.cpp87
-rw-r--r--src/progs/manaplus/actions/statusbar.cpp8
4 files changed, 201 insertions, 63 deletions
diff --git a/src/progs/manaplus/actions/actions.cpp b/src/progs/manaplus/actions/actions.cpp
index 9ef8b0865..d71ba50a5 100644
--- a/src/progs/manaplus/actions/actions.cpp
+++ b/src/progs/manaplus/actions/actions.cpp
@@ -1023,12 +1023,16 @@ impHandler0(ipcToggle)
if (ipc == nullptr)
{
debugChatTab->chatLog("IPC service stopped.",
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
else
{
debugChatTab->chatLog("Unable to stop IPC service.",
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
}
else
@@ -1038,12 +1042,16 @@ impHandler0(ipcToggle)
{
debugChatTab->chatLog(
strprintf("IPC service available on port %d", ipc->getPort()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
else
{
debugChatTab->chatLog("Unable to start IPC service",
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
}
return true;
@@ -1058,7 +1066,10 @@ impHandler(where)
where << Game::instance()->getCurrentMapName() << ", coordinates: "
<< ((localPlayer->getPixelX() - mapTileSize / 2) / mapTileSize)
<< ", " << ((localPlayer->getPixelY() - mapTileSize) / mapTileSize);
- tab->chatLog(where.str(), ChatMsgType::BY_SERVER);
+ tab->chatLog(where.str(),
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
}
@@ -1077,7 +1088,9 @@ impHandler0(cleanGraphics)
{
// TRANSLATORS: clear graphics command message
debugChatTab->chatLog(_("Cache cleared"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return true;
}
@@ -1090,7 +1103,9 @@ impHandler0(cleanFonts)
{
// TRANSLATORS: clear fonts cache message
debugChatTab->chatLog(_("Cache cleared"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return true;
}
@@ -1151,7 +1166,10 @@ impHandler0(cacheInfo)
unsigned int all = 0;
// TRANSLATORS: chat fonts message
- debugChatTab->chatLog(_("font cache size"), ChatMsgType::BY_SERVER);
+ debugChatTab->chatLog(_("font cache size"),
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
std::string str;
for (int f = 0; f < 256; f ++)
{
@@ -1162,20 +1180,32 @@ impHandler0(cacheInfo)
str.append(strprintf("%d: %u, ", f, sz));
}
}
- debugChatTab->chatLog(str, ChatMsgType::BY_SERVER);
+ debugChatTab->chatLog(str,
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
// TRANSLATORS: chat fonts message
debugChatTab->chatLog(strprintf("%s %d", _("Cache size:"), all),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
#ifdef DEBUG_FONT_COUNTERS
- debugChatTab->chatLog("", ChatMsgType::BY_SERVER);
+ debugChatTab->chatLog("",
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
debugChatTab->chatLog(strprintf("%s %d",
// TRANSLATORS: chat fonts message
_("Created:"), font->getCreateCounter()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
debugChatTab->chatLog(strprintf("%s %d",
// TRANSLATORS: chat fonts message
_("Deleted:"), font->getDeleteCounter()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
#endif
*/
return true;
@@ -1240,16 +1270,24 @@ impHandler0(dirs)
debugChatTab->chatLog("config directory: "
+ settings.configDir,
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
debugChatTab->chatLog("logs directory: "
+ settings.localDataDir,
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
debugChatTab->chatLog("screenshots directory: "
+ settings.screenshotDir,
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
debugChatTab->chatLog("temp directory: "
+ settings.tempDir,
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
}
@@ -1262,14 +1300,18 @@ impHandler0(uptime)
{
// TRANSLATORS: uptime command
debugChatTab->chatLog(strprintf(_("Client uptime: %s"), "unknown"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
else
{
// TRANSLATORS: uptime command
debugChatTab->chatLog(strprintf(_("Client uptime: %s"),
timeDiffToString(CAST_S32(cur_time - start_time)).c_str()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return true;
}
@@ -1282,7 +1324,12 @@ static void showRes(std::string str, ResourceManager::Resources *res)
str.append(toString(res->size()));
if (debugChatTab)
- debugChatTab->chatLog(str, ChatMsgType::BY_SERVER);
+ {
+ debugChatTab->chatLog(str,
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
+ }
logger->log(str);
ResourceManager::ResourceIterator iter = res->begin();
const ResourceManager::ResourceIterator iter_end = res->end();
@@ -1334,12 +1381,16 @@ impHandler(dump)
ResourceManager::Resources *res = ResourceManager::getResources();
// TRANSLATORS: dump command
debugChatTab->chatLog(_("Resource images:") + toString(res->size()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
res = ResourceManager::getOrphanedResources();
// TRANSLATORS: dump command
debugChatTab->chatLog(_("Orphaned resource images:")
+ toString(res->size()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return true;
}
@@ -1435,7 +1486,9 @@ impHandler0(dumpEnvironment)
{
// TRANSLATORS: dump environment command
debugChatTab->chatLog(_("Environment variables dumped"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return true;
}
@@ -1522,7 +1575,9 @@ impHandler0(testSdlFont)
if (debugChatTab)
{
debugChatTab->chatLog("sdlfont time: " + toString(diff),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return true;
}
@@ -1846,7 +1901,9 @@ impHandler(seen)
// TRANSLATORS: last seen disabled warning
tab->chatLog(_("Last seen disabled. "
"Enable in players / collect players ID and seen log."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
}
@@ -1864,7 +1921,9 @@ impHandler(seen)
{
// TRANSLATORS: last seen error
tab->chatLog(_("You have never seen this nick."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
}
const std::string message = strprintf(
@@ -1872,13 +1931,18 @@ impHandler(seen)
_("Last seen for %s: %s"),
name.c_str(),
lines[2].c_str());
- tab->chatLog(message, ChatMsgType::BY_SERVER);
+ tab->chatLog(message,
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
else
{
// TRANSLATORS: last seen error
tab->chatLog(_("You have not seen this nick before."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return true;
diff --git a/src/progs/manaplus/actions/chat.cpp b/src/progs/manaplus/actions/chat.cpp
index 307e4556e..2440af9af 100644
--- a/src/progs/manaplus/actions/chat.cpp
+++ b/src/progs/manaplus/actions/chat.cpp
@@ -272,7 +272,9 @@ impHandler(msg)
event.tab->chatLog(
// TRANSLATORS: whisper send
_("Cannot send empty whisper or channel message!"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
}
return true;
@@ -325,7 +327,10 @@ impHandler(query)
// TRANSLATORS: new whisper or channel query
event.tab->chatLog(strprintf(_("Cannot create a whisper tab "
"\"%s\"! It probably already exists."),
- args.c_str()), ChatMsgType::BY_SERVER);
+ args.c_str()),
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return true;
}
@@ -394,7 +399,9 @@ impHandler(party)
{
// TRANSLATORS: party invite message
event.tab->chatLog(_("Please specify a name."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
}
return true;
@@ -428,13 +435,17 @@ impHandler(guild)
{
// TRANSLATORS: guild invite message
event.tab->chatLog(_("Please specify a name."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
else if (localChatTab != nullptr)
{
// TRANSLATORS: guild invite message
localChatTab->chatLog(_("Please specify a name."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
}
return true;
@@ -455,7 +466,9 @@ impHandler(toggle)
event.tab->chatLog(chatWindow->getReturnTogglesChat() ?
// TRANSLATORS: message from toggle chat command
_("Return toggles chat.") : _("Message closes chat."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return true;
}
@@ -467,7 +480,9 @@ impHandler(toggle)
{
// TRANSLATORS: message from toggle chat command
event.tab->chatLog(_("Return now toggles chat."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
if (chatWindow != nullptr)
chatWindow->setReturnTogglesChat(true);
@@ -477,7 +492,9 @@ impHandler(toggle)
{
// TRANSLATORS: message from toggle chat command
event.tab->chatLog(_("Message now closes chat."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
if (chatWindow != nullptr)
chatWindow->setReturnTogglesChat(false);
@@ -486,7 +503,9 @@ impHandler(toggle)
if (event.tab != nullptr)
{
event.tab->chatLog(strprintf(BOOLEAN_OPTIONS, "toggle"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return true;
default:
@@ -507,7 +526,9 @@ impHandler(kickParty)
{
// TRANSLATORS: party kick message
event.tab->chatLog(_("Please specify a name."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
}
return true;
@@ -542,7 +563,9 @@ impHandler(kickGuild)
{
// TRANSLATORS: party kick message
event.tab->chatLog(_("Please specify a name."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
}
return true;
@@ -717,7 +740,9 @@ impHandler(translate)
// TRANSLATORS: translation error message
strprintf(_("No translation found for string: %s"),
srcStr.c_str()),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
}
diff --git a/src/progs/manaplus/actions/commands.cpp b/src/progs/manaplus/actions/commands.cpp
index f2d49b13b..765d1ceb1 100644
--- a/src/progs/manaplus/actions/commands.cpp
+++ b/src/progs/manaplus/actions/commands.cpp
@@ -106,7 +106,9 @@ static std::string getNick(const InputEvent &event)
{
// TRANSLATORS: change relation
event.tab->chatLog(_("Please specify a name."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return std::string();
}
args = whisper->getNick();
@@ -124,12 +126,18 @@ static void reportRelation(const InputEvent &event,
if (playerRelations.getRelation(event.args) == rel)
{
// TRANSLATORS: unignore command
- event.tab->chatLog(str1, ChatMsgType::BY_SERVER);
+ event.tab->chatLog(str1,
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
else
{
// TRANSLATORS: unignore command
- event.tab->chatLog(str2, ChatMsgType::BY_SERVER);
+ event.tab->chatLog(str2,
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
}
}
@@ -148,7 +156,10 @@ static void changeRelation(const InputEvent &event,
{
// TRANSLATORS: change relation
event.tab->chatLog(strprintf(_("Player already %s!"),
- relationText.c_str()), ChatMsgType::BY_SERVER);
+ relationText.c_str()),
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return;
}
}
@@ -198,7 +209,9 @@ impHandler(chatUnignore)
{
// TRANSLATORS: unignore command
event.tab->chatLog(_("Player wasn't ignored!"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return true;
}
@@ -224,7 +237,9 @@ impHandler(chatErase)
{
// TRANSLATORS: erase command
event.tab->chatLog(_("Player already erased!"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
return true;
}
@@ -1779,22 +1794,30 @@ impHandler(partyItemShare)
case PartyShare::YES:
// TRANSLATORS: chat message
tab->chatLog(_("Item sharing enabled."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
case PartyShare::NO:
// TRANSLATORS: chat message
tab->chatLog(_("Item sharing disabled."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
case PartyShare::NOT_POSSIBLE:
// TRANSLATORS: chat message
tab->chatLog(_("Item sharing not possible."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
case PartyShare::UNKNOWN:
// TRANSLATORS: chat message
tab->chatLog(_("Item sharing unknown."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
default:
break;
@@ -1815,7 +1838,9 @@ impHandler(partyItemShare)
break;
case -1:
tab->chatLog(strprintf(BOOLEAN_OPTIONS, "item"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
break;
default:
break;
@@ -1845,22 +1870,30 @@ impHandler(partyExpShare)
case PartyShare::YES:
// TRANSLATORS: chat message
tab->chatLog(_("Experience sharing enabled."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
case PartyShare::NO:
// TRANSLATORS: chat message
tab->chatLog(_("Experience sharing disabled."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
case PartyShare::NOT_POSSIBLE:
// TRANSLATORS: chat message
tab->chatLog(_("Experience sharing not possible."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
case PartyShare::UNKNOWN:
// TRANSLATORS: chat message
tab->chatLog(_("Experience sharing unknown."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
default:
break;
@@ -1881,7 +1914,9 @@ impHandler(partyExpShare)
break;
case -1:
tab->chatLog(strprintf(BOOLEAN_OPTIONS, "exp"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
break;
default:
break;
@@ -1911,22 +1946,30 @@ impHandler(partyAutoItemShare)
case PartyShare::YES:
// TRANSLATORS: chat message
tab->chatLog(_("Auto item sharing enabled."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
case PartyShare::NO:
// TRANSLATORS: chat message
tab->chatLog(_("Auto item sharing disabled."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
case PartyShare::NOT_POSSIBLE:
// TRANSLATORS: chat message
tab->chatLog(_("Auto item sharing not possible."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
case PartyShare::UNKNOWN:
// TRANSLATORS: chat message
tab->chatLog(_("Auto item sharing unknown."),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
return true;
default:
break;
@@ -1947,7 +1990,9 @@ impHandler(partyAutoItemShare)
break;
case -1:
tab->chatLog(strprintf(BOOLEAN_OPTIONS, "item"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
break;
default:
break;
diff --git a/src/progs/manaplus/actions/statusbar.cpp b/src/progs/manaplus/actions/statusbar.cpp
index 0d5ba68cd..c659c041c 100644
--- a/src/progs/manaplus/actions/statusbar.cpp
+++ b/src/progs/manaplus/actions/statusbar.cpp
@@ -178,7 +178,9 @@ impHandler0(changeTrade)
{
// TRANSLATORS: disable trades message
localChatTab->chatLog(_("Ignoring incoming trade requests"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
deflt &= ~PlayerRelation::TRADE;
}
@@ -188,7 +190,9 @@ impHandler0(changeTrade)
{
// TRANSLATORS: enable trades message
localChatTab->chatLog(_("Accepting incoming trade requests"),
- ChatMsgType::BY_SERVER);
+ ChatMsgType::BY_SERVER,
+ IgnoreRecord_false,
+ TryRemoveColors_true);
}
deflt |= PlayerRelation::TRADE;
}