--- a/QTfrontend/gameuiconfig.cpp Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/gameuiconfig.cpp Sun Dec 02 00:02:40 2012 +0100
@@ -94,11 +94,13 @@
Form->ui.pageOptions->editNetPassword->installEventFilter(this);
int passLength = value("net/passwordlength", 0).toInt();
- setNetPasswordLength(passLength);
- if (savePwd == false) {
- Form->ui.pageOptions->editNetPassword->setEnabled(savePwd);
+ if (!savePwd) {
+ Form->ui.pageOptions->editNetPassword->setEnabled(false);
Form->ui.pageOptions->editNetPassword->setText("");
setNetPasswordLength(0);
+ } else
+ {
+ setNetPasswordLength(passLength);
}
delete netHost;
@@ -270,7 +272,7 @@
setValue(QString("colors/color%1").arg(i), model->item(i)->data());
}
- Form->gameSettings->sync();
+ sync();
}
void GameUIConfig::SaveVideosOptions()
@@ -286,7 +288,13 @@
setValue("videorec/usegameres", Form->ui.pageVideos->checkUseGameRes->isChecked());
setValue("videorec/audio", recordAudio());
- Form->gameSettings->sync();
+ sync();
+}
+
+void GameUIConfig::setValue(const QString &key, const QVariant &value)
+{
+ qDebug() << "[settings]" << key << value;
+ QSettings::setValue(key, value);
}
QString GameUIConfig::language()
@@ -447,7 +455,7 @@
bool GameUIConfig::netPasswordIsValid()
{
- return (netPasswordLength() == 0 || Form->ui.pageOptions->editNetPassword->text() != QString(netPasswordLength(), '\0'));
+ return (netPasswordLength() == 0 || Form->ui.pageOptions->editNetPassword->text() != QString(netPasswordLength(), '*'));
}
// When hedgewars launches, the password field is set with null characters. If the user tries to edit the field and there are such characters, then clear the field
@@ -472,7 +480,7 @@
{
if (passwordLength > 0)
{
- Form->ui.pageOptions->editNetPassword->setText(QString(passwordLength, '\0'));
+ Form->ui.pageOptions->editNetPassword->setText(QString(passwordLength, '*'));
}
else
{
--- a/QTfrontend/gameuiconfig.h Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/gameuiconfig.h Sun Dec 02 00:02:40 2012 +0100
@@ -58,6 +58,7 @@
bool isFrontendFullscreen() const;
void resizeToConfigValues();
quint32 stereoMode() const;
+ void setValue(const QString & key, const QVariant & value);
QString AVFormat();
QString videoCodec();
--- a/QTfrontend/hwconsts.h Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/hwconsts.h Sun Dec 02 00:02:40 2012 +0100
@@ -63,40 +63,40 @@
#define HEDGEHOGS_PER_TEAM 8
-#define AMMOLINE_DEFAULT_QT "93919294221991210322351110012010000002111101010111110101"
-#define AMMOLINE_DEFAULT_PROB "04050405416006555465544647765766666661555101011154110101"
-#define AMMOLINE_DEFAULT_DELAY "00000000000002055000000400070040000000002200000006000000"
-#define AMMOLINE_DEFAULT_CRATE "13111103121111111231141111111111111112111111011111110101"
+#define AMMOLINE_DEFAULT_QT "9391929422199121032235111001201000000211110101011111101"
+#define AMMOLINE_DEFAULT_PROB "0405040541600655546554464776576666666155510101115411101"
+#define AMMOLINE_DEFAULT_DELAY "0000000000000205500000040007004000000000220000000600000"
+#define AMMOLINE_DEFAULT_CRATE "1311110312111111123114111111111111111211111101111111101"
-#define AMMOLINE_CRAZY_QT "99999999999999999929999999999999992999999999099999920909"
-#define AMMOLINE_CRAZY_PROB "11111101111111111111111111111111111111111111011111110101"
-#define AMMOLINE_CRAZY_DELAY "00000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_CRAZY_CRATE "13111103121111111231141111111111111112111101011111110101"
+#define AMMOLINE_CRAZY_QT "9999999999999999992999999999999999299999999909999992909"
+#define AMMOLINE_CRAZY_PROB "1111110111111111111111111111111111111111111101111111101"
+#define AMMOLINE_CRAZY_DELAY "0000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_CRAZY_CRATE "1311110312111111123114111111111111111211110101111111101"
-#define AMMOLINE_PROMODE_QT "90900090000000000000090000000000000000000000000000000000"
-#define AMMOLINE_PROMODE_PROB "00000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_PROMODE_DELAY "00000000000002055000000400070040000000002000000000000002"
-#define AMMOLINE_PROMODE_CRATE "11111111111111111111111111111111111111111001011111110101"
+#define AMMOLINE_PROMODE_QT "9090009000000000000009000000000000000000000000000000000"
+#define AMMOLINE_PROMODE_PROB "0000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_PROMODE_DELAY "0000000000000205500000040007004000000000200000000000002"
+#define AMMOLINE_PROMODE_CRATE "1111111111111111111111111111111111111111100101111111101"
-#define AMMOLINE_SHOPPA_QT "00000099000000000000000000000000000000000000000000000000"
-#define AMMOLINE_SHOPPA_PROB "44444100442444022101121212224220000000020004000100110001"
-#define AMMOLINE_SHOPPA_DELAY "00000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_SHOPPA_CRATE "11111111111111111111111111111111111111111011011111110001"
+#define AMMOLINE_SHOPPA_QT "0000009900000000000000000000000000000000000000000000000"
+#define AMMOLINE_SHOPPA_PROB "4444410044244402210112121222422000000002000400010011001"
+#define AMMOLINE_SHOPPA_DELAY "0000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_SHOPPA_CRATE "1111111111111111111111111111111111111111101101111111001"
-#define AMMOLINE_CLEAN_QT "10100090000100000110000000000000000000000000000010000000"
-#define AMMOLINE_CLEAN_PROB "04050405416006555465544647765766666661555101011154110101"
-#define AMMOLINE_CLEAN_DELAY "00000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_CLEAN_CRATE "13111103121111111231141111111111111112111111011111110101"
+#define AMMOLINE_CLEAN_QT "1010009000010000011000000000000000000000000000001000000"
+#define AMMOLINE_CLEAN_PROB "0405040541600655546554464776576666666155510101115411101"
+#define AMMOLINE_CLEAN_DELAY "0000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_CLEAN_CRATE "1311110312111111123114111111111111111211111101111111101"
-#define AMMOLINE_MINES_QT "00000099000900000003000000000000000000000000000000000000"
-#define AMMOLINE_MINES_PROB "00000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_MINES_DELAY "00000000000002055000000400070040000000002000000006000000"
-#define AMMOLINE_MINES_CRATE "11111111111111111111111111111111111111111111011111110101"
+#define AMMOLINE_MINES_QT "0000009900090000000300000000000000000000000000000000000"
+#define AMMOLINE_MINES_PROB "0000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_MINES_DELAY "0000000000000205500000040007004000000000200000000600000"
+#define AMMOLINE_MINES_CRATE "1111111111111111111111111111111111111111111101111111101"
-#define AMMOLINE_PORTALS_QT "90000090020000000021000000000000001100000900000000000000"
-#define AMMOLINE_PORTALS_PROB "04050405416006555465544647765766666661555101011154110101"
-#define AMMOLINE_PORTALS_DELAY "00000000000002055000000400070040000000002000000006000000"
-#define AMMOLINE_PORTALS_CRATE "13111103121111111231141111111111111112111111011111110101"
+#define AMMOLINE_PORTALS_QT "9000009002000000002100000000000000110000090000000000000"
+#define AMMOLINE_PORTALS_PROB "0405040541600655546554464776576666666155510101115411101"
+#define AMMOLINE_PORTALS_DELAY "0000000000000205500000040007004000000000200000000600000"
+#define AMMOLINE_PORTALS_CRATE "1311110312111111123114111111111111111211111101111111101"
//Different seasons; assigned to season (int)
#define SEASON_NONE 0
--- a/QTfrontend/hwform.cpp Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/hwform.cpp Sun Dec 02 00:02:40 2012 +0100
@@ -111,7 +111,6 @@
QString playerHash;
GameUIConfig* HWForm::config = NULL;
-QSettings* HWForm::gameSettings = NULL;
HWForm::HWForm(QWidget *parent, QString styleSheet)
: QMainWindow(parent)
@@ -127,10 +126,6 @@
#ifdef USE_XFIRE
xfire_init();
#endif
- gameSettings = new QSettings("physfs://hedgewars.ini", QSettings::IniFormat);
- frontendEffects = gameSettings->value("frontend/effects", true).toBool();
- playerHash = QString(QCryptographicHash::hash(gameSettings->value("net/nick","").toString().toUtf8(), QCryptographicHash::Md5).toHex());
-
this->setStyleSheet(styleSheet);
ui.setupUi(this);
setMinimumSize(760, 580);
@@ -140,7 +135,12 @@
ui.pageOptions->CBResolution->addItems(SDLInteraction::instance().getResolutions());
config = new GameUIConfig(this, "physfs://hedgewars.ini");
+ frontendEffects = config->value("frontend/effects", true).toBool();
+ playerHash = QString(QCryptographicHash::hash(config->value("net/nick","").toString().toUtf8(), QCryptographicHash::Md5).toHex());
+ ui.pageRoomsList->setSettings(config);
+ ui.pageNetGame->chatWidget->setSettings(config);
+ ui.pageRoomsList->chatWidget->setSettings(config);
ui.pageVideos->init(config);
#ifdef __APPLE__
@@ -445,7 +445,7 @@
if(teamslist.empty())
{
- QString currentNickName = gameSettings->value("net/nick","").toString().toUtf8();
+ QString currentNickName = config->value("net/nick","").toString().toUtf8();
QString teamName;
if (currentNickName.isEmpty())
@@ -615,16 +615,6 @@
{
ui.pageOptions->setTeamOptionsEnabled(true);
}
-
- if (id == ID_PAGE_SETUP)
- {
- config->reloadValues();
- }
-
- if (id == ID_PAGE_VIDEOS )
- {
- config->reloadVideosValues();
- }
}
void HWForm::GoToPage(int id)
@@ -970,33 +960,31 @@
void HWForm::NetPassword(const QString & nick)
{
int passLength = config->value("net/passwordlength", 0).toInt();
- QString hash = config->value("net/passwordhash", "").toString();
+ QString hash = QString::fromLatin1(config->value("net/passwordhash", "").toByteArray());
// If the password is blank, ask the user to enter one in
if (passLength == 0)
{
- HWPasswordDialog * hpd = new HWPasswordDialog(this, tr("Your nickname %1 is\nregistered on Hedgewars.org\nPlease provide your password below\nor pick another nickname in game config:").arg(nick));
- hpd->cbSave->setChecked(config->value("net/savepassword", true).toBool());
- if (hpd->exec() != QDialog::Accepted)
+ HWPasswordDialog hpd(this, tr("Your nickname %1 is\nregistered on Hedgewars.org\nPlease provide your password below\nor pick another nickname in game config:").arg(nick));
+ hpd.cbSave->setChecked(config->value("net/savepassword", true).toBool());
+ if (hpd.exec() != QDialog::Accepted)
{
ForcedDisconnect(tr("No password supplied."));
- delete hpd;
return;
}
- QString password = hpd->lePassword->text();
+ QString password = hpd.lePassword->text();
hash = QCryptographicHash::hash(password.toUtf8(), QCryptographicHash::Md5).toHex();
- bool save = hpd->cbSave->isChecked();
+ bool save = hpd.cbSave->isChecked();
config->setValue("net/savepassword", save);
if (save) // user wants to save password
{
- config->setValue("net/passwordhash", hash);
+ config->setValue("net/passwordhash", hash.toLatin1());
config->setValue("net/passwordlength", password.size());
config->setNetPasswordLength(password.size());
+ config->sync();
}
-
- delete hpd;
}
hwnet->SendPasswordHash(hash);
@@ -1084,7 +1072,7 @@
//connect(ui.pageNetGame->BtnBack, SIGNAL(clicked()), hwnet, SLOT(partRoom()));
ui.pageRoomsList->chatWidget->setUsersModel(hwnet->lobbyPlayersModel());
- ui.pageNetGame->pChatWidget->setUsersModel(hwnet->roomPlayersModel());
+ ui.pageNetGame->chatWidget->setUsersModel(hwnet->roomPlayersModel());
// rooms list page stuff
ui.pageRoomsList->setModel(hwnet->roomsListModel());
@@ -1113,26 +1101,26 @@
// net page stuff
connect(hwnet, SIGNAL(chatStringFromNet(const QString&)),
- ui.pageNetGame->pChatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection);
+ ui.pageNetGame->chatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection);
connect(hwnet, SIGNAL(chatStringFromMe(const QString&)),
- ui.pageNetGame->pChatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection);
+ ui.pageNetGame->chatWidget, SLOT(onChatString(const QString&)), Qt::QueuedConnection);
connect(hwnet, SIGNAL(roomMaster(bool)),
- ui.pageNetGame->pChatWidget, SLOT(adminAccess(bool)), Qt::QueuedConnection);
- connect(ui.pageNetGame->pChatWidget, SIGNAL(chatLine(const QString&)),
+ ui.pageNetGame->chatWidget, SLOT(adminAccess(bool)), Qt::QueuedConnection);
+ connect(ui.pageNetGame->chatWidget, SIGNAL(chatLine(const QString&)),
hwnet, SLOT(chatLineToNet(const QString&)));
connect(ui.pageNetGame->BtnGo, SIGNAL(clicked()), hwnet, SLOT(ToggleReady()));
connect(hwnet, SIGNAL(setMyReadyStatus(bool)),
ui.pageNetGame, SLOT(setReadyStatus(bool)), Qt::QueuedConnection);
// chat widget actions
- connect(ui.pageNetGame->pChatWidget, SIGNAL(kick(const QString&)),
+ connect(ui.pageNetGame->chatWidget, SIGNAL(kick(const QString&)),
hwnet, SLOT(kickPlayer(const QString&)));
- connect(ui.pageNetGame->pChatWidget, SIGNAL(ban(const QString&)),
+ connect(ui.pageNetGame->chatWidget, SIGNAL(ban(const QString&)),
hwnet, SLOT(banPlayer(const QString&)));
- connect(ui.pageNetGame->pChatWidget, SIGNAL(info(const QString&)),
+ connect(ui.pageNetGame->chatWidget, SIGNAL(info(const QString&)),
hwnet, SLOT(infoPlayer(const QString&)));
- connect(ui.pageNetGame->pChatWidget, SIGNAL(follow(const QString&)),
+ connect(ui.pageNetGame->chatWidget, SIGNAL(follow(const QString&)),
hwnet, SLOT(followPlayer(const QString&)));
connect(ui.pageRoomsList->chatWidget, SIGNAL(kick(const QString&)),
hwnet, SLOT(kickPlayer(const QString&)));
@@ -1155,9 +1143,9 @@
// nick list stuff
connect(hwnet, SIGNAL(nickAdded(const QString&, bool)),
- ui.pageNetGame->pChatWidget, SLOT(nickAdded(const QString&, bool)), Qt::QueuedConnection);
+ ui.pageNetGame->chatWidget, SLOT(nickAdded(const QString&, bool)), Qt::QueuedConnection);
connect(hwnet, SIGNAL(nickRemoved(const QString&)),
- ui.pageNetGame->pChatWidget, SLOT(nickRemoved(const QString&)), Qt::QueuedConnection);
+ ui.pageNetGame->chatWidget, SLOT(nickRemoved(const QString&)), Qt::QueuedConnection);
connect(hwnet, SIGNAL(nickAddedLobby(const QString&, bool)),
ui.pageRoomsList->chatWidget, SLOT(nickAdded(const QString&, bool)), Qt::QueuedConnection);
connect(hwnet, SIGNAL(nickRemovedLobby(const QString&)),
@@ -1303,7 +1291,7 @@
void HWForm::NetGameEnter()
{
- ui.pageNetGame->pChatWidget->clear();
+ ui.pageNetGame->chatWidget->clear();
GoToPage(ID_PAGE_NETGAME);
}
--- a/QTfrontend/hwform.h Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/hwform.h Sun Dec 02 00:02:40 2012 +0100
@@ -61,7 +61,6 @@
HWForm(QWidget *parent = 0, QString styleSheet = "");
Ui_HWForm ui;
static GameUIConfig * config;
- static QSettings * gameSettings; // Same file GameUIConfig points to but without the baggage. Needs sync() calls if you want to get GameUIConfig changes though
void updateXfire();
void PlayDemoQuick(const QString & demofilename);
void exit();
--- a/QTfrontend/ui/dialog/bandialog.cpp Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/ui/dialog/bandialog.cpp Sun Dec 02 00:02:40 2012 +0100
@@ -30,7 +30,7 @@
cbTime->addItem(tr("3 days"), 72 * 60 * 60);
cbTime->addItem(tr("7 days"), 168 * 60 * 60);
cbTime->addItem(tr("14 days"), 336 * 60 * 60);
- cbTime->addItem(tr("permanent"), 3650 * 60 * 60);
+ cbTime->addItem(tr("permanent"), 3650 * 24 * 60 * 60);
cbTime->setCurrentIndex(0);
formLayout->addRow(tr("IP"), rbIP);
--- a/QTfrontend/ui/page/AbstractPage.cpp Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/ui/page/AbstractPage.cpp Sun Dec 02 00:02:40 2012 +0100
@@ -41,8 +41,9 @@
QGridLayout * pageLayout = new QGridLayout(this);
// stretch grid space for body and footer
- pageLayout->setColumnStretch(0,0);
- pageLayout->setColumnStretch(1,1);
+ pageLayout->setColumnStretch(0,1);
+ pageLayout->setColumnStretch(1,2);
+ pageLayout->setColumnStretch(2,1);
pageLayout->setRowStretch(0,1);
pageLayout->setRowStretch(1,0);
--- a/QTfrontend/ui/page/pageadmin.cpp Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/ui/page/pageadmin.cpp Sun Dec 02 00:02:40 2012 +0100
@@ -156,7 +156,7 @@
void PageAdmin::onAddClicked()
{
- BanDialog dialog;
+ BanDialog dialog(this);
if(dialog.exec())
{
--- a/QTfrontend/ui/page/pagemain.cpp Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/ui/page/pagemain.cpp Sun Dec 02 00:02:40 2012 +0100
@@ -115,7 +115,7 @@
}
else
{
- setDefautDescription(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game. Some features might be broken or incomplete. Use at your own risk!"));
+ setDefautDescription(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete!"));
}
}
--- a/QTfrontend/ui/page/pagenetgame.cpp Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/ui/page/pagenetgame.cpp Sun Dec 02 00:02:40 2012 +0100
@@ -37,10 +37,10 @@
pageLayout->setColumnStretch(1, 50);
// chatwidget
- pChatWidget = new HWChatWidget(this, m_gameSettings, true);
- pChatWidget->setShowFollow(false); // don't show follow in nicks' context menus
- pChatWidget->setIgnoreListKick(true); // kick ignored players automatically
- pageLayout->addWidget(pChatWidget, 2, 0, 1, 2);
+ chatWidget = new HWChatWidget(this, true);
+ chatWidget->setShowFollow(false); // don't show follow in nicks' context menus
+ chatWidget->setIgnoreListKick(true); // kick ignored players automatically
+ pageLayout->addWidget(chatWidget, 2, 0, 1, 2);
pageLayout->setRowStretch(1, 100);
pageLayout->setRowStretch(2, 100);
@@ -96,10 +96,8 @@
connect(BtnUpdate, SIGNAL(clicked()), this, SLOT(onUpdateClick()));
}
-PageNetGame::PageNetGame(QWidget* parent, QSettings * gameSettings) : AbstractPage(parent)
+PageNetGame::PageNetGame(QWidget* parent) : AbstractPage(parent)
{
- m_gameSettings = gameSettings;
-
initPage();
QMenu * menu = new QMenu(BtnMaster);
@@ -113,24 +111,23 @@
menu->addAction(restrictTeamAdds);
BtnMaster->setMenu(menu);
-
}
void PageNetGame::displayError(const QString & message)
{
- pChatWidget->displayError(message);
+ chatWidget->displayError(message);
}
void PageNetGame::displayNotice(const QString & message)
{
- pChatWidget->displayNotice(message);
+ chatWidget->displayNotice(message);
}
void PageNetGame::displayWarning(const QString & message)
{
- pChatWidget->displayWarning(message);
+ chatWidget->displayWarning(message);
}
@@ -178,5 +175,5 @@
void PageNetGame::setUser(const QString & nickname)
{
- pChatWidget->setUser(nickname);
+ chatWidget->setUser(nickname);
}
--- a/QTfrontend/ui/page/pagenetgame.h Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/ui/page/pagenetgame.h Sun Dec 02 00:02:40 2012 +0100
@@ -32,7 +32,7 @@
Q_OBJECT
public:
- PageNetGame(QWidget* parent, QSettings * gameSettings);
+ PageNetGame(QWidget* parent);
/**
* Sets the room name to display.
@@ -52,7 +52,7 @@
QAction * restrictJoins;
QAction * restrictTeamAdds;
- HWChatWidget* pChatWidget;
+ HWChatWidget* chatWidget;
TeamSelWidget* pNetTeamsWidget;
GameCFGWidget* pGameCFG;
@@ -72,8 +72,6 @@
QLayout * footerLayoutDefinition();
void connectSignals();
- QSettings * m_gameSettings;
-
HistoryLineEdit * leRoomName;
QPushButton * btnSetup;
};
--- a/QTfrontend/ui/page/pageroomslist.cpp Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/ui/page/pageroomslist.cpp Sun Dec 02 00:02:40 2012 +0100
@@ -95,7 +95,7 @@
pageLayout->addLayout(filterLayout, 4, 0, 1, 2);
- chatWidget = new HWChatWidget(this, m_gameSettings, false);
+ chatWidget = new HWChatWidget(this, false);
pageLayout->addWidget(chatWidget, 5, 0, 1, 3);
pageLayout->setRowStretch(5, 350);
@@ -156,11 +156,9 @@
}
-PageRoomsList::PageRoomsList(QWidget* parent, QSettings * gameSettings) :
+PageRoomsList::PageRoomsList(QWidget* parent) :
AbstractPage(parent)
{
- m_gameSettings = gameSettings;
-
roomsModel = NULL;
stateFilteredModel = NULL;
schemeFilteredModel = NULL;
@@ -612,13 +610,17 @@
QString("*%1*").arg(CBWeapons->currentText()));
}
+void PageRoomsList::setSettings(QSettings *settings)
+{
+ m_gameSettings = settings;
+}
bool PageRoomsList::restoreHeaderState()
{
if (!m_gameSettings->contains("frontend/roomslist_header"))
return false;
return roomsList->horizontalHeader()->restoreState(QByteArray::fromBase64(
- (m_gameSettings->value("frontend/roomslist_header").toString().toAscii())));
+ (m_gameSettings->value("frontend/roomslist_header").toByteArray())));
}
void PageRoomsList::saveHeaderState()
--- a/QTfrontend/ui/page/pageroomslist.h Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/ui/page/pageroomslist.h Sun Dec 02 00:02:40 2012 +0100
@@ -32,10 +32,11 @@
Q_OBJECT
public:
- PageRoomsList(QWidget* parent, QSettings * config);
+ PageRoomsList(QWidget* parent);
void displayError(const QString & message);
void displayNotice(const QString & message);
void displayWarning(const QString & message);
+ void setSettings(QSettings * settings);
QLineEdit * roomName;
QLineEdit * searchText;
--- a/QTfrontend/ui/widget/chatwidget.cpp Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/ui/widget/chatwidget.cpp Sun Dec 02 00:02:40 2012 +0100
@@ -177,7 +177,7 @@
}
-HWChatWidget::HWChatWidget(QWidget* parent, QSettings * gameSettings, bool notify) :
+HWChatWidget::HWChatWidget(QWidget* parent, bool notify) :
QWidget(parent),
mainLayout(this)
{
@@ -187,7 +187,6 @@
m_isAdmin = false;
m_autoKickEnabled = false;
- if(gameSettings->value("frontend/sound", true).toBool())
{
QStringList vpList =
QStringList() << "Classic" << "Default" << "Mobster" << "Russian";
@@ -281,6 +280,10 @@
clear();
}
+void HWChatWidget::setSettings(QSettings * settings)
+{
+ gameSettings = settings;
+}
void HWChatWidget::linkClicked(const QUrl & link)
{
--- a/QTfrontend/ui/widget/chatwidget.h Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/ui/widget/chatwidget.h Sun Dec 02 00:02:40 2012 +0100
@@ -54,7 +54,7 @@
Q_OBJECT
public:
- HWChatWidget(QWidget* parent, QSettings * gameSettings, bool notify);
+ HWChatWidget(QWidget* parent, bool notify);
void setIgnoreListKick(bool enabled); ///< automatically kick people on ignore list (if possible)
void setShowFollow(bool enabled);
static const QString & styleSheet();
@@ -63,6 +63,7 @@
void displayWarning(const QString & message);
void setUser(const QString & nickname);
void setUsersModel(QAbstractItemModel * model);
+ void setSettings(QSettings * settings);
protected:
virtual void dragEnterEvent(QDragEnterEvent * event);
--- a/QTfrontend/ui_hwform.cpp Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/ui_hwform.cpp Sun Dec 02 00:02:40 2012 +0100
@@ -60,7 +60,7 @@
centralWidget = new QWidget(HWForm);
centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
- SetupPages(centralWidget, HWForm);
+ SetupPages(centralWidget);
HWForm->setCentralWidget(centralWidget);
@@ -74,7 +74,7 @@
font14 = new QFont("MS Shell Dlg", 14);
}
-void Ui_HWForm::SetupPages(QWidget *Parent, HWForm *HWForm)
+void Ui_HWForm::SetupPages(QWidget *Parent)
{
Pages = new QStackedLayout(Parent);
@@ -93,7 +93,7 @@
pageNet = new PageNet();
Pages->addWidget(pageNet);
- pageNetGame = new PageNetGame(Parent, HWForm->gameSettings);
+ pageNetGame = new PageNetGame(Parent);
Pages->addWidget(pageNetGame);
pageInfo = new PageInfo();
@@ -120,7 +120,7 @@
pageInGame = new PageInGame();
Pages->addWidget(pageInGame);
- pageRoomsList = new PageRoomsList(Parent, HWForm->gameSettings);
+ pageRoomsList = new PageRoomsList(Parent);
Pages->addWidget(pageRoomsList);
pageConnecting = new PageConnecting();
--- a/QTfrontend/ui_hwform.h Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/ui_hwform.h Sun Dec 02 00:02:40 2012 +0100
@@ -86,7 +86,7 @@
void setupUi(HWForm *HWForm);
void SetupFonts();
- void SetupPages(QWidget *Parent, HWForm *HWForm);
+ void SetupPages(QWidget *Parent);
};
#endif // UI_HWFORM_H
--- a/QTfrontend/util/FileEngine.cpp Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/util/FileEngine.cpp Sun Dec 02 00:02:40 2012 +0100
@@ -12,6 +12,7 @@
: m_handle(NULL)
, m_flags(0)
, m_bufferSet(false)
+ , m_readWrite(false)
{
setFileName(filename);
}
@@ -25,7 +26,13 @@
{
close();
- if (openMode & QIODevice::WriteOnly) {
+ if ((openMode & QIODevice::ReadWrite) == QIODevice::ReadWrite) {
+ m_handle = PHYSFS_openAppend(m_fileName.toUtf8().constData());
+ m_readWrite = true;
+ seek(0);
+ }
+
+ else if (openMode & QIODevice::WriteOnly) {
m_handle = PHYSFS_openWrite(m_fileName.toUtf8().constData());
m_flags = QAbstractFileEngine::WriteOwnerPerm | QAbstractFileEngine::WriteUserPerm | QAbstractFileEngine::FileType;
}
@@ -76,9 +83,22 @@
return PHYSFS_tell(m_handle);
}
+bool FileEngine::setSize(qint64 size)
+{
+ if(size == 0)
+ {
+ m_size = 0;
+ return open(QIODevice::WriteOnly);
+ }
+ else
+ return false;
+}
+
bool FileEngine::seek(qint64 pos)
{
- return PHYSFS_seek(m_handle, pos) != 0;
+ bool ok = PHYSFS_seek(m_handle, pos) != 0;
+
+ return ok;
}
bool FileEngine::isSequential() const
@@ -110,7 +130,7 @@
bool FileEngine::isRelativePath() const
{
- return true;
+ return false;
}
QAbstractFileEngineIterator * FileEngine::beginEntryList(QDir::Filters filters, const QStringList &filterNames)
@@ -189,7 +209,7 @@
m_fileName = file;
PHYSFS_Stat stat;
- if (PHYSFS_stat(m_fileName.toUtf8().constData(), &stat) != 0) {
+ if (PHYSFS_stat(m_fileName.toUtf8().constData(), &stat) != 0) {
m_size = stat.filesize;
m_date = QDateTime::fromTime_t(stat.modtime);
// _flags |= QAbstractFileEngine::WriteUserPerm;
@@ -220,7 +240,16 @@
qint64 FileEngine::read(char *data, qint64 maxlen)
{
- return PHYSFS_readBytes(m_handle, data, maxlen);
+ if(m_readWrite)
+ {
+ if(pos() == 0)
+ open(QIODevice::ReadOnly);
+ else
+ return -1;
+ }
+
+ qint64 len = PHYSFS_readBytes(m_handle, data, maxlen);
+ return len;
}
qint64 FileEngine::readLine(char *data, qint64 maxlen)
@@ -286,7 +315,7 @@
QAbstractFileEngine* FileEngineHandler::create(const QString &filename) const
{
if (filename.startsWith(scheme))
- return new FileEngine(filename.mid(scheme.size()));
+ return new FileEngine(filename);
else
return NULL;
}
--- a/QTfrontend/util/FileEngine.h Sat Dec 01 16:03:38 2012 -0600
+++ b/QTfrontend/util/FileEngine.h Sun Dec 02 00:02:40 2012 +0100
@@ -22,6 +22,7 @@
virtual bool flush();
virtual qint64 size() const;
virtual qint64 pos() const;
+ virtual bool setSize(qint64 size);
virtual bool seek(qint64 pos);
virtual bool isSequential() const;
virtual bool remove();
@@ -55,6 +56,7 @@
QString m_fileName;
QDateTime m_date;
bool m_bufferSet;
+ bool m_readWrite;
};
class FileEngineHandler : public QAbstractFileEngineHandler
--- a/hedgewars/uAIAmmoTests.pas Sat Dec 01 16:03:38 2012 -0600
+++ b/hedgewars/uAIAmmoTests.pas Sun Dec 02 00:02:40 2012 +0100
@@ -116,7 +116,7 @@
(proc: nil; flags: 0), // amDrillStrike
(proc: nil; flags: 0), // amSnowball
(proc: nil; flags: 0), // amTardis
- (proc: nil; flags: 0), // amStructure
+ //(proc: nil; flags: 0), // amStructure
(proc: nil; flags: 0), // amLandGun
(proc: nil; flags: 0), // amIceGun
(proc: nil; flags: 0) // amKnife
--- a/hedgewars/uGears.pas Sat Dec 01 16:03:38 2012 -0600
+++ b/hedgewars/uGears.pas Sun Dec 02 00:02:40 2012 +0100
@@ -677,8 +677,8 @@
gtKnife,
gtCase,
gtTarget,
- gtExplosives,
- gtStructure: begin
+ gtExplosives: begin//,
+// gtStructure: begin
//addFileLog('ShotgunShot radius: ' + inttostr(Gear^.Radius) + ', t^.Radius = ' + inttostr(t^.Radius) + ', distance = ' + inttostr(dist) + ', dmg = ' + inttostr(dmg));
dmg:= 0;
r:= Gear^.Radius + t^.Radius;
@@ -777,8 +777,8 @@
gtKnife,
gtTarget,
gtCase,
- gtExplosives,
- gtStructure:
+ gtExplosives: //,
+ //gtStructure:
begin
if (Ammo^.Kind = gtDrill) then
begin
@@ -1363,7 +1363,7 @@
@doStepNapalmBomb,
@doStepSnowball,
@doStepSnowflake,
- @doStepStructure,
+ //@doStepStructure,
@doStepLandGun,
@doStepTardis,
@doStepIceGun,
--- a/hedgewars/uGearsHedgehog.pas Sat Dec 01 16:03:38 2012 -0600
+++ b/hedgewars/uGearsHedgehog.pas Sun Dec 02 00:02:40 2012 +0100
@@ -374,7 +374,7 @@
newGear:= AddGear(hwRound(lx), hwRound(ly), gtResurrector, 0, _0, _0, 0);
newGear^.SoundChannel := LoopSound(sndResurrector);
end;
- amStructure: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtStructure, gstWait, SignAs(_0_02, dX), _0, 3000);
+ //amStructure: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtStructure, gstWait, SignAs(_0_02, dX), _0, 3000);
amTardis: newGear:= AddGear(hwRound(X), hwRound(Y), gtTardis, 0, _0, _0, 5000);
amIceGun: newGear:= AddGear(hwRound(X), hwRound(Y), gtIceGun, 0, _0, _0, 0);
end;
@@ -404,7 +404,7 @@
amSeduction, amBallgun,
amJetpack, amBirdy,
amFlamethrower, amLandGun,
- amResurrector, amStructure,
+ amResurrector, //amStructure,
amTardis, amPiano,
amIceGun: CurAmmoGear:= newGear;
end;
--- a/hedgewars/uGearsList.pas Sat Dec 01 16:03:38 2012 -0600
+++ b/hedgewars/uGearsList.pas Sun Dec 02 00:02:40 2012 +0100
@@ -96,7 +96,7 @@
(* gtPoisonCloud *) , amNothing
(* gtSnowball *) , amSnowball
(* gtFlake *) , amNothing
-(* gtStructure *) , amStructure // TODO - This will undoubtedly change once there is more than one structure
+//(* gtStructure *) , amStructure // TODO - This will undoubtedly change once there is more than one structure
(* gtLandGun *) , amLandGun
(* gtTardis *) , amTardis
(* gtIceGun *) , amIceGun
@@ -536,6 +536,7 @@
gear^.Radius:= 5;
gear^.Density:= _1_5;
end;
+{
gtStructure: begin
gear^.Elasticity:= _0_55;
gear^.Friction:= _0_995;
@@ -546,6 +547,7 @@
gear^.Tag:= TotalRounds + 3;
gear^.Pos:= 1;
end;
+}
gtIceGun: gear^.Health:= 1000;
gtGenericFaller:begin
gear^.AdvBounce:= 1;
--- a/hedgewars/uGearsRender.pas Sat Dec 01 16:03:38 2012 -0600
+++ b/hedgewars/uGearsRender.pas Sun Dec 02 00:02:40 2012 +0100
@@ -1186,7 +1186,7 @@
if Gear^.FlightTime > 0 then
Tint($FF, $FF, $FF, $FF);
end;
- gtStructure: DrawSprite(sprTarget, x - 16, y - 16, 0);
+ //gtStructure: DrawSprite(sprTarget, x - 16, y - 16, 0);
gtTardis: if Gear^.Pos <> 4 then
begin
if Gear^.Pos = 2 then
--- a/hedgewars/uGearsUtils.pas Sat Dec 01 16:03:38 2012 -0600
+++ b/hedgewars/uGearsUtils.pas Sun Dec 02 00:02:40 2012 +0100
@@ -106,8 +106,8 @@
gtTarget,
gtFlame,
gtKnife,
- gtExplosives,
- gtStructure: begin
+ gtExplosives: begin //,
+ //gtStructure: begin
// Run the calcs only once we know we have a type that will need damage
tdX:= Gear^.X-fX;
tdY:= Gear^.Y-fY;
@@ -243,8 +243,8 @@
end;
uStats.HedgehogDamaged(Gear, AttackerHog, Damage, false);
end;
- end
- else if Gear^.Kind <> gtStructure then // not gtHedgehog nor gtStructure
+ end;
+ //else if Gear^.Kind <> gtStructure then // not gtHedgehog nor gtStructure
Gear^.Hedgehog:= AttackerHog;
inc(Gear^.Damage, Damage);
--- a/hedgewars/uSound.pas Sat Dec 01 16:03:38 2012 -0600
+++ b/hedgewars/uSound.pas Sun Dec 02 00:02:40 2012 +0100
@@ -419,7 +419,7 @@
if (snd = sndVictory) or (snd = sndFlawless) then
begin
Mix_FadeOutChannel(-1, 800);
- for i:= 0 to 7 do
+ for i:= 0 to High(VoiceList) do
VoiceList[i].snd:= sndNone;
LastVoice.snd:= sndNone;
end;
@@ -441,7 +441,7 @@
if (not isSoundEnabled) or fastUntilLag or ((LastVoice.snd <> sndNone) and (lastChan[LastVoice.snd] <> -1) and (Mix_Playing(lastChan[LastVoice.snd]) <> 0)) then
exit;
i:= 0;
- while (i<8) and (VoiceList[i].snd = sndNone) do
+ while (i<High(VoiceList)) and (VoiceList[i].snd = sndNone) do
inc(i);
if (VoiceList[i].snd <> sndNone) then
@@ -719,7 +719,7 @@
voicepacks[t].chunks[i]:= nil;
(* on MOBILE SDL_mixer has to be compiled against Tremor (USE_OGG_TREMOR)
- or sound files bigger than 32k will lockup the game *)
+ or sound files bigger than 32k will lockup the game on slow cpu *)
for i:= Low(TSound) to High(TSound) do
defVoicepack^.chunks[i]:= nil;
--- a/hedgewars/uTypes.pas Sat Dec 01 16:03:38 2012 -0600
+++ b/hedgewars/uTypes.pas Sun Dec 02 00:02:40 2012 +0100
@@ -102,7 +102,7 @@
gtSniperRifleShot, gtJetpack, gtMolotov, gtBirdy, // 44
gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 50
gtSMine, gtPoisonCloud, gtHammer, gtHammerHit, gtResurrector, // 55
- gtNapalmBomb, gtSnowball, gtFlake, gtStructure, gtLandGun, gtTardis, // 61
+ gtNapalmBomb, gtSnowball, gtFlake, {gtStructure,} gtLandGun, gtTardis, // 61
gtIceGun, gtAddAmmo, gtGenericFaller, gtKnife); // 65
// Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.)
@@ -151,7 +151,7 @@
amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, // 35
amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun, // 42
amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine, amHammer, // 48
- amResurrector, amDrillStrike, amSnowball, amTardis, amStructure, amLandGun, amIceGun, amKnife); // 54
+ amResurrector, amDrillStrike, amSnowball, amTardis, {amStructure,} amLandGun, amIceGun, amKnife); // 54
// Different kind of crates that e.g. hedgehogs can pick up
TCrateType = (HealthCrate, AmmoCrate, UtilityCrate);
@@ -411,7 +411,7 @@
sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb,
sidSineGun, sidFlamethrower,sidSMine, sidHammer, sidResurrector,
sidDrillStrike, sidSnowball, sidNothing, sidTardis,
- sidStructure, sidLandGun, sidIceGun, sidKnife);
+ {sidStructure,} sidLandGun, sidIceGun, sidKnife);
TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync,
--- a/hedgewars/uVariables.pas Sat Dec 01 16:03:38 2012 -0600
+++ b/hedgewars/uVariables.pas Sun Dec 02 00:02:40 2012 +0100
@@ -2127,6 +2127,7 @@
ejectY: 0),
// Structure
+{
(NameId: sidStructure;
NameTex: nil;
Probability: 0;
@@ -2152,6 +2153,7 @@
PosSprite: sprWater;
ejectX: 0;
ejectY: 0),
+}
// Land Gun
(NameId: sidLandGun;
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Sat Dec 01 16:03:38 2012 -0600
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Sun Dec 02 00:02:40 2012 +0100
@@ -261,70 +261,70 @@
isa = PBXContainerItemProxy;
containerPortal = 619599BA1364E65900B429B6 /* Freetype.xcodeproj */;
proxyType = 1;
- remoteGlobalIDString = D2AAC07D0554694100DB518D /* libFreetype */;
+ remoteGlobalIDString = D2AAC07D0554694100DB518D;
remoteInfo = libFreetype;
};
610FB7E316613980002FB2A7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 61A19BF414D20D83004B1E6D /* SDL_net.xcodeproj */;
proxyType = 1;
- remoteGlobalIDString = BE48FF6507AFA9A800BB41DA /* Static Library */;
+ remoteGlobalIDString = BE48FF6507AFA9A800BB41DA;
remoteInfo = "Static Library";
};
610FB7E516613980002FB2A7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6195993F1364C82B00B429B6 /* Lua.xcodeproj */;
proxyType = 1;
- remoteGlobalIDString = D2AAC07D0554694100DB518D /* libLua */;
+ remoteGlobalIDString = D2AAC07D0554694100DB518D;
remoteInfo = libLua;
};
610FB7E716613980002FB2A7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 61A19AE314D2010A004B1E6D /* SDL.xcodeproj */;
proxyType = 1;
- remoteGlobalIDString = FD6526620DE8FCCB002AD96B /* libSDL */;
+ remoteGlobalIDString = FD6526620DE8FCCB002AD96B;
remoteInfo = libSDL;
};
610FB7E916613980002FB2A7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 61A19C1E14D20F51004B1E6D /* SDL_mixer.xcodeproj */;
proxyType = 1;
- remoteGlobalIDString = BE1FA90707AF96B2004B6283 /* Static Library */;
+ remoteGlobalIDString = BE1FA90707AF96B2004B6283;
remoteInfo = "Static Library";
};
610FB7EB16613980002FB2A7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 61A19BC114D20CDA004B1E6D /* SDL_ttf.xcodeproj */;
proxyType = 1;
- remoteGlobalIDString = BE48FD6807AFA17000BB41DA /* Static Library */;
+ remoteGlobalIDString = BE48FD6807AFA17000BB41DA;
remoteInfo = "Static Library";
};
610FB7ED16613980002FB2A7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 619598181364BCD200B429B6 /* Tremor.xcodeproj */;
proxyType = 1;
- remoteGlobalIDString = D2AAC07D0554694100DB518D /* libTremor */;
+ remoteGlobalIDString = D2AAC07D0554694100DB518D;
remoteInfo = libTremor;
};
610FB7EF16613980002FB2A7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 61A19B6114D20B6C004B1E6D /* SDL_image.xcodeproj */;
proxyType = 1;
- remoteGlobalIDString = BE1FA72F07AF4C45004B6283 /* libSDL_image */;
+ remoteGlobalIDString = BE1FA72F07AF4C45004B6283;
remoteInfo = libSDL_image;
};
610FB7F7166139A4002FB2A7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 610FB7F3166139A4002FB2A7 /* Physfs.xcodeproj */;
proxyType = 2;
- remoteGlobalIDString = D2AAC07E0554694100DB518D /* libPhysfs.a */;
+ remoteGlobalIDString = D2AAC07E0554694100DB518D;
remoteInfo = Physfs;
};
610FB81B166139EC002FB2A7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 610FB7F3166139A4002FB2A7 /* Physfs.xcodeproj */;
proxyType = 1;
- remoteGlobalIDString = D2AAC07D0554694100DB518D /* Physfs */;
+ remoteGlobalIDString = D2AAC07D0554694100DB518D;
remoteInfo = Physfs;
};
6162456614E6159C00CC97FB /* PBXContainerItemProxy */ = {
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png has changed
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos@2x.png has changed
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw.png has changed
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw@2x.png has changed
Binary file share/hedgewars/Data/Graphics/AmmoMenu/BorderHorizontal.png has changed
Binary file share/hedgewars/Data/Graphics/AmmoMenu/BorderVertical.png has changed
--- a/share/hedgewars/Data/Graphics/AmmoMenu/CMakeLists.txt Sat Dec 01 16:03:38 2012 -0600
+++ b/share/hedgewars/Data/Graphics/AmmoMenu/CMakeLists.txt Sun Dec 02 00:02:40 2012 +0100
@@ -1,5 +1,4 @@
file(GLOB AmmoMenuSprites *.png)
-list(REMOVE_ITEM AmmoMenuSprites *@2x.png Border*.png)
install(FILES
${AmmoMenuSprites}