summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/bankwindow.cpp6
-rw-r--r--src/gui/windows/bankwindow.h6
-rw-r--r--src/gui/windows/buydialog.cpp42
-rw-r--r--src/gui/windows/buydialog.h8
-rw-r--r--src/gui/windows/buyingstoreselldialog.cpp6
-rw-r--r--src/gui/windows/buyingstoreselldialog.h6
-rw-r--r--src/gui/windows/buyselldialog.cpp6
-rw-r--r--src/gui/windows/buyselldialog.h6
-rw-r--r--src/gui/windows/changeemaildialog.cpp6
-rw-r--r--src/gui/windows/changeemaildialog.h6
-rw-r--r--src/gui/windows/changepassworddialog.cpp6
-rw-r--r--src/gui/windows/changepassworddialog.h6
-rw-r--r--src/gui/windows/charcreatedialog.cpp7
-rw-r--r--src/gui/windows/charcreatedialog.h6
-rw-r--r--src/gui/windows/chardeleteconfirm.h6
-rw-r--r--src/gui/windows/charselectdialog.cpp54
-rw-r--r--src/gui/windows/charselectdialog.h6
-rw-r--r--src/gui/windows/chatwindow.cpp12
-rw-r--r--src/gui/windows/chatwindow.h6
-rw-r--r--src/gui/windows/clanwindow.cpp7
-rw-r--r--src/gui/windows/clanwindow.h6
-rw-r--r--src/gui/windows/confirmdialog.cpp6
-rw-r--r--src/gui/windows/confirmdialog.h6
-rw-r--r--src/gui/windows/connectiondialog.cpp7
-rw-r--r--src/gui/windows/connectiondialog.h6
-rw-r--r--src/gui/windows/cutinwindow.cpp6
-rw-r--r--src/gui/windows/cutinwindow.h6
-rw-r--r--src/gui/windows/debugwindow.cpp7
-rw-r--r--src/gui/windows/debugwindow.h6
-rw-r--r--src/gui/windows/didyouknowwindow.cpp6
-rw-r--r--src/gui/windows/didyouknowwindow.h6
-rw-r--r--src/gui/windows/editdialog.cpp6
-rw-r--r--src/gui/windows/editdialog.h6
-rw-r--r--src/gui/windows/editserverdialog.cpp47
-rw-r--r--src/gui/windows/editserverdialog.h6
-rw-r--r--src/gui/windows/eggselectiondialog.cpp6
-rw-r--r--src/gui/windows/eggselectiondialog.h6
-rw-r--r--src/gui/windows/emotewindow.cpp6
-rw-r--r--src/gui/windows/emotewindow.h6
-rw-r--r--src/gui/windows/equipmentwindow.cpp7
-rw-r--r--src/gui/windows/equipmentwindow.h6
-rw-r--r--src/gui/windows/helpwindow.cpp6
-rw-r--r--src/gui/windows/helpwindow.h6
-rw-r--r--src/gui/windows/insertcarddialog.cpp6
-rw-r--r--src/gui/windows/insertcarddialog.h6
-rw-r--r--src/gui/windows/inventorywindow.cpp6
-rw-r--r--src/gui/windows/inventorywindow.h6
-rw-r--r--src/gui/windows/itemamountwindow.cpp6
-rw-r--r--src/gui/windows/itemamountwindow.h6
-rw-r--r--src/gui/windows/killstats.cpp11
-rw-r--r--src/gui/windows/killstats.h6
-rw-r--r--src/gui/windows/logindialog.cpp6
-rw-r--r--src/gui/windows/logindialog.h6
-rw-r--r--src/gui/windows/maileditwindow.cpp6
-rw-r--r--src/gui/windows/maileditwindow.h6
-rw-r--r--src/gui/windows/mailviewwindow.cpp10
-rw-r--r--src/gui/windows/mailviewwindow.h7
-rw-r--r--src/gui/windows/mailwindow.cpp55
-rw-r--r--src/gui/windows/mailwindow.h6
-rw-r--r--src/gui/windows/minimap.cpp15
-rw-r--r--src/gui/windows/minimap.h6
-rw-r--r--src/gui/windows/ministatuswindow.cpp32
-rw-r--r--src/gui/windows/ministatuswindow.h6
-rw-r--r--src/gui/windows/npcdialog.cpp13
-rw-r--r--src/gui/windows/npcdialog.h8
-rw-r--r--src/gui/windows/npcselldialog.cpp6
-rw-r--r--src/gui/windows/npcselldialog.h6
-rw-r--r--src/gui/windows/okdialog.cpp6
-rw-r--r--src/gui/windows/okdialog.h6
-rw-r--r--src/gui/windows/outfitwindow.cpp64
-rw-r--r--src/gui/windows/outfitwindow.h6
-rw-r--r--src/gui/windows/pincodedialog.cpp6
-rw-r--r--src/gui/windows/pincodedialog.h6
-rw-r--r--src/gui/windows/questswindow.cpp6
-rw-r--r--src/gui/windows/questswindow.h6
-rw-r--r--src/gui/windows/quitdialog.cpp11
-rw-r--r--src/gui/windows/quitdialog.h6
-rw-r--r--src/gui/windows/registerdialog.cpp21
-rw-r--r--src/gui/windows/registerdialog.h8
-rw-r--r--src/gui/windows/serverdialog.cpp11
-rw-r--r--src/gui/windows/serverdialog.h6
-rw-r--r--src/gui/windows/serverinfowindow.cpp6
-rw-r--r--src/gui/windows/serverinfowindow.h6
-rw-r--r--src/gui/windows/setupwindow.cpp6
-rw-r--r--src/gui/windows/setupwindow.h6
-rw-r--r--src/gui/windows/shopselldialog.cpp6
-rw-r--r--src/gui/windows/shopselldialog.h6
-rw-r--r--src/gui/windows/shopwindow.cpp7
-rw-r--r--src/gui/windows/shopwindow.h6
-rw-r--r--src/gui/windows/shortcutwindow.cpp7
-rw-r--r--src/gui/windows/shortcutwindow.h6
-rw-r--r--src/gui/windows/skilldialog.cpp6
-rw-r--r--src/gui/windows/skilldialog.h6
-rw-r--r--src/gui/windows/socialwindow.cpp42
-rw-r--r--src/gui/windows/socialwindow.h9
-rw-r--r--src/gui/windows/statuswindow.cpp22
-rw-r--r--src/gui/windows/statuswindow.h7
-rw-r--r--src/gui/windows/textcommandeditor.cpp6
-rw-r--r--src/gui/windows/textcommandeditor.h6
-rw-r--r--src/gui/windows/textdialog.cpp6
-rw-r--r--src/gui/windows/textdialog.h6
-rw-r--r--src/gui/windows/textselectdialog.cpp6
-rw-r--r--src/gui/windows/textselectdialog.h6
-rw-r--r--src/gui/windows/tradewindow.cpp6
-rw-r--r--src/gui/windows/tradewindow.h6
-rw-r--r--src/gui/windows/updaterwindow.cpp40
-rw-r--r--src/gui/windows/updaterwindow.h9
-rw-r--r--src/gui/windows/whoisonline.cpp7
-rw-r--r--src/gui/windows/whoisonline.h6
-rw-r--r--src/gui/windows/worldselectdialog.cpp6
-rw-r--r--src/gui/windows/worldselectdialog.h6
111 files changed, 597 insertions, 491 deletions
diff --git a/src/gui/windows/bankwindow.cpp b/src/gui/windows/bankwindow.cpp
index f95a9d927..efd7553ba 100644
--- a/src/gui/windows/bankwindow.cpp
+++ b/src/gui/windows/bankwindow.cpp
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/bankwindow.h b/src/gui/windows/bankwindow.h
index b67d615cb..e5f5f18ad 100644
--- a/src/gui/windows/bankwindow.h
+++ b/src/gui/windows/bankwindow.h
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp
index b17064e45..a9ea274ae 100644
--- a/src/gui/windows/buydialog.cpp
+++ b/src/gui/windows/buydialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,6 +27,7 @@
#include "configuration.h"
#include "being/being.h"
+#include "being/playerinfo.h"
#include "enums/gui/layouttype.h"
@@ -225,6 +226,7 @@ BuyDialog::BuyDialog() :
mMoney(0),
mAmountItems(0),
mMaxItems(0),
+ mTotalPurchaseWeight(0),
mAdvanced(false)
{
init();
@@ -247,6 +249,7 @@ BuyDialog::BuyDialog(const BeingId npcId,
mMoney(0),
mAmountItems(0),
mMaxItems(0),
+ mTotalPurchaseWeight(0),
mAdvanced(Net::getNetworkType() != ServerType::TMWATHENA)
{
init();
@@ -271,6 +274,7 @@ BuyDialog::BuyDialog(const std::string &nick,
mMoney(0),
mAmountItems(0),
mMaxItems(0),
+ mTotalPurchaseWeight(0),
mAdvanced(false)
{
init();
@@ -295,6 +299,7 @@ BuyDialog::BuyDialog(const Being *const being,
mMoney(0),
mAmountItems(0),
mMaxItems(0),
+ mTotalPurchaseWeight(0),
mAdvanced(true)
{
init();
@@ -337,8 +342,8 @@ void BuyDialog::init()
"%d / %d", mAmountItems, mMaxItems));
mQuantityLabel->setAlignment(Graphics::CENTER);
mMoneyLabel = new Label(this, strprintf(
- // TRANSLATORS: buy dialog label
- _("Price: %s / Total: %s"), "", ""));
+ // TRANSLATORS: buy dialog label, price, remaining money & free weight
+ _("Price: %s, Remaining: %s & %s"), "", "", ""));
mAmountField = new IntTextField(this, 1, 1, 123, Enable_true, 0);
mAmountField->setActionEventId("amount");
@@ -472,6 +477,7 @@ void BuyDialog::reset()
mShopItemList->setSelected(-1);
mSlider->setValue(0);
+ mTotalPurchaseWeight = 0;
setMoney(0);
}
@@ -636,6 +642,8 @@ void BuyDialog::action(const ActionEvent &event)
else if (mNpcId == fromInt(Vending, BeingId))
{
item->increaseUsedQuantity(mAmountItems);
+ const int itemWeight = item->getInfo().getWeight();
+ mTotalPurchaseWeight += mAmountItems * itemWeight;
item->update();
if (mConfirmButton != nullptr)
mConfirmButton->setEnabled(true);
@@ -649,6 +657,8 @@ void BuyDialog::action(const ActionEvent &event)
if (mAdvanced)
{
item->increaseUsedQuantity(mAmountItems);
+ const int itemWeight = item->getInfo().getWeight();
+ mTotalPurchaseWeight += mAmountItems * itemWeight;
item->update();
if (mConfirmButton != nullptr)
mConfirmButton->setEnabled(true);
@@ -744,6 +754,10 @@ void BuyDialog::updateButtonsAndLabels()
{
const int selectedItem = mShopItemList->getSelected();
int price = 0;
+ int freeWeight
+ = PlayerInfo::getAttribute(Attributes::MAX_WEIGHT)
+ - PlayerInfo::getAttribute(Attributes::TOTAL_WEIGHT)
+ - mTotalPurchaseWeight;
if (selectedItem > -1)
{
@@ -753,13 +767,21 @@ void BuyDialog::updateButtonsAndLabels()
const int itemPrice = item->getPrice();
// Calculate how many the player can afford
- if (mNpcId == fromInt(Items, BeingId))
+ if (mNpcId == fromInt(Items, BeingId)) // /createitems "shop"
mMaxItems = 100;
else if (itemPrice != 0)
mMaxItems = mMoney / itemPrice;
else
mMaxItems = 1;
+ // Calculate how many the player can carry
+ const int itemWeight = item->getInfo().getWeight();
+ if (itemWeight != 0)
+ {
+ const int canCarry = freeWeight / itemWeight;
+ mMaxItems = std::min(mMaxItems, canCarry);
+ }
+
if (mNpcId == fromInt(Market, BeingId))
{
if (mMaxItems > item->getQuantity())
@@ -774,6 +796,7 @@ void BuyDialog::updateButtonsAndLabels()
if (mAmountItems > mMaxItems)
mAmountItems = mMaxItems;
+ freeWeight -= mAmountItems * itemWeight;
price = mAmountItems * itemPrice;
}
}
@@ -790,10 +813,11 @@ void BuyDialog::updateButtonsAndLabels()
mAmountField->setEnabled(mAmountItems > 0);
mQuantityLabel->setCaption(strprintf("%d / %d", mAmountItems, mMaxItems));
- // TRANSLATORS: buy dialog label
- mMoneyLabel->setCaption(strprintf(_("Price: %s / Total: %s"),
+ // TRANSLATORS: buy dialog label, price, remaining money & free weight
+ mMoneyLabel->setCaption(strprintf(_("Price: %s, Remaining: %s & %s"),
UnitsDb::formatCurrency(mCurrency, price).c_str(),
- UnitsDb::formatCurrency(mCurrency, mMoney - price).c_str()));
+ UnitsDb::formatCurrency(mCurrency, mMoney - price).c_str(),
+ UnitsDb::formatWeight(freeWeight).c_str()));
}
void BuyDialog::setVisible(Visible visible)
diff --git a/src/gui/windows/buydialog.h b/src/gui/windows/buydialog.h
index 4535e1201..25be6a133 100644
--- a/src/gui/windows/buydialog.h
+++ b/src/gui/windows/buydialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -202,6 +202,8 @@ class BuyDialog final : public Window,
int mMoney;
int mAmountItems;
int mMaxItems;
+ // combined weight of all items added to shopping list
+ int mTotalPurchaseWeight;
bool mAdvanced;
};
diff --git a/src/gui/windows/buyingstoreselldialog.cpp b/src/gui/windows/buyingstoreselldialog.cpp
index 8c12655bf..1368d0750 100644
--- a/src/gui/windows/buyingstoreselldialog.cpp
+++ b/src/gui/windows/buyingstoreselldialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/buyingstoreselldialog.h b/src/gui/windows/buyingstoreselldialog.h
index cebefc64f..2bcac13b8 100644
--- a/src/gui/windows/buyingstoreselldialog.h
+++ b/src/gui/windows/buyingstoreselldialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/buyselldialog.cpp b/src/gui/windows/buyselldialog.cpp
index 7312e6d5f..2e402bd6e 100644
--- a/src/gui/windows/buyselldialog.cpp
+++ b/src/gui/windows/buyselldialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/buyselldialog.h b/src/gui/windows/buyselldialog.h
index b94e7d548..aa66c7098 100644
--- a/src/gui/windows/buyselldialog.h
+++ b/src/gui/windows/buyselldialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/changeemaildialog.cpp b/src/gui/windows/changeemaildialog.cpp
index 914c541be..86f6f0e81 100644
--- a/src/gui/windows/changeemaildialog.cpp
+++ b/src/gui/windows/changeemaildialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2008-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/changeemaildialog.h b/src/gui/windows/changeemaildialog.h
index a9fbf24c9..2bdec8a11 100644
--- a/src/gui/windows/changeemaildialog.h
+++ b/src/gui/windows/changeemaildialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2008-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/changepassworddialog.cpp b/src/gui/windows/changepassworddialog.cpp
index fab43237d..14cc33a1b 100644
--- a/src/gui/windows/changepassworddialog.cpp
+++ b/src/gui/windows/changepassworddialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/changepassworddialog.h b/src/gui/windows/changepassworddialog.h
index d5320f3de..6be08716b 100644
--- a/src/gui/windows/changepassworddialog.h
+++ b/src/gui/windows/changepassworddialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index 5e17f076e..9dd872bd7 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -51,6 +51,7 @@
#include "utils/delete2.h"
#include "utils/gettext.h"
+#include "utils/performance.h"
#include "debug.h"
diff --git a/src/gui/windows/charcreatedialog.h b/src/gui/windows/charcreatedialog.h
index 57e7359fe..74d705e6e 100644
--- a/src/gui/windows/charcreatedialog.h
+++ b/src/gui/windows/charcreatedialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/chardeleteconfirm.h b/src/gui/windows/chardeleteconfirm.h
index bce393abb..38d0462b3 100644
--- a/src/gui/windows/chardeleteconfirm.h
+++ b/src/gui/windows/chardeleteconfirm.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp
index 77e224f7a..c7a2e0eef 100644
--- a/src/gui/windows/charselectdialog.cpp
+++ b/src/gui/windows/charselectdialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -47,6 +47,7 @@
#include "net/character.h"
#include "net/charserverhandler.h"
#include "net/logindata.h"
+#include "net/loginhandler.h"
#ifdef TMWA_SUPPORT
#include "net/net.h"
#endif // TMWA_SUPPORT
@@ -71,9 +72,13 @@ CharSelectDialog::CharSelectDialog(LoginData &data) :
ActionListener(),
KeyListener(),
mLoginData(&data),
- // TRANSLATORS: char select dialog. button.
- mSwitchLoginButton(new Button(this, _("Switch"), "switch",
- BUTTON_SKIN, this)),
+ mSwitchLoginButton(new Button(this,
+ (loginHandler != nullptr && loginHandler->getWorlds().size() > 1)
+ // TRANSLATORS: char select dialog. button.
+ ? _("Switch World") : _("Logout"),
+ "switch",
+ BUTTON_SKIN,
+ this)),
// TRANSLATORS: char select dialog. button.
mChangePasswordButton(new Button(this, _("Password"), "change_password",
BUTTON_SKIN, this)),
@@ -102,15 +107,11 @@ CharSelectDialog::CharSelectDialog(LoginData &data) :
placer = getPlacer(0, 0);
// disable logout using -S
+ int column = 0;
if (!settings.options.uniqueSession)
- {
- placer(0, 0, mSwitchLoginButton, 1, 1);
- }
- int n = 1;
- placer(n, 0, mChangePasswordButton, 1, 1);
- n ++;
- placer(n, 0, mDeleteButton, 1, 1);
- n ++;
+ placer(column++, 0, mSwitchLoginButton, 1, 1);
+ placer(column++, 0, mChangePasswordButton, 1, 1);
+ placer(column++, 0, mDeleteButton, 1, 1);
#ifdef TMWA_SUPPORT
if (Net::getNetworkType() != ServerType::TMWATHENA)
#endif
@@ -121,8 +122,7 @@ CharSelectDialog::CharSelectDialog(LoginData &data) :
"rename",
BUTTON_SKIN,
this);
- placer(n, 0, mRenameButton, 1, 1);
- n ++;
+ placer(column++, 0, mRenameButton, 1, 1);
}
#ifdef TMWA_SUPPORT
if (serverFeatures->havePincode())
@@ -134,11 +134,9 @@ CharSelectDialog::CharSelectDialog(LoginData &data) :
"changepin",
BUTTON_SKIN,
this);
- placer(n, 0, mChangePinButton, 1, 1);
- n ++;
+ placer(column++, 0, mChangePinButton, 1, 1);
}
- placer(n, 0, mInfoButton, 1, 1);
- n ++;
+ placer(column++, 0, mInfoButton, 1, 1);
for (int i = 0; i < CAST_S32(mLoginData->characterSlots); i++)
{
@@ -314,12 +312,16 @@ void CharSelectDialog::action(const ActionEvent &event)
return;
if ((mDeleteDialog != nullptr) && mDeleteIndex != -1)
{
+ const Net::Character *const character
+ = mCharacterEntries[mDeleteIndex]->getCharacter();
if (serverFeatures->haveEmailOnDelete())
{
attemptCharacterDelete(mDeleteIndex, mDeleteDialog->getText());
mDeleteDialog = nullptr;
}
- else if (mDeleteDialog->getText() == LoginDialog::savedPassword)
+ else if (character != nullptr &&
+ character->dummy != nullptr &&
+ mDeleteDialog->getText() == character->dummy->getName())
{
attemptCharacterDelete(mDeleteIndex, "");
mDeleteDialog = nullptr;
@@ -330,7 +332,7 @@ void CharSelectDialog::action(const ActionEvent &event)
// TRANSLATORS: error header
_("Error"),
// TRANSLATORS: error message
- _("Incorrect password"),
+ _("Incorrect character name"),
// TRANSLATORS: ok dialog button
_("OK"),
DialogType::ERROR,
@@ -504,11 +506,11 @@ void CharSelectDialog::askPasswordForDeletion(const int index)
{
CREATEWIDGETV(mDeleteDialog, TextDialog,
// TRANSLATORS: char deletion question.
- _("Enter password for deleting character"),
+ _("Enter character name to confirm deleting the character"),
// TRANSLATORS: email label.
- _("Enter password:"),
+ _("Enter character name:"),
this,
- true);
+ false);
}
mDeleteDialog->setActionEventId("try delete character");
mDeleteDialog->addActionListener(this);
@@ -623,7 +625,7 @@ bool CharSelectDialog::selectByName(const std::string &name,
void CharSelectDialog::close()
{
- client->setState(State::SWITCH_LOGIN);
+ client->setState(State::SWITCH_WORLD);
Window::close();
}
diff --git a/src/gui/windows/charselectdialog.h b/src/gui/windows/charselectdialog.h
index d41474247..acc14db95 100644
--- a/src/gui/windows/charselectdialog.h
+++ b/src/gui/windows/charselectdialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index a3b777655..71e94adc6 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -52,6 +52,7 @@
#include "gui/windows/setupwindow.h"
#include "gui/windows/whoisonline.h"
+#include "gui/widgets/browserbox.h"
#include "gui/widgets/button.h"
#include "gui/widgets/chatinput.h"
#include "gui/widgets/createwidget.h"
@@ -77,6 +78,7 @@
#include "utils/copynpaste.h"
#include "utils/delete2.h"
#include "utils/foreach.h"
+#include "utils/performance.h"
#include "utils/translation/podict.h"
@@ -1246,8 +1248,6 @@ WhisperTab *ChatWindow::addWhisperTab(const std::string &caption,
if ((gui != nullptr) && !playerRelations.isGoodName(nick))
ret->setLabelFont(gui->getSecureFont());
mWhispers[tempNick] = ret;
- if (config.getBoolValue("showChatHistory"))
- ret->loadFromLogFile(nick);
}
if (switchTo)
@@ -1330,8 +1330,6 @@ ChatTab *ChatWindow::addChannelTab(const std::string &name,
ret = new ChannelTab(this, name);
mChannels[tempName] = ret;
ret->setAllowHighlight(false);
- if (config.getBoolValue("showChatHistory"))
- ret->loadFromLogFile(name);
}
if (switchTo)
diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h
index 4c8150d04..63816501b 100644
--- a/src/gui/windows/chatwindow.h
+++ b/src/gui/windows/chatwindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/clanwindow.cpp b/src/gui/windows/clanwindow.cpp
index a624056d0..c64c81bb8 100644
--- a/src/gui/windows/clanwindow.cpp
+++ b/src/gui/windows/clanwindow.cpp
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,6 +32,7 @@
#include "utils/delete2.h"
#include "utils/gettext.h"
+#include "utils/performance.h"
#include "debug.h"
diff --git a/src/gui/windows/clanwindow.h b/src/gui/windows/clanwindow.h
index a378ad95e..1f2aedbac 100644
--- a/src/gui/windows/clanwindow.h
+++ b/src/gui/windows/clanwindow.h
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/confirmdialog.cpp b/src/gui/windows/confirmdialog.cpp
index c3212d96f..ea1f31a1f 100644
--- a/src/gui/windows/confirmdialog.cpp
+++ b/src/gui/windows/confirmdialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/confirmdialog.h b/src/gui/windows/confirmdialog.h
index 6af33a17b..18a991746 100644
--- a/src/gui/windows/confirmdialog.h
+++ b/src/gui/windows/confirmdialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/connectiondialog.cpp b/src/gui/windows/connectiondialog.cpp
index df5e4a2ad..61392d914 100644
--- a/src/gui/windows/connectiondialog.cpp
+++ b/src/gui/windows/connectiondialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,6 +29,7 @@
#include "gui/widgets/progressindicator.h"
#include "utils/gettext.h"
+#include "utils/performance.h"
#include "client.h"
diff --git a/src/gui/windows/connectiondialog.h b/src/gui/windows/connectiondialog.h
index ec170778e..795f14697 100644
--- a/src/gui/windows/connectiondialog.h
+++ b/src/gui/windows/connectiondialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/cutinwindow.cpp b/src/gui/windows/cutinwindow.cpp
index f7c754f07..083337295 100644
--- a/src/gui/windows/cutinwindow.cpp
+++ b/src/gui/windows/cutinwindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/cutinwindow.h b/src/gui/windows/cutinwindow.h
index b09a5da6e..0a10efe95 100644
--- a/src/gui/windows/cutinwindow.h
+++ b/src/gui/windows/cutinwindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/debugwindow.cpp b/src/gui/windows/debugwindow.cpp
index 7ac29d649..7a875efa5 100644
--- a/src/gui/windows/debugwindow.cpp
+++ b/src/gui/windows/debugwindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 @@
#include "utils/delete2.h"
#include "utils/gettext.h"
+#include "utils/performance.h"
#include "debug.h"
diff --git a/src/gui/windows/debugwindow.h b/src/gui/windows/debugwindow.h
index 1e26e8408..0879e76a8 100644
--- a/src/gui/windows/debugwindow.h
+++ b/src/gui/windows/debugwindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/didyouknowwindow.cpp b/src/gui/windows/didyouknowwindow.cpp
index ffcc7a99b..928158ec7 100644
--- a/src/gui/windows/didyouknowwindow.cpp
+++ b/src/gui/windows/didyouknowwindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/didyouknowwindow.h b/src/gui/windows/didyouknowwindow.h
index c529b8455..34dc5aab4 100644
--- a/src/gui/windows/didyouknowwindow.h
+++ b/src/gui/windows/didyouknowwindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/editdialog.cpp b/src/gui/windows/editdialog.cpp
index c8a3b3065..de0e7348d 100644
--- a/src/gui/windows/editdialog.cpp
+++ b/src/gui/windows/editdialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2009 The Mana World Development Team
* Copyright (C) 2009-2010 Andrei Karas
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/editdialog.h b/src/gui/windows/editdialog.h
index 78d956e47..12c57fed8 100644
--- a/src/gui/windows/editdialog.h
+++ b/src/gui/windows/editdialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2009 The Mana World Development Team
* Copyright (C) 2009-2010 Andrei Karas
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp
index 51b208164..847fe1591 100644
--- a/src/gui/windows/editserverdialog.cpp
+++ b/src/gui/windows/editserverdialog.cpp
@@ -1,10 +1,10 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2012 The Mana Developers
* Copyright (C) 2012-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -103,19 +103,27 @@ EditServerDialog::EditServerDialog(ServerDialog *const parent,
place(0, 0, nameLabel, 1, 1);
place(1, 0, mNameField, 4, 1).setPadding(3);
+
place(0, 1, serverAdressLabel, 1, 1);
place(1, 1, mServerAddressField, 4, 1).setPadding(3);
+
place(0, 2, portLabel, 1, 1);
place(1, 2, mPortField, 4, 1).setPadding(3);
+
place(0, 3, typeLabel, 1, 1);
- place(1, 3, mTypeField, 1, 1).setPadding(3);
+ place(1, 3, mTypeField, 4, 1).setPadding(3);
+
place(0, 4, descriptionLabel, 1, 1);
place(1, 4, mDescriptionField, 4, 1).setPadding(3);
+
place(0, 5, onlineListUrlLabel, 1, 1);
place(1, 5, mOnlineListUrlField, 4, 1).setPadding(3);
+
place(0, 6, packetVersionLabel, 1, 1);
place(1, 6, mPacketVersionField, 4, 1).setPadding(3);
+
place(0, 7, mPersistentIp, 4, 1).setPadding(3);
+
place(0, 8, mConnectButton, 1, 1);
place(4, 8, mOkButton, 1, 1);
place(3, 8, mCancelButton, 1, 1);
@@ -157,24 +165,16 @@ EditServerDialog::EditServerDialog(ServerDialog *const parent,
switch (mServer.type)
{
- case ServerType::EATHENA:
-#ifdef TMWA_SUPPORT
- mTypeField->setSelected(1);
-#else // TMWA_SUPPORT
- mTypeField->setSelected(0);
-#endif // TMWA_SUPPORT
- break;
default:
case ServerType::UNKNOWN:
case ServerType::TMWATHENA:
mTypeField->setSelected(0);
break;
+ case ServerType::EATHENA:
+ mTypeField->setSelected(1 - SERVER_TYPE_INDEX_OFFSET);
+ break;
case ServerType::EVOL2:
-#ifdef TMWA_SUPPORT
- mTypeField->setSelected(2);
-#else // TMWA_SUPPORT
- mTypeField->setSelected(1);
-#endif // TMWA_SUPPORT
+ mTypeField->setSelected(2 - SERVER_TYPE_INDEX_OFFSET);
break;
}
@@ -245,22 +245,13 @@ void EditServerDialog::action(const ActionEvent &event)
case 0:
mServer.type = ServerType::TMWATHENA;
break;
- case 1:
- mServer.type = ServerType::EATHENA;
- break;
- case 2:
+#endif // TMWA_SUPPORT
+ case 1 - SERVER_TYPE_INDEX_OFFSET:
mServer.type = ServerType::EVOL2;
break;
-#else // TMWA_SUPPORT
-
- case 0:
+ case 2 - SERVER_TYPE_INDEX_OFFSET:
mServer.type = ServerType::EATHENA;
break;
- case 1:
- mServer.type = ServerType::EVOL2;
- break;
-#endif // TMWA_SUPPORT
-
default:
mServer.type = ServerType::UNKNOWN;
break;
diff --git a/src/gui/windows/editserverdialog.h b/src/gui/windows/editserverdialog.h
index ca5a6d718..83adf9b91 100644
--- a/src/gui/windows/editserverdialog.h
+++ b/src/gui/windows/editserverdialog.h
@@ -1,10 +1,10 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2012 The Mana Developers
* Copyright (C) 2012-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/eggselectiondialog.cpp b/src/gui/windows/eggselectiondialog.cpp
index c5ab28264..a80d202d2 100644
--- a/src/gui/windows/eggselectiondialog.cpp
+++ b/src/gui/windows/eggselectiondialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/eggselectiondialog.h b/src/gui/windows/eggselectiondialog.h
index 4f3ec692b..a08ab50f7 100644
--- a/src/gui/windows/eggselectiondialog.h
+++ b/src/gui/windows/eggselectiondialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/emotewindow.cpp b/src/gui/windows/emotewindow.cpp
index 628cdb53c..9fceb0277 100644
--- a/src/gui/windows/emotewindow.cpp
+++ b/src/gui/windows/emotewindow.cpp
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2013-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/emotewindow.h b/src/gui/windows/emotewindow.h
index 0fb6d131b..01d97e772 100644
--- a/src/gui/windows/emotewindow.h
+++ b/src/gui/windows/emotewindow.h
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2013-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp
index d882468ff..f6c3cc643 100644
--- a/src/gui/windows/equipmentwindow.cpp
+++ b/src/gui/windows/equipmentwindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -51,6 +51,7 @@
#include "utils/dtor.h"
#include "utils/foreach.h"
#include "utils/gettext.h"
+#include "utils/performance.h"
#include "net/inventoryhandler.h"
diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h
index 7c58cf04a..207dbf05c 100644
--- a/src/gui/windows/equipmentwindow.h
+++ b/src/gui/windows/equipmentwindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/helpwindow.cpp b/src/gui/windows/helpwindow.cpp
index 38e194e6e..cb4a82d34 100644
--- a/src/gui/windows/helpwindow.cpp
+++ b/src/gui/windows/helpwindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/helpwindow.h b/src/gui/windows/helpwindow.h
index 3a243f41a..c779e2d49 100644
--- a/src/gui/windows/helpwindow.h
+++ b/src/gui/windows/helpwindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/insertcarddialog.cpp b/src/gui/windows/insertcarddialog.cpp
index 917eb9d5f..2acba3613 100644
--- a/src/gui/windows/insertcarddialog.cpp
+++ b/src/gui/windows/insertcarddialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/insertcarddialog.h b/src/gui/windows/insertcarddialog.h
index 3512d7939..1eed4c178 100644
--- a/src/gui/windows/insertcarddialog.h
+++ b/src/gui/windows/insertcarddialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 41d34df13..ef6cee215 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/inventorywindow.h b/src/gui/windows/inventorywindow.h
index 4f3fdc15a..96698d72f 100644
--- a/src/gui/windows/inventorywindow.h
+++ b/src/gui/windows/inventorywindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp
index e6f354943..75aa0c823 100644
--- a/src/gui/windows/itemamountwindow.cpp
+++ b/src/gui/windows/itemamountwindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/itemamountwindow.h b/src/gui/windows/itemamountwindow.h
index 5d251199d..bc339e6b4 100644
--- a/src/gui/windows/itemamountwindow.h
+++ b/src/gui/windows/itemamountwindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/killstats.cpp b/src/gui/windows/killstats.cpp
index 2c965dbeb..210c0d2bc 100644
--- a/src/gui/windows/killstats.cpp
+++ b/src/gui/windows/killstats.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2009 The Mana World Development Team
* Copyright (C) 2009-2010 Andrei Karas
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,10 +36,11 @@
#include "being/playerinfo.h"
#include "utils/gettext.h"
+#include "utils/performance.h"
-#ifdef WIN32
+#ifdef _WIN32
#include <sys/time.h>
-#endif // WIN32
+#endif // _WIN32
#include "debug.h"
diff --git a/src/gui/windows/killstats.h b/src/gui/windows/killstats.h
index 321acf420..cdd08dc0c 100644
--- a/src/gui/windows/killstats.h
+++ b/src/gui/windows/killstats.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2009 The Mana World Development Team
* Copyright (C) 2009-2010 Andrei Karas
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp
index 96f371660..d86c32a2f 100644
--- a/src/gui/windows/logindialog.cpp
+++ b/src/gui/windows/logindialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/logindialog.h b/src/gui/windows/logindialog.h
index 95e394291..91c3bfb13 100644
--- a/src/gui/windows/logindialog.h
+++ b/src/gui/windows/logindialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/maileditwindow.cpp b/src/gui/windows/maileditwindow.cpp
index 8a12912ca..e7fad6aab 100644
--- a/src/gui/windows/maileditwindow.cpp
+++ b/src/gui/windows/maileditwindow.cpp
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/maileditwindow.h b/src/gui/windows/maileditwindow.h
index e223fc961..dd9c42ee6 100644
--- a/src/gui/windows/maileditwindow.h
+++ b/src/gui/windows/maileditwindow.h
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/mailviewwindow.cpp b/src/gui/windows/mailviewwindow.cpp
index d0d42f168..e534ce4b4 100644
--- a/src/gui/windows/mailviewwindow.cpp
+++ b/src/gui/windows/mailviewwindow.cpp
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -69,6 +69,9 @@ MailViewWindow::MailViewWindow(MailMessage *const message,
// TRANSLATORS: mail view window label
mTimeLabel(new Label(this, strprintf("%s %s", _("Time:"),
message->strTime.c_str()))),
+ // TRANSLATORS: mail view window label - mail expiry time
+ mExpireTimeLabel(new Label(this, strprintf("%s %s", _("Expires at:"),
+ timeToStr(message->expireTime).c_str()))),
mMoneyLabel(nullptr),
// TRANSLATORS: mail view window label
mFromLabel(new Label(this, strprintf("%s %s", _("From:"),
@@ -107,6 +110,7 @@ MailViewWindow::MailViewWindow(MailMessage *const message,
int n = 0;
placer(0, n++, mTimeLabel, 1, 1);
+ placer(0, n++, mExpireTimeLabel, 1, 1);
placer(0, n++, mFromLabel, 1, 1);
placer(0, n++, mSubjectLabel, 1, 1);
if (message->money != 0)
diff --git a/src/gui/windows/mailviewwindow.h b/src/gui/windows/mailviewwindow.h
index 201fea426..e275a55ed 100644
--- a/src/gui/windows/mailviewwindow.h
+++ b/src/gui/windows/mailviewwindow.h
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -66,6 +66,7 @@ class MailViewWindow final : public Window,
Button *mNextButton;
Button *mReplyButton;
Label *mTimeLabel;
+ Label *mExpireTimeLabel;
Label *mMoneyLabel;
Label *mFromLabel;
Label *mSubjectLabel;
diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp
index 5b91b099b..ddc91603f 100644
--- a/src/gui/windows/mailwindow.cpp
+++ b/src/gui/windows/mailwindow.cpp
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -92,25 +92,39 @@ MailWindow::MailWindow() :
if (setupWindow != nullptr)
setupWindow->registerWindowForReset(this);
- setDefaultSize(310, 180, ImagePosition::CENTER, 0, 0);
- setMinWidth(310);
- setMinHeight(250);
center();
+ // use line wrapping of mail subjects, instead.
mListScrollArea->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER);
-
- ContainerPlacer placer(nullptr, nullptr);
- placer = getPlacer(0, 0);
-
- placer(0, 0, mListScrollArea, 4, 5).setPadding(3);
- placer(4, 0, mRefreshButton, 1, 1);
- placer(4, 1, mOpenButton, 1, 1);
- placer(4, 2, mNewButton, 1, 1);
- placer(4, 3, mDeleteButton, 1, 1);
- placer(4, 4, mReturnButton, 1, 1);
+ // set reasonable minimum width for calculations below
+ mListScrollArea->setWidth(200);
+
+ // at 0,0 and spawns/spans 4 columns and 6 rows
+ place(0, 0, mListScrollArea, 1, 6).setPadding(3);
+ // at column 5 and row 0...
+ place(1, 0, mRefreshButton, 1, 1);
+ place(1, 1, mOpenButton, 1, 1);
+ place(1, 2, mNewButton, 1, 1);
+ // Leave intentional gap in grid so that the button column (and thus,
+ // the whole window) can be resized without resizing any of the buttons.
+ // note: the empty cell still seems to enforce some padding, but this
+ // is fine.
+ place(1, 4, mDeleteButton, 1, 1);
+ place(1, 5, mReturnButton, 1, 1);
Layout &layout = getLayout();
- layout.setRowHeight(0, LayoutType::SET);
+ // scrollarea column and 4th row eat all remaining available screen space.
+ layout.setColWidth(0, LayoutType::SET);
+ layout.setRowHeight(3, LayoutType::SET);
+
+ // Enforce a minimum size.
+ int width = 0;
+ int height = 0;
+ layout.reflow(width, height);
+ setContentSize(width, height);
+ setMinWidth(getWidth());
+ setMinHeight(getHeight());
+ setDefaultSize(getWidth(), getHeight(), ImagePosition::CENTER, 0, 0);
loadWindowState();
enableVisibleSound(true);
@@ -255,6 +269,13 @@ void MailWindow::removeMail(const int64_t id)
if (message != nullptr)
mMailModel->add(getMailHeader(message));
}
+
+ // if player deleted the selected mail, then selection does not change
+ // (selects next one in list). However, if they deleted the last one,
+ // then we go to the previous one in list.
+ const auto lastIndex = mMailModel->getNumberOfElements() - 1;
+ if (mListBox->getSelected() > lastIndex)
+ mListBox->setSelected(lastIndex);
}
void MailWindow::showMessage(MailMessage *const mail,
diff --git a/src/gui/windows/mailwindow.h b/src/gui/windows/mailwindow.h
index 062bb229d..e104c0235 100644
--- a/src/gui/windows/mailwindow.h
+++ b/src/gui/windows/mailwindow.h
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp
index d40efd032..85e2c9dbf 100644
--- a/src/gui/windows/minimap.cpp
+++ b/src/gui/windows/minimap.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -54,6 +54,7 @@
#include "utils/gettext.h"
#include "utils/foreach.h"
+#include "utils/performance.h"
#include "utils/sdlcheckutils.h"
#include "utils/stdmove.h"
@@ -495,11 +496,9 @@ void Minimap::mouseReleased(MouseEvent &event)
if (event.getButton() == MouseButton::LEFT)
{
- int x = event.getX();
- int y = event.getY();
- screenToMap(x, y);
-
- localPlayer->navigateTo(x, y);
+ Position pos(event.getX(), event.getY());
+ screenToMap(pos.x, pos.y);
+ localPlayer->navigateTo(pos);
}
else if (event.getButton() == MouseButton::RIGHT)
{
diff --git a/src/gui/windows/minimap.h b/src/gui/windows/minimap.h
index 2c4429514..8bbcfb553 100644
--- a/src/gui/windows/minimap.h
+++ b/src/gui/windows/minimap.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index 4c2b2d376..8b5159333 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -50,6 +50,7 @@
#include "utils/dtor.h"
#include "utils/foreach.h"
#include "utils/gettext.h"
+#include "utils/performance.h"
#include "debug.h"
@@ -275,8 +276,6 @@ void MiniStatusWindow::statChanged(const AttributesT id A_UNUSED,
statusWindow->updateMPBar(mMpBar,
false);
}
- StatusWindow::updateJobBar(mJobBar,
- true);
}
void MiniStatusWindow::attributeChanged(const AttributesT id,
@@ -302,6 +301,11 @@ void MiniStatusWindow::attributeChanged(const AttributesT id,
StatusWindow::updateXPBar(mXpBar,
true);
break;
+ case Attributes::PLAYER_JOB_LEVEL:
+ case Attributes::PLAYER_JOB_EXP:
+ case Attributes::PLAYER_JOB_EXP_NEEDED:
+ StatusWindow::updateJobBar(mJobBar, true);
+ break;
case Attributes::TOTAL_WEIGHT:
case Attributes::MAX_WEIGHT:
StatusWindow::updateWeightBar(mWeightBar);
@@ -459,10 +463,20 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event)
}
else if (event.getSource() == mWeightBar)
{
- textPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(),
- strprintf("%d/%d", PlayerInfo::getAttribute(
- Attributes::TOTAL_WEIGHT),
- PlayerInfo::getAttribute(Attributes::MAX_WEIGHT)));
+ const int totalWeight
+ = PlayerInfo::getAttribute(Attributes::TOTAL_WEIGHT);
+ const int maxWeight = PlayerInfo::getAttribute(Attributes::MAX_WEIGHT);
+ const int freeWeight = maxWeight - totalWeight;
+ // see maxWeight == 0 edge case in statuswindow for why:
+ const std::string freeWeightStr
+ = (freeWeight >= 0)
+ ? strprintf("Free: %d", freeWeight)
+ : "";
+
+ textPopup->show(x + rect.x, y + rect.y,
+ event.getSource()->getId(),
+ strprintf("%d/%d", totalWeight, maxWeight),
+ freeWeightStr);
mStatusPopup->hide();
}
else if (event.getSource() == mInvSlotsBar)
diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h
index 921fe5d98..75f1f5bf3 100644
--- a/src/gui/windows/ministatuswindow.h
+++ b/src/gui/windows/ministatuswindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index 4ace1d6f8..2061439af 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -76,6 +76,7 @@
#include "utils/delete2.h"
#include "utils/foreach.h"
#include "utils/gettext.h"
+#include "utils/performance.h"
#include <sstream>
@@ -296,8 +297,7 @@ void NpcDialog::addText(const std::string &text, const bool save)
mText.clear();
mNewText.append(text);
- mTextBox->addRow(text,
- false);
+ mTextBox->addRow(text, false);
}
mScrollArea->setVerticalScrollAmount(mScrollArea->getVerticalMaxScroll());
mActionState = NpcActionState::WAIT;
@@ -1318,8 +1318,7 @@ void NpcDialog::createSkinControls()
splitToStringVector(parts, info->text, '\n');
FOR_EACH (StringVectCIter, it2, parts)
{
- box->addRow(*it2,
- false);
+ box->addRow(*it2, false);
}
}
FOR_EACH (STD_VECTOR<NpcButtonInfo*>::const_iterator,
diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h
index 15d0441c7..41c42f107 100644
--- a/src/gui/windows/npcdialog.h
+++ b/src/gui/windows/npcdialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -167,7 +167,7 @@ class NpcDialog final : public Window,
static bool isAnyInputFocused() A_WARN_UNUSED;
/**
- * Requests a interger from the user.
+ * Requests an integer from the user.
*/
void integerRequest(const int defaultValue,
const int min,
diff --git a/src/gui/windows/npcselldialog.cpp b/src/gui/windows/npcselldialog.cpp
index b875ac6a6..713109a02 100644
--- a/src/gui/windows/npcselldialog.cpp
+++ b/src/gui/windows/npcselldialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/npcselldialog.h b/src/gui/windows/npcselldialog.h
index 44c5d7e01..2803e9f4c 100644
--- a/src/gui/windows/npcselldialog.h
+++ b/src/gui/windows/npcselldialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/okdialog.cpp b/src/gui/windows/okdialog.cpp
index 60712df39..39190811a 100644
--- a/src/gui/windows/okdialog.cpp
+++ b/src/gui/windows/okdialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/okdialog.h b/src/gui/windows/okdialog.h
index de57bd0c7..7ca56c5ef 100644
--- a/src/gui/windows/okdialog.h
+++ b/src/gui/windows/okdialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp
index d547e5486..0f9761a92 100644
--- a/src/gui/windows/outfitwindow.cpp
+++ b/src/gui/windows/outfitwindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2007-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -48,6 +48,7 @@
#include "gui/widgets/layout.h"
#include "utils/gettext.h"
+#include "utils/performance.h"
#include "resources/inventory/inventory.h"
@@ -151,30 +152,17 @@ void OutfitWindow::load()
std::string buf;
std::stringstream ss(outfit);
- STD_VECTOR<int> tokens;
-
- while (ss >> buf)
- tokens.push_back(atoi(buf.c_str()));
-
- for (size_t i = 0, sz = tokens.size();
- i < sz && i < OUTFIT_ITEM_COUNT; i++)
+ for (size_t i = 0; (ss >> buf) && i < OUTFIT_ITEM_COUNT; i++)
{
- mItems[o][i] = tokens[i];
+ mItems[o][i] = atoi(buf.c_str());
}
outfit = cfg->getValue("OutfitColor" + toString(o), "1");
std::stringstream ss2(outfit);
- tokens.clear();
-
- STD_VECTOR<unsigned char> tokens2;
- while (ss2 >> buf)
- tokens2.push_back(CAST_U8(atoi(buf.c_str())));
-
- for (size_t i = 0, sz = tokens2.size();
- i < sz && i < OUTFIT_ITEM_COUNT; i++)
+ for (size_t i = 0; (ss2 >> buf) && i < OUTFIT_ITEM_COUNT; i++)
{
- mItemColors[o][i] = fromInt(tokens2[i], ItemColor);
+ mItemColors[o][i] = fromInt(CAST_U8(atoi(buf.c_str())), ItemColor);
}
mItemsUnequip[o] = cfg->getValueBool("OutfitUnequip" + toString(o),
@@ -194,31 +182,41 @@ void OutfitWindow::save() const
std::string outfitColorsStr;
for (unsigned o = 0; o < OUTFITS_COUNT; o++)
{
- bool good = false;
+ bool isEmpty = true;
for (unsigned i = 0; i < OUTFIT_ITEM_COUNT; i++)
{
const int val = mItems[o][i];
- const int res = val != 0 ? val : -1;
- if (res != -1)
- good = true;
+ // Not sure why, but "empty" is stored as -1 instead of 0.
+ int res;
+ if (val == 0)
+ res = -1;
+ else
+ {
+ isEmpty = false;
+ res = val;
+ }
+
outfitStr.append(toString(res));
+ outfitColorsStr.append(toString(CAST_S32(mItemColors[o][i])));
+
if (i < OUTFIT_ITEM_COUNT - 1)
+ {
outfitStr.append(" ");
- outfitColorsStr.append(toString(CAST_S32(
- toInt(mItemColors[o][i], int))));
- if (i < OUTFIT_ITEM_COUNT - 1)
outfitColorsStr.append(" ");
+ }
}
- if (good)
+
+ if (isEmpty)
{
- serverConfig.setValue("Outfit" + toString(o), outfitStr);
- serverConfig.setValue("OutfitColor" + toString(o),
- outfitColorsStr);
+ serverConfig.deleteKey("Outfit" + toString(o));
+ serverConfig.deleteKey("OutfitColor" + toString(o));
}
else
{
- serverConfig.deleteKey("Outfit" + toString(o));
- serverConfig.deleteKey("OutfitColor" + toString(o));
+ serverConfig.setValue("Outfit" + toString(o),
+ outfitStr);
+ serverConfig.setValue("OutfitColor" + toString(o),
+ outfitColorsStr);
}
if (mItemsUnequip[o])
diff --git a/src/gui/windows/outfitwindow.h b/src/gui/windows/outfitwindow.h
index f30b79975..f9ce15c8a 100644
--- a/src/gui/windows/outfitwindow.h
+++ b/src/gui/windows/outfitwindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2007-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/pincodedialog.cpp b/src/gui/windows/pincodedialog.cpp
index fa2e0da59..fa5b001f0 100644
--- a/src/gui/windows/pincodedialog.cpp
+++ b/src/gui/windows/pincodedialog.cpp
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/pincodedialog.h b/src/gui/windows/pincodedialog.h
index f2799bc80..fe1c349e3 100644
--- a/src/gui/windows/pincodedialog.h
+++ b/src/gui/windows/pincodedialog.h
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp
index baae67165..72a8bcae0 100644
--- a/src/gui/windows/questswindow.cpp
+++ b/src/gui/windows/questswindow.cpp
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2012-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/questswindow.h b/src/gui/windows/questswindow.h
index 2580ddf79..7a6dace7b 100644
--- a/src/gui/windows/questswindow.h
+++ b/src/gui/windows/questswindow.h
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2012-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/quitdialog.cpp b/src/gui/windows/quitdialog.cpp
index d1ceb1ad9..d1f9cabea 100644
--- a/src/gui/windows/quitdialog.cpp
+++ b/src/gui/windows/quitdialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -210,6 +210,7 @@ void QuitDialog::keyPressed(KeyEvent &event)
{
const InputActionT actionId = event.getActionId();
int dir = 0;
+ bool consume = true;
PRAGMA45(GCC diagnostic push)
PRAGMA45(GCC diagnostic ignored "-Wswitch-enum")
@@ -229,10 +230,14 @@ void QuitDialog::keyPressed(KeyEvent &event)
dir = 1;
break;
default:
+ consume = false;
break;
}
PRAGMA45(GCC diagnostic pop)
+ if (consume)
+ event.consume();
+
if (dir != 0)
{
STD_VECTOR<RadioButton*>::const_iterator it = mOptions.begin();
diff --git a/src/gui/windows/quitdialog.h b/src/gui/windows/quitdialog.h
index c12296bd1..9016e8154 100644
--- a/src/gui/windows/quitdialog.h
+++ b/src/gui/windows/quitdialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp
index 40a0e472c..9f52c6de9 100644
--- a/src/gui/windows/registerdialog.cpp
+++ b/src/gui/windows/registerdialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -157,6 +157,12 @@ RegisterDialog::~RegisterDialog()
delete2(mWrongDataNoticeListener)
}
+void RegisterDialog::logic()
+{
+ mRegisterButton->setEnabled(canSubmit());
+ Window::logic();
+}
+
void RegisterDialog::action(const ActionEvent &event)
{
const std::string &eventId = event.getId();
@@ -289,11 +295,6 @@ void RegisterDialog::action(const ActionEvent &event)
void RegisterDialog::keyPressed(KeyEvent &event)
{
- if (event.isConsumed())
- {
- mRegisterButton->setEnabled(canSubmit());
- return;
- }
const InputActionT actionId = event.getActionId();
if (actionId == InputAction::GUI_CANCEL)
{
@@ -304,10 +305,6 @@ void RegisterDialog::keyPressed(KeyEvent &event)
{
action(ActionEvent(nullptr, mRegisterButton->getActionEventId()));
}
- else
- {
- mRegisterButton->setEnabled(canSubmit());
- }
}
bool RegisterDialog::canSubmit() const
diff --git a/src/gui/windows/registerdialog.h b/src/gui/windows/registerdialog.h
index 6249253f8..5f652778f 100644
--- a/src/gui/windows/registerdialog.h
+++ b/src/gui/windows/registerdialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -62,6 +62,8 @@ class RegisterDialog final : public Window,
void postInit() override;
+ void logic() override final;
+
/**
* Called when receiving actions from the widgets.
*/
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp
index 2a3ffc546..c28032404 100644
--- a/src/gui/windows/serverdialog.cpp
+++ b/src/gui/windows/serverdialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -49,12 +49,13 @@
#include "utils/delete2.h"
#include "utils/foreach.h"
#include "utils/langs.h"
+#include "utils/performance.h"
#include "debug.h"
-#ifdef WIN32
+#ifdef _WIN32
#undef ERROR
-#endif // WIN32
+#endif // _WIN32
static const int MAX_SERVERLIST = 15;
diff --git a/src/gui/windows/serverdialog.h b/src/gui/windows/serverdialog.h
index 51e9abacd..f4720dde8 100644
--- a/src/gui/windows/serverdialog.h
+++ b/src/gui/windows/serverdialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/serverinfowindow.cpp b/src/gui/windows/serverinfowindow.cpp
index 8697329c8..89900dbe3 100644
--- a/src/gui/windows/serverinfowindow.cpp
+++ b/src/gui/windows/serverinfowindow.cpp
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2017-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/serverinfowindow.h b/src/gui/windows/serverinfowindow.h
index dda3f65a7..963f9106a 100644
--- a/src/gui/windows/serverinfowindow.h
+++ b/src/gui/windows/serverinfowindow.h
@@ -1,9 +1,9 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2017-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp
index aa96feaf6..c6bb7c91a 100644
--- a/src/gui/windows/setupwindow.cpp
+++ b/src/gui/windows/setupwindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/setupwindow.h b/src/gui/windows/setupwindow.h
index 192df546e..623b742c0 100644
--- a/src/gui/windows/setupwindow.h
+++ b/src/gui/windows/setupwindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/shopselldialog.cpp b/src/gui/windows/shopselldialog.cpp
index 3ef5b7d3f..f7589473f 100644
--- a/src/gui/windows/shopselldialog.cpp
+++ b/src/gui/windows/shopselldialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/shopselldialog.h b/src/gui/windows/shopselldialog.h
index ebe340337..e89ceb2e8 100644
--- a/src/gui/windows/shopselldialog.h
+++ b/src/gui/windows/shopselldialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp
index 3517931d2..cc48d4806 100644
--- a/src/gui/windows/shopwindow.cpp
+++ b/src/gui/windows/shopwindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -82,6 +82,7 @@
#include "utils/delete2.h"
#include "utils/foreach.h"
#include "utils/gettext.h"
+#include "utils/performance.h"
#ifdef TMWA_SUPPORT
#include "resources/iteminfo.h"
diff --git a/src/gui/windows/shopwindow.h b/src/gui/windows/shopwindow.h
index 13bf581cf..ac508fe63 100644
--- a/src/gui/windows/shopwindow.h
+++ b/src/gui/windows/shopwindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/shortcutwindow.cpp b/src/gui/windows/shortcutwindow.cpp
index d701cd927..93afda6ad 100644
--- a/src/gui/windows/shortcutwindow.cpp
+++ b/src/gui/windows/shortcutwindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2007-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -38,6 +38,7 @@
#include "utils/delete2.h"
#include "utils/foreach.h"
+#include "utils/performance.h"
#include "debug.h"
diff --git a/src/gui/windows/shortcutwindow.h b/src/gui/windows/shortcutwindow.h
index 63ceb3a3e..a87433a38 100644
--- a/src/gui/windows/shortcutwindow.h
+++ b/src/gui/windows/shortcutwindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2007-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index 1c0994d5c..44832484e 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/skilldialog.h b/src/gui/windows/skilldialog.h
index d82004b82..3eb5dc9d0 100644
--- a/src/gui/windows/skilldialog.h
+++ b/src/gui/windows/skilldialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp
index c8c96d4cf..0c9f16f5c 100644
--- a/src/gui/windows/socialwindow.cpp
+++ b/src/gui/windows/socialwindow.cpp
@@ -1,10 +1,10 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,6 +44,8 @@
#include "net/tmwa/guildmanager.h"
#endif // TMWA_SUPPORT
+#include "utils/performance.h"
+
#include "debug.h"
SocialWindow *socialWindow = nullptr;
@@ -55,6 +57,7 @@ SocialWindow::SocialWindow() :
PlayerRelationsListener(),
mGuildInvited(0),
mGuildAcceptDialog(nullptr),
+ mGuildLeaveDialog(nullptr),
mGuildCreateDialog(nullptr),
mPartyInviter(),
mGuilds(),
@@ -159,6 +162,13 @@ SocialWindow::~SocialWindow()
mGuildInvited = 0;
}
+ if (mGuildLeaveDialog != nullptr)
+ {
+ mGuildLeaveDialog->close();
+ mGuildLeaveDialog->scheduleDelete();
+ mGuildLeaveDialog = nullptr;
+ }
+
if (mPartyAcceptDialog != nullptr)
{
mPartyAcceptDialog->close();
@@ -351,6 +361,19 @@ void SocialWindow::action(const ActionEvent &event)
mGuildInvited = 0;
mGuildAcceptDialog = nullptr;
}
+ else if (event.getSource() == mGuildLeaveDialog)
+ {
+ if (eventId == "yes")
+ {
+ if ((guildHandler != nullptr) && (localPlayer != nullptr))
+ {
+ const Guild *const guild = localPlayer->getGuild();
+ if (guild != nullptr)
+ guildHandler->leave(guild->getId());
+ }
+ }
+ mGuildLeaveDialog = nullptr;
+ }
else if (eventId == "party")
{
popupMenu->showPartyPopup();
@@ -425,6 +448,19 @@ void SocialWindow::showGuildInvite(const std::string &restrict guildName,
mGuildInvited = guildId;
}
+void SocialWindow::confirmGuildLeave()
+{
+ CREATEWIDGETV(mGuildLeaveDialog, ConfirmDialog,
+ // TRANSLATORS: guild invite message
+ _("Really leave your guild?"),
+ "",
+ SOUND_REQUEST,
+ false,
+ Modal_false,
+ this);
+ mGuildLeaveDialog->addActionListener(this);
+}
+
void SocialWindow::showPartyInvite(const std::string &restrict partyName,
const std::string &restrict inviter,
const int partyId)
diff --git a/src/gui/windows/socialwindow.h b/src/gui/windows/socialwindow.h
index 63310d00d..1f391b06a 100644
--- a/src/gui/windows/socialwindow.h
+++ b/src/gui/windows/socialwindow.h
@@ -1,10 +1,10 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -70,6 +70,8 @@ class SocialWindow final : public Window,
const int guildId,
const std::string &restrict inviterName);
+ void confirmGuildLeave();
+
void showPartyInvite(const std::string &restrict partyName,
const std::string &restrict inviter,
const int partyId);
@@ -144,6 +146,7 @@ class SocialWindow final : public Window,
int mGuildInvited;
ConfirmDialog *mGuildAcceptDialog;
+ ConfirmDialog *mGuildLeaveDialog;
TextDialog *mGuildCreateDialog;
std::string mPartyInviter;
GuildMap mGuilds;
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index 6066ae592..653ad2e34 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -239,7 +239,8 @@ StatusWindow::~StatusWindow()
void StatusWindow::addTabs()
{
// TRANSLATORS: status window tab name
- addTabBasic(_("Basic"));
+ mTabs->addTab(_("Basic"), mBasicStatsPage);
+
const STD_VECTOR<std::string> &pages = StatDb::getPages();
FOR_EACH(STD_VECTOR<std::string>::const_iterator, it, pages)
{
@@ -251,17 +252,10 @@ void StatusWindow::addTabs()
void StatusWindow::addTab(const std::string &name)
{
StatsPage *const page = new StatsPage(this, name);
- mTabs->addTab(name,
- page);
+ mTabs->addTab(name, page);
mPages.push_back(page);
}
-void StatusWindow::addTabBasic(const std::string &name)
-{
- mTabs->addTab(name,
- mBasicStatsPage);
-}
-
void StatusWindow::updateLevelLabel()
{
if (localPlayer == nullptr)
@@ -525,8 +519,8 @@ void StatusWindow::updateWeightBar(ProgressBar *const bar)
}
else
{
- const int totalWeight = PlayerInfo::getAttribute(
- Attributes::TOTAL_WEIGHT);
+ const int totalWeight
+ = PlayerInfo::getAttribute(Attributes::TOTAL_WEIGHT);
const int maxWeight = PlayerInfo::getAttribute(Attributes::MAX_WEIGHT);
float progress = 1.0F;
if (maxWeight != 0)
diff --git a/src/gui/windows/statuswindow.h b/src/gui/windows/statuswindow.h
index 04e04dfb2..2aff1f08a 100644
--- a/src/gui/windows/statuswindow.h
+++ b/src/gui/windows/statuswindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -91,7 +91,6 @@ class StatusWindow final : public Window,
private:
void addTabs();
void addTab(const std::string &name);
- void addTabBasic(const std::string &name);
static std::string translateLetter(const char *const letters);
static std::string translateLetter2(const std::string &letters);
diff --git a/src/gui/windows/textcommandeditor.cpp b/src/gui/windows/textcommandeditor.cpp
index f5391fc9d..d0f5ed444 100644
--- a/src/gui/windows/textcommandeditor.cpp
+++ b/src/gui/windows/textcommandeditor.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2009 The Mana World Development Team
* Copyright (C) 2009-2010 Andrei Karas
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/textcommandeditor.h b/src/gui/windows/textcommandeditor.h
index ca6c3dc78..341e0a848 100644
--- a/src/gui/windows/textcommandeditor.h
+++ b/src/gui/windows/textcommandeditor.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2009 The Mana World Development Team
* Copyright (C) 2009-2010 Andrei Karas
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/textdialog.cpp b/src/gui/windows/textdialog.cpp
index 0a75a0f5e..f3e72656f 100644
--- a/src/gui/windows/textdialog.cpp
+++ b/src/gui/windows/textdialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/textdialog.h b/src/gui/windows/textdialog.h
index 44be2b687..79fa2f5f6 100644
--- a/src/gui/windows/textdialog.h
+++ b/src/gui/windows/textdialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/textselectdialog.cpp b/src/gui/windows/textselectdialog.cpp
index 2d2ed8e90..f32f38848 100644
--- a/src/gui/windows/textselectdialog.cpp
+++ b/src/gui/windows/textselectdialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/textselectdialog.h b/src/gui/windows/textselectdialog.h
index 07c4fe5ba..81fa7ce27 100644
--- a/src/gui/windows/textselectdialog.h
+++ b/src/gui/windows/textselectdialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp
index d9ad7b66c..30b5ae231 100644
--- a/src/gui/windows/tradewindow.cpp
+++ b/src/gui/windows/tradewindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/tradewindow.h b/src/gui/windows/tradewindow.h
index 24194f362..2a6fdc497 100644
--- a/src/gui/windows/tradewindow.h
+++ b/src/gui/windows/tradewindow.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index 948ce5a17..f15263d09 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -53,6 +53,7 @@
#include "utils/delete2.h"
#include "utils/foreach.h"
#include "utils/gettext.h"
+#include "utils/performance.h"
#include <sys/stat.h>
@@ -430,11 +431,11 @@ void UpdaterWindow::loadNews()
mScrollArea->setVerticalScrollAmount(0);
}
-void UpdaterWindow::loadPatch()
+void UpdaterWindow::checkClientVersion()
{
if (mMemoryBuffer == nullptr)
{
- logger->log1("Couldn't load patch");
+ logger->log1("Couldn't check client version: null buffer");
return;
}
@@ -443,13 +444,17 @@ void UpdaterWindow::loadPatch()
realloc(mMemoryBuffer, mDownloadedBytes + 1));
if (mMemoryBuffer == nullptr)
{
- logger->log1("Couldn't load patch");
+ logger->log1("Couldn't check client version: null buffer");
return;
}
mMemoryBuffer[mDownloadedBytes] = '\0';
std::string version;
+ // The version check file (latest.txt) is composed of two lines:
+ // first, the "machine readable" version (for alphanumeric comparison)
+ // and second, the human readable version, to be displayed.
+
// Tokenize and add each line separately
char *line = strtok(mMemoryBuffer, "\n");
if (line != nullptr)
@@ -460,6 +465,8 @@ void UpdaterWindow::loadPatch()
line = strtok(nullptr, "\n");
if (line != nullptr)
{
+ // if you wonder why this line is above the one below, it's
+ // because add to top is true.
mBrowserBox->addRow(strprintf("##9 Latest client version: "
"##6ManaVerse %s##0", line), true);
}
@@ -470,7 +477,7 @@ void UpdaterWindow::loadPatch()
#if defined(ANDROID)
const std::string url = "androidDownloadUrl";
const std::string text = "androidDownloadUrl";
-#elif defined(WIN32)
+#elif defined(_WIN32)
const std::string url = "windowsDownloadUrl";
const std::string text = "windowsDownloadUrl";
#else // defined(ANDROID)
@@ -588,15 +595,16 @@ void UpdaterWindow::download()
if (mDownloadStatus == UpdateDownloadStatus::UPDATE_PATCH)
{
mDownload = new Net::Download(this,
- branding.getStringValue("updateMirror1") + mCurrentFile,
+ urlJoin(branding.getStringValue("updateMirror1"), mCurrentFile),
&updateProgress,
true, false, mValidateXml);
+
for (int f = 2; f < 8; f ++)
{
const std::string url = branding.getStringValue(
"updateMirror" + toString(f));
if (!url.empty())
- mDownload->addMirror(url + mCurrentFile);
+ mDownload->addMirror(urlJoin(url, mCurrentFile));
}
}
else
@@ -610,17 +618,16 @@ void UpdaterWindow::download()
mDownloadStatus == UpdateDownloadStatus::UPDATE_RESOURCES2)
{
const std::string str = urlJoin(mUpdateServerPath, mCurrentFile);
- mDownload->addMirror(updateServer3 + str);
- mDownload->addMirror(updateServer4 + str);
- mDownload->addMirror(updateServer5 + str);
+ mDownload->addMirror(urlJoin(updateServer3, str));
+ mDownload->addMirror(urlJoin(updateServer4, str));
+ mDownload->addMirror(urlJoin(updateServer5, str));
}
else
{
const STD_VECTOR<std::string> &mirrors = settings.updateMirrors;
FOR_EACH (STD_VECTOR<std::string>::const_iterator, it, mirrors)
{
- mDownload->addMirror(pathJoin(*it,
- mCurrentFile));
+ mDownload->addMirror(urlJoin(*it, mCurrentFile));
}
}
}
@@ -825,10 +832,9 @@ void UpdaterWindow::logic()
case UpdateDownloadStatus::UPDATE_PATCH:
if (mDownloadComplete)
{
- // Parse current memory buffer as news and dispose of the data
- loadPatch();
+ checkClientVersion();
- mUpdateHost = updateServer2 + mUpdateServerPath;
+ mUpdateHost = urlJoin(updateServer2, mUpdateServerPath);
mUpdatesDir = pathJoin(mUpdatesDir, "fix");
mCurrentFile = xmlUpdateFile;
mValidateXml = true;
diff --git a/src/gui/windows/updaterwindow.h b/src/gui/windows/updaterwindow.h
index daa80f978..7c5cc114c 100644
--- a/src/gui/windows/updaterwindow.h
+++ b/src/gui/windows/updaterwindow.h
@@ -1,10 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
- * Copyright (C) 2011-2019 The ManaPlus Developers
+ * Copyright (C) 2011-2020 The ManaPlus Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -105,7 +106,7 @@ class UpdaterWindow final : public Window,
*/
void loadNews();
- void loadPatch();
+ void checkClientVersion();
void action(const ActionEvent &event) override final;
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index a65f22e8d..8417e5dc8 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2009 The Mana World Development Team
* Copyright (C) 2009-2010 Andrei Karas
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -62,6 +62,7 @@
#include "utils/foreach.h"
#include "utils/gettext.h"
+#include "utils/performance.h"
#include "utils/sdlhelper.h"
#ifdef TMWA_SUPPORT
diff --git a/src/gui/windows/whoisonline.h b/src/gui/windows/whoisonline.h
index 5233ab3ca..33b0a58fc 100644
--- a/src/gui/windows/whoisonline.h
+++ b/src/gui/windows/whoisonline.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2009 The Mana World Development Team
* Copyright (C) 2009-2010 Andrei Karas
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/worldselectdialog.cpp b/src/gui/windows/worldselectdialog.cpp
index d7e65e9e8..1e34da7b8 100644
--- a/src/gui/windows/worldselectdialog.cpp
+++ b/src/gui/windows/worldselectdialog.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/gui/windows/worldselectdialog.h b/src/gui/windows/worldselectdialog.h
index 9d247292d..e2c3e980d 100644
--- a/src/gui/windows/worldselectdialog.h
+++ b/src/gui/windows/worldselectdialog.h
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by