From 4a62b4f1eed406d74a998a158d442ad4cc04e5b9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 13 Feb 2011 17:51:32 +0200 Subject: Set weight notice message not modal and hide it after 10 seconds. --- src/net/tmwa/playerhandler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/net') diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 528e727a3..ac4d42a2e 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -46,6 +46,7 @@ extern OkDialog *weightNotice; extern OkDialog *deathNotice; +extern int weightNoticeTime; // Max. distance we are willing to scroll after a teleport; // everything beyond will reset the port hard. @@ -320,19 +321,21 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) = PlayerInfo::getAttribute(TOTAL_WEIGHT); if (value >= max && total < max) { + weightNoticeTime = cur_time + 10; weightNotice = new OkDialog(_("Message"), _("You are carrying more than " "half your weight. You are " - "unable to regain health.")); + "unable to regain health."), false); weightNotice->addActionListener( &weightListener); } else if (value < max && total >= max) { + weightNoticeTime = cur_time + 10; weightNotice = new OkDialog(_("Message"), _("You are carrying less than " "half your weight. You are " - "can regain health.")); + "can regain health."), false); weightNotice->addActionListener( &weightListener); } -- cgit v1.2.3-70-g09d2