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.cpp36
-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.cpp8
-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.cpp6
-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.cpp57
-rw-r--r--src/gui/windows/inventorywindow.h12
-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.cpp68
-rw-r--r--src/gui/windows/maileditwindow.h6
-rw-r--r--src/gui/windows/mailviewwindow.cpp23
-rw-r--r--src/gui/windows/mailviewwindow.h14
-rw-r--r--src/gui/windows/mailwindow.cpp67
-rw-r--r--src/gui/windows/mailwindow.h6
-rw-r--r--src/gui/windows/minimap.cpp11
-rw-r--r--src/gui/windows/minimap.h6
-rw-r--r--src/gui/windows/ministatuswindow.cpp7
-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.cpp7
-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.cpp6
-rw-r--r--src/gui/windows/quitdialog.h6
-rw-r--r--src/gui/windows/registerdialog.cpp6
-rw-r--r--src/gui/windows/registerdialog.h6
-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.cpp8
-rw-r--r--src/gui/windows/socialwindow.h6
-rw-r--r--src/gui/windows/statuswindow.cpp6
-rw-r--r--src/gui/windows/statuswindow.h6
-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.cpp37
-rw-r--r--src/gui/windows/updaterwindow.h8
-rw-r--r--src/gui/windows/whoisonline.cpp34
-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, 578 insertions, 471 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 f30fb92e4..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
@@ -226,6 +226,7 @@ BuyDialog::BuyDialog() :
mMoney(0),
mAmountItems(0),
mMaxItems(0),
+ mTotalPurchaseWeight(0),
mAdvanced(false)
{
init();
@@ -248,6 +249,7 @@ BuyDialog::BuyDialog(const BeingId npcId,
mMoney(0),
mAmountItems(0),
mMaxItems(0),
+ mTotalPurchaseWeight(0),
mAdvanced(Net::getNetworkType() != ServerType::TMWATHENA)
{
init();
@@ -272,6 +274,7 @@ BuyDialog::BuyDialog(const std::string &nick,
mMoney(0),
mAmountItems(0),
mMaxItems(0),
+ mTotalPurchaseWeight(0),
mAdvanced(false)
{
init();
@@ -296,6 +299,7 @@ BuyDialog::BuyDialog(const Being *const being,
mMoney(0),
mAmountItems(0),
mMaxItems(0),
+ mTotalPurchaseWeight(0),
mAdvanced(true)
{
init();
@@ -338,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");
@@ -473,6 +477,7 @@ void BuyDialog::reset()
mShopItemList->setSelected(-1);
mSlider->setValue(0);
+ mTotalPurchaseWeight = 0;
setMoney(0);
}
@@ -637,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);
@@ -650,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);
@@ -745,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)
{
@@ -765,10 +778,7 @@ void BuyDialog::updateButtonsAndLabels()
const int itemWeight = item->getInfo().getWeight();
if (itemWeight != 0)
{
- const int myFreeWeight
- = PlayerInfo::getAttribute(Attributes::MAX_WEIGHT)
- - PlayerInfo::getAttribute(Attributes::TOTAL_WEIGHT);
- const int canCarry = myFreeWeight / itemWeight;
+ const int canCarry = freeWeight / itemWeight;
mMaxItems = std::min(mMaxItems, canCarry);
}
@@ -786,6 +796,7 @@ void BuyDialog::updateButtonsAndLabels()
if (mAmountItems > mMaxItems)
mAmountItems = mMaxItems;
+ freeWeight -= mAmountItems * itemWeight;
price = mAmountItems * itemPrice;
}
}
@@ -802,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 15363883f..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"
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 80dfe60ea..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
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..5681e8e04 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
@@ -1137,38 +1137,53 @@ void InventoryWindow::attributeChanged(const AttributesT id,
}
}
-void InventoryWindow::combineItems(const int index1,
- const int index2)
+void InventoryWindow::combineItems(const int srcIndex,
+ const int dstIndex)
{
if (mInventory == nullptr)
return;
- const Item *item1 = mInventory->getItem(index1);
- if (item1 == nullptr)
+ const Item *srcItem = mInventory->getItem(srcIndex);
+ if (srcItem == nullptr)
return;
- const Item *item2 = mInventory->getItem(index2);
- if (item2 == nullptr)
+ const Item *dstItem = mInventory->getItem(dstIndex);
+ if (dstItem == nullptr)
return;
- if (item1->getType() != ItemType::Card)
- {
- const Item *tmpItem = item1;
- item1 = item2;
- item2 = tmpItem;
- }
+ // Build up a total all-that-could-go-wrong list of messages. (note:
+ // this is a small subset of all the checks that hercules does).
+ // This way insertion will continue to work even if server removes
+ // some checks (I would prefer if the server sent failure messages
+ // itself, but it fails silently).
+ std::string question
+ = strprintf(
+ // TRANSLATORS: question dialog message
+ _("Insert %s into %s?"),
+ srcItem->getName().c_str(),
+ dstItem->getName().c_str());
+
+ if (srcItem->getType() != ItemType::Card)
+ // TRANSLATORS: failure reason appended to card insert question
+ (question += ' ') += _(" Item to be inserted may not be insertable.");
+
+ if (dstItem->isEquipped() == Equipped_true)
+ // TRANSLATORS: failure reason appended to card insert question
+ (question += ' ') += _(" Destination item is equipped.");
+
+ if (dstItem->isEquipment() == Equipm_false)
+ // TRANSLATORS: failure reason appended to card insert question
+ (question += " ") += _("Inserting into non-equipment items may fail.");
ConfirmDialog *const confirmDlg = CREATEWIDGETR(ConfirmDialog,
// TRANSLATORS: question dialog title
_("Insert card request"),
- // TRANSLATORS: question dialog message
- strprintf(_("Insert %s into %s?"),
- item1->getName().c_str(),
- item2->getName().c_str()),
+ question,
SOUND_REQUEST,
false,
Modal_true,
nullptr);
- insertCardListener.itemIndex = item2->getInvIndex();
- insertCardListener.cardIndex = item1->getInvIndex();
+
+ insertCardListener.itemIndex = dstItem->getInvIndex();
+ insertCardListener.cardIndex = srcItem->getInvIndex();
confirmDlg->addActionListener(&insertCardListener);
}
diff --git a/src/gui/windows/inventorywindow.h b/src/gui/windows/inventorywindow.h
index 4f3fdc15a..0f4c13b46 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
@@ -158,8 +158,10 @@ class InventoryWindow final : public Window,
const int64_t oldVal,
const int64_t newVal) override final;
- void combineItems(const int index1,
- const int index2);
+ /*
+ * Attempt inserting one item (card) into another
+ */
+ void combineItems(const int srcIndex, const int dstIndex);
void moveItemToCraft(const int craftSlot);
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..bc2574c64 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
@@ -25,6 +25,8 @@
#include "being/playerinfo.h"
+#include "enums/gui/layouttype.h"
+
#include "gui/windows/inventorywindow.h"
#include "gui/windows/itemamountwindow.h"
@@ -33,6 +35,7 @@
#include "gui/widgets/inttextfield.h"
#include "gui/widgets/itemcontainer.h"
#include "gui/widgets/label.h"
+#include "gui/widgets/layout.h"
#include "gui/widgets/scrollarea.h"
#include "resources/item/item.h"
@@ -67,7 +70,7 @@ MailEditWindow::MailEditWindow() :
// TRANSLATORS: mail edit window label
mMoneyLabel(new Label(this, _("Money:"))),
// TRANSLATORS: mail edit window label
- mItemLabel(new Label(this, _("Item:"))),
+ mItemLabel(new Label(this, _("Items:"))),
// TRANSLATORS: mail edit window label
mMessageLabel(new Label(this, _("Message:"))),
mToField(new TextField(this, std::string(), LoseFocusOnTab_true,
@@ -95,35 +98,46 @@ MailEditWindow::MailEditWindow() :
setStickyButtonLock(true);
setVisible(Visible_true);
- setDefaultSize(380, 200, ImagePosition::CENTER, 0, 0);
- setMinWidth(200);
- setMinHeight(200);
- center();
-
- ContainerPlacer placer(nullptr, nullptr);
- placer = getPlacer(0, 0);
-
mToField->setWidth(100);
mSubjectField->setWidth(100);
mMessageField->setWidth(100);
- mItemScrollArea->setHeight(100);
+ // 1x3 items (current ML limit) times some padding
+ // + a handful of pixels to cover scrollbar/padding
+ mItemScrollArea->setHeight(43); // same as itemcontainer default
+ mItemScrollArea->setWidth(3 * (32 + 2) + 5 + 10);
mItemScrollArea->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER);
mToField->addFocusListener(this);
- placer(0, 0, mToLabel, 1, 1);
- placer(1, 0, mToField, 3, 1);
- placer(0, 1, mSubjectLabel, 1, 1);
- placer(1, 1, mSubjectField, 3, 1);
- placer(0, 2, mMoneyLabel, 1, 1);
- placer(1, 2, mMoneyField, 3, 1);
- placer(0, 3, mItemLabel, 1, 1);
- placer(1, 3, mItemScrollArea, 2, 2);
- placer(3, 4, mAddButton, 1, 1);
-
- placer(0, 5, mMessageLabel, 1, 1);
- placer(1, 5, mMessageField, 3, 1);
- placer(0, 6, mSendButton, 1, 1);
- placer(3, 6, mCloseButton, 1, 1);
+ place(0, 0, mToLabel);
+ place(1, 0, mToField, 2, 1);
+ place(0, 1, mSubjectLabel);
+ place(1, 1, mSubjectField, 2, 1);
+ place(0, 2, mMoneyLabel);
+ place(1, 2, mMoneyField, 2, 1);
+ place(0, 3, mItemLabel);
+ place(1, 3, mItemScrollArea, 1, 2);
+ place(2, 4, mAddButton);
+
+ place(0, 5, mMessageLabel);
+ place(1, 5, mMessageField, 2, 1);
+ place(0, 6, mSendButton);
+ place(2, 6, mCloseButton);
+
+ Layout &layout = getLayout();
+ // mid column shall eat all remaining available window space.
+ layout.setColWidth(1, 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);
+ center();
loadWindowState();
if (mUseMail2)
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 df2fe1eec..bddd03f74 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
@@ -50,7 +50,7 @@ MailViewWindow *mailViewWindow = nullptr;
MailViewWindow::MailViewWindow(MailMessage *const message,
const int itemsCount) :
// TRANSLATORS: mail view window name
- Window(_("View mail"), Modal_false, nullptr, "mailview.xml"),
+ Window(_("View Mail"), Modal_false, nullptr, "mailview.xml"),
ActionListener(),
mMessage(message),
mGetAttachButton(new Button(this,
@@ -153,6 +153,8 @@ MailViewWindow::~MailViewWindow()
{
if (mUseMail2)
{
+ if (mDeleted)
+ delete mMessage;
mMessage = nullptr;
}
else
@@ -282,3 +284,16 @@ void MailViewWindow::removeMoney(const int64_t mailId)
if (mailWindow != nullptr)
mailWindow->refreshMailNames();
}
+
+bool MailViewWindow::notifyDeleteAndTransferOwnership(const int64_t mailId)
+{
+ if (mailId != mMessage->id)
+ return false;
+ setCaption("View Mail (DELETED)");
+ mDeleted = true;
+ // this mail's ID no longer exists, so it no longer has a defined
+ // predecessor or successor.
+ mPrevButton->setEnabled(false);
+ mNextButton->setEnabled(false);
+ return true;
+}
diff --git a/src/gui/windows/mailviewwindow.h b/src/gui/windows/mailviewwindow.h
index 6a5da1157..edb939b33 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
@@ -55,6 +55,13 @@ class MailViewWindow final : public Window,
void removeMoney(const int64_t mailId);
+ /**
+ * notify view window that mail has been deleted.
+ * MailViewWindow will delete the message when it is destroyed.
+ * returns true if mailId is the one being viewed (and thus ownership
+ * was transfered).
+ */
+ bool notifyDeleteAndTransferOwnership(const int64_t mailId);
private:
void updateAttachButton();
@@ -75,6 +82,7 @@ class MailViewWindow final : public Window,
ItemContainer *mItemContainer;
ScrollArea *mItemScrollArea;
bool mUseMail2;
+ bool mDeleted = false;
};
extern MailViewWindow *mailViewWindow;
diff --git a/src/gui/windows/mailwindow.cpp b/src/gui/windows/mailwindow.cpp
index 5b91b099b..cd3c8c6cf 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,38 @@ 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);
+ center();
loadWindowState();
enableVisibleSound(true);
@@ -244,7 +257,14 @@ void MailWindow::removeMail(const int64_t id)
if ((message != nullptr) && message->id == id)
{
mMessages.erase(it);
- delete message;
+ // passes ownership of message pointer to mailViewWindow,
+ // which will signal to reader that the mail is deleted and
+ // will do the final delete of the message upon destruction.
+ if (mailViewWindow == nullptr ||
+ !mailViewWindow->notifyDeleteAndTransferOwnership(id))
+ {
+ delete message;
+ }
break;
}
}
@@ -255,6 +275,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 ae1c0038e..9c5636bea 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"
@@ -87,9 +88,7 @@ Minimap::Minimap() :
setDefaultVisible(true);
setSaveVisible(true);
-
- setStickyButton(true);
- setSticky(false);
+ setStickyButtonLock(true);
loadWindowState();
setVisible(fromBool(mShow, Visible), isSticky());
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 e62fd38dc..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"
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 390f31525..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"
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 7ef2bc6e8..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
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 588ca0074..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
diff --git a/src/gui/windows/registerdialog.h b/src/gui/windows/registerdialog.h
index 139739780..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
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 14596dc16..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;
diff --git a/src/gui/windows/socialwindow.h b/src/gui/windows/socialwindow.h
index 4014506c2..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
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index 95f76449f..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
diff --git a/src/gui/windows/statuswindow.h b/src/gui/windows/statuswindow.h
index d11762c80..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
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 2ed01f4f3..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,9 +618,9 @@ 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
{
@@ -824,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 8ba66e08f..7c5cc114c 100644
--- a/src/gui/windows/updaterwindow.h
+++ b/src/gui/windows/updaterwindow.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
@@ -106,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..2cb1c1e16 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
@@ -250,33 +251,22 @@ void WhoIsOnline::updateWindow(size_t numOnline)
std::sort(mFriends.begin(), mFriends.end(), nameCompare);
std::sort(mNeutral.begin(), mNeutral.end(), nameCompare);
std::sort(mDisregard.begin(), mDisregard.end(), nameCompare);
- bool addedFromSection(false);
FOR_EACH (STD_VECTOR<OnlinePlayer*>::const_iterator, it, mFriends)
- {
mBrowserBox->addRow((*it)->getText(), false);
- addedFromSection = true;
- }
- if (addedFromSection == true)
- {
+
+ if (!mFriends.empty())
mBrowserBox->addRow("---", false);
- addedFromSection = false;
- }
+
FOR_EACH (STD_VECTOR<OnlinePlayer*>::const_iterator, it, mEnemy)
- {
mBrowserBox->addRow((*it)->getText(), false);
- addedFromSection = true;
- }
- if (addedFromSection == true)
- {
+
+ if (!mEnemy.empty())
mBrowserBox->addRow("---", false);
- addedFromSection = false;
- }
+
FOR_EACH (STD_VECTOR<OnlinePlayer*>::const_iterator, it, mNeutral)
- {
mBrowserBox->addRow((*it)->getText(), false);
- addedFromSection = true;
- }
- if (addedFromSection == true && !mDisregard.empty())
+
+ if (!mNeutral.empty() && !mDisregard.empty())
mBrowserBox->addRow("---", false);
FOR_EACH (STD_VECTOR<OnlinePlayer*>::const_iterator, it, mDisregard)
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