From 4aaa299b111d07d7e4425e60a888e8496b9da5c1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 23 Dec 2017 19:22:13 +0300 Subject: Remove default parameters from npcdialog. --- src/gui/windows/npcdialog.cpp | 3 ++- src/gui/windows/npcdialog.h | 10 ++++++---- src/net/ea/npcrecv.cpp | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index fb38dcc72..ca6607c41 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -773,7 +773,8 @@ bool NpcDialog::isAnyInputFocused() return false; } -void NpcDialog::integerRequest(const int defaultValue, const int min, +void NpcDialog::integerRequest(const int defaultValue, + const int min, const int max) { mActionState = NpcActionState::INPUT; diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h index 4680d774d..71dd171b6 100644 --- a/src/gui/windows/npcdialog.h +++ b/src/gui/windows/npcdialog.h @@ -98,7 +98,8 @@ class NpcDialog final : public Window, * * @param string The text to add. */ - void addText(const std::string &string, const bool save = true); + void addText(const std::string &string, + const bool save); /** * When called, the widget will show a "Next" button. @@ -156,7 +157,7 @@ class NpcDialog final : public Window, /** * Requests a text string from the user. */ - void textRequest(const std::string &defaultText = ""); + void textRequest(const std::string &defaultText); bool isInputFocused() const A_WARN_UNUSED; @@ -167,8 +168,9 @@ class NpcDialog final : public Window, /** * Requests a interger from the user. */ - void integerRequest(const int defaultValue = 0, const int min = 0, - const int max = 2147483647); + void integerRequest(const int defaultValue, + const int min, + const int max); void itemRequest(const int size); diff --git a/src/net/ea/npcrecv.cpp b/src/net/ea/npcrecv.cpp index 6129349bd..a73989455 100644 --- a/src/net/ea/npcrecv.cpp +++ b/src/net/ea/npcrecv.cpp @@ -71,7 +71,7 @@ void NpcRecv::processNpcMessage(Net::MessageIn &msg) if (message.size() > 3 && message.substr(0, 3) == "###") return; if (mDialog != nullptr) - mDialog->addText(message); + mDialog->addText(message, true); } void NpcRecv::processNpcClose(Net::MessageIn &msg) @@ -98,7 +98,7 @@ void NpcRecv::processNpcIntInput(Net::MessageIn &msg) npcHandler->getNpc(msg, NpcAction::Other); mRequestLang = false; if (mDialog != nullptr) - mDialog->integerRequest(0); + mDialog->integerRequest(0, 0, 2147483647); } void NpcRecv::processNpcStrInput(Net::MessageIn &msg) @@ -112,7 +112,7 @@ void NpcRecv::processNpcStrInput(Net::MessageIn &msg) } else if (mDialog != nullptr) { - mDialog->textRequest(""); + mDialog->textRequest(std::string()); } } -- cgit v1.2.3-60-g2f50