merge 0.9.21, hopefully without screwing anything up due to this having been left for a while + parallel commits that occurred...
--- a/QTfrontend/hedgewars.qrc Sun Jan 18 16:57:32 2015 -0500
+++ b/QTfrontend/hedgewars.qrc Sun Jan 18 17:14:37 2015 -0500
@@ -124,7 +124,11 @@
<file>res/iconHealth.png</file>
<file>res/iconSuddenDeath.png</file>
<file>res/iconDamage.png</file>
+ <file>res/iconDamageLockG.png</file>
+ <file>res/iconDamageLockR.png</file>
<file>res/iconTime.png</file>
+ <file>res/iconTimeLockG.png</file>
+ <file>res/iconTimeLockR.png</file>
<file>res/iconMine.png</file>
<file>res/iconDud.png</file>
<file>res/iconRope.png</file>
--- a/QTfrontend/model/roomslistmodel.cpp Sun Jan 18 16:57:32 2015 -0500
+++ b/QTfrontend/model/roomslistmodel.cpp Sun Jan 18 17:14:37 2015 -0500
@@ -108,22 +108,38 @@
if (role == Qt::DecorationRole)
{
const QIcon roomBusyIcon(":/res/iconDamage.png");
+ const QIcon roomBusyIconGreen(":/res/iconDamageLockG.png");
+ const QIcon roomBusyIconRed(":/res/iconDamageLockR.png");
const QIcon roomWaitingIcon(":/res/iconTime.png");
+ const QIcon roomWaitingIconGreen(":/res/iconTimeLockG.png");
+ const QIcon roomWaitingIconRed(":/res/iconTimeLockR.png");
+
+ QString flags = m_data.at(row).at(StateColumn);
- if (m_data.at(row).at(0).isEmpty())
- return QVariant(roomWaitingIcon);
+ if (flags.contains("g"))
+ {
+ if (flags.contains("j"))
+ return QVariant(roomBusyIconRed);
+ else if (flags.contains("p"))
+ return QVariant(roomBusyIconGreen);
+ else
+ return QVariant(roomBusyIcon);
+ }
else
- return QVariant(roomBusyIcon);
+ {
+ if (flags.contains("j"))
+ return QVariant(roomWaitingIconRed);
+ else if (flags.contains("p"))
+ return QVariant(roomWaitingIconGreen);
+ else
+ return QVariant(roomWaitingIcon);
+ }
}
QString content = m_data.at(row).at(column);
if (role == Qt::DisplayRole)
{
- // supply in progress flag as bool
- if (column == 0)
- return QVariant(QString(!content.isEmpty()));
-
// display room names
if (column == 5)
{
@@ -190,7 +206,7 @@
l.append(rooms[i + t]);
}
- m_data.append(roomInfo2RoomRecord(l));
+ m_data.append(l);
}
endResetModel();
@@ -201,7 +217,7 @@
{
beginInsertRows(QModelIndex(), 0, 0);
- m_data.prepend(roomInfo2RoomRecord(info));
+ m_data.prepend(info);
endInsertRows();
}
@@ -250,25 +266,7 @@
if (i < 0)
return;
- m_data[i] = roomInfo2RoomRecord(info);
+ m_data[i] = info;
emit dataChanged(index(i, 0), index(i, columnCount(QModelIndex()) - 1));
}
-
-
-QStringList RoomsListModel::roomInfo2RoomRecord(const QStringList & info)
-{
- QStringList result;
-
- result = info;
-
- QString flags = info[StateColumn];
- // for matters of less memory usage and quicker access store
- // the boolean string as either "t" or empty
- if (flags.contains('g'))
- result[StateColumn] = "t";
- else
- result[StateColumn] = QString();
-
- return result;
-}
--- a/QTfrontend/model/roomslistmodel.h Sun Jan 18 16:57:32 2015 -0500
+++ b/QTfrontend/model/roomslistmodel.h Sun Jan 18 17:14:37 2015 -0500
@@ -66,8 +66,6 @@
QStringList m_headerData;
MapModel * m_staticMapModel;
MapModel * m_missionMapModel;
-
- QStringList roomInfo2RoomRecord(const QStringList & info);
};
#endif // HEDGEWARS_ROOMSLISTMODEL_H
Binary file QTfrontend/res/iconDamageLockG.png has changed
Binary file QTfrontend/res/iconDamageLockR.png has changed
Binary file QTfrontend/res/iconTimeLockG.png has changed
Binary file QTfrontend/res/iconTimeLockR.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/res/locks.svg Sun Jan 18 17:14:37 2015 -0500
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ id="svg2"
+ viewBox="0 0 225.52 116.94"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ width="100%"
+ height="100%"
+ sodipodi:docname="sloten.svg">
+ <defs
+ id="defs14" />
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1028"
+ id="namedview12"
+ showgrid="false"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:zoom="6.3586638"
+ inkscape:cx="102.46566"
+ inkscape:cy="54.65346"
+ inkscape:window-x="0"
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg2">
+ <sodipodi:guide
+ orientation="0,1"
+ position="141.89589,74.728869"
+ id="guide3765" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="105.52531,92.000461"
+ id="guide3767" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="80.362796,66.52341"
+ id="guide3769" />
+ </sodipodi:namedview>
+ <path
+ style="fill:#dd2727"
+ inkscape:connector-curvature="0"
+ d="M 73.809216,100.09273 73.879916,44.786734 H 0.40991832 L -0.03314168,99.516734 C 0.03755832,119.84473 16.535858,116.77773 36.887858,116.77773 57.239856,116.77773 73.808856,120.44373 73.808856,100.09173 z"
+ id="path2865-1"
+ inkscape:export-xdpi="13.85"
+ inkscape:export-ydpi="13.85" />
+ <path
+ style="fill:#920312"
+ inkscape:connector-curvature="0"
+ d="M 37.036484,61.912734 C 33.023684,61.912734 29.788884,65.147534 29.788884,69.160334 29.788884,72.084634 31.494584,74.619834 33.984884,75.772234 L 31.299484,93.859234 H 43.760484 L 40.883284,75.327234 C 42.936484,74.043334 44.316384,71.760434 44.316384,69.160434 44.316384,65.147634 41.049784,61.912834 37.036984,61.912834 z"
+ id="path2860-7"
+ inkscape:export-filename="/home/nemo/hg/hedgewars/0.9.21/QTfrontend/res/path2865-1.png"
+ inkscape:export-xdpi="13.85"
+ inkscape:export-ydpi="13.85" />
+ <path
+ style="fill:#dd2727"
+ inkscape:connector-curvature="0"
+ d="M 4.7043898,42.314248 C 4.7043898,42.314248 3.1630898,0.18524828 36.55839,0.18524828 69.95369,0.18524828 67.89839,42.314248 67.89839,42.314248 H 59.16429 C 59.16429,42.314248 58.9074,10.460249 36.55829,9.6902482 14.20929,8.9195882 15.49329,42.314248 15.49329,42.314248 H 4.7042898 z"
+ id="path3743"
+ inkscape:export-filename="/home/nemo/hg/hedgewars/0.9.21/QTfrontend/res/path2865-1.png"
+ inkscape:export-xdpi="13.85"
+ inkscape:export-ydpi="13.85" />
+ <path
+ style="fill:#60df33"
+ inkscape:connector-curvature="0"
+ d="M 85.015528,42.497266 C 85.015528,42.497266 83.474228,0.36826574 116.86953,0.36826574 150.26483,0.36826574 148.20953,42.497266 148.20953,42.497266 H 139.47543 C 139.47543,42.497266 139.21854,10.643266 116.86943,9.8732657 94.520428,9.1026057 95.804428,42.497266 95.804428,42.497266 H 85.015428 z"
+ id="path2858"
+ inkscape:export-filename="/home/nemo/hg/hedgewars/0.9.21/QTfrontend/res/path2860.png"
+ inkscape:export-xdpi="13.85"
+ inkscape:export-ydpi="13.85" />
+ <path
+ style="fill:#60df33"
+ inkscape:connector-curvature="0"
+ d="M 154.04553,100.41727 154.11623,45.111266 H 80.646228 L 80.203168,99.841266 C 80.273868,120.16927 96.772168,117.10227 117.12417,117.10227 137.47617,117.10227 154.04517,120.76827 154.04517,100.41627 z"
+ id="path2865"
+ inkscape:export-filename="/home/nemo/hg/hedgewars/0.9.21/QTfrontend/res/path2860.png"
+ inkscape:export-xdpi="13.85"
+ inkscape:export-ydpi="13.85" />
+ <path
+ style="fill:#287f09"
+ inkscape:connector-curvature="0"
+ d="M 117.11553,62.227266 C 113.10273,62.227266 109.86793,65.462066 109.86793,69.474866 109.86793,72.399166 111.57363,74.934366 114.06393,76.086766 L 111.37853,94.173766 H 123.83953 L 120.96233,75.641766 C 123.01553,74.357866 124.39543,72.074966 124.39543,69.474966 124.39543,65.462166 121.12883,62.227366 117.11603,62.227366 z"
+ id="path2860"
+ inkscape:export-xdpi="13.85"
+ inkscape:export-ydpi="13.85" />
+ <metadata
+ id="metadata10">
+ <rdf:RDF>
+ <cc:Work>
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
+ <dc:publisher>
+ <cc:Agent
+ rdf:about="http://openclipart.org/">
+ <dc:title>Openclipart</dc:title>
+ </cc:Agent>
+ </dc:publisher>
+ <dc:title>Open and closed lock</dc:title>
+ <dc:date>2013-11-07T10:50:32</dc:date>
+ <dc:description>Set of 2 locks, one opened and one closed.</dc:description>
+ <dc:source>https://openclipart.org/detail/188421/open-and-closed-lock-by-iyo-188421</dc:source>
+ <dc:creator>
+ <cc:Agent>
+ <dc:title>Iyo</dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <dc:subject>
+ <rdf:Bag>
+ <rdf:li>closed</rdf:li>
+ <rdf:li>lock</rdf:li>
+ <rdf:li>locks</rdf:li>
+ <rdf:li>open</rdf:li>
+ <rdf:li>pic</rdf:li>
+ <rdf:li>pictogram</rdf:li>
+ <rdf:li>sign</rdf:li>
+ </rdf:Bag>
+ </dc:subject>
+ </cc:Work>
+ <cc:License
+ rdf:about="http://creativecommons.org/licenses/publicdomain/">
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Reproduction" />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Distribution" />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+ </cc:License>
+ </rdf:RDF>
+ </metadata>
+</svg>
--- a/QTfrontend/ui/page/pageroomslist.cpp Sun Jan 18 16:57:32 2015 -0500
+++ b/QTfrontend/ui/page/pageroomslist.cpp Sun Jan 18 17:14:37 2015 -0500
@@ -77,8 +77,16 @@
showGamesInProgress = new QAction(QAction::tr("Show games in-progress"), stateMenu);
showGamesInProgress->setCheckable(true);
showGamesInProgress->setChecked(true);
+ showPassword = new QAction(QAction::tr("Show password protected"), stateMenu);
+ showPassword->setCheckable(true);
+ showPassword->setChecked(true);
+ showJoinRestricted = new QAction(QAction::tr("Show join restricted"), stateMenu);
+ showJoinRestricted->setCheckable(true);
+ showJoinRestricted->setChecked(true);
stateMenu->addAction(showGamesInLobby);
stateMenu->addAction(showGamesInProgress);
+ stateMenu->addAction(showPassword);
+ stateMenu->addAction(showJoinRestricted);
btnState->setMenu(stateMenu);
// Help/prompt message at top
@@ -186,6 +194,8 @@
connect(roomsList, SIGNAL(clicked (const QModelIndex &)), searchText, SLOT(setFocus()));
connect(showGamesInLobby, SIGNAL(triggered()), this, SLOT(onFilterChanged()));
connect(showGamesInProgress, SIGNAL(triggered()), this, SLOT(onFilterChanged()));
+ connect(showPassword, SIGNAL(triggered()), this, SLOT(onFilterChanged()));
+ connect(showJoinRestricted, SIGNAL(triggered()), this, SLOT(onFilterChanged()));
connect(searchText, SIGNAL(textChanged (const QString &)), this, SLOT(onFilterChanged()));
connect(this, SIGNAL(askJoinConfirmation (const QString &)), this, SLOT(onJoinConfirmation(const QString &)), Qt::QueuedConnection);
@@ -630,13 +640,29 @@
bool stateLobby = showGamesInLobby->isChecked();
bool stateProgress = showGamesInProgress->isChecked();
+ bool statePassword = showPassword->isChecked();
+ bool stateJoinRestricted = showJoinRestricted->isChecked();
- if (stateLobby && stateProgress)
- stateFilteredModel->setFilterFixedString(QString()); // "any"
- else if (stateLobby != stateProgress)
- stateFilteredModel->setFilterFixedString(QString(stateProgress));
+ QString filter;
+ if (!stateLobby && !stateProgress)
+ filter = "O_o";
+ else if (stateLobby && stateProgress && statePassword && stateJoinRestricted)
+ filter = "";
else
- stateFilteredModel->setFilterFixedString(QString("none")); // Basically, none.
+ {
+ QString exclude = "[^";
+ if (!stateProgress) exclude += "g";
+ if (!statePassword) exclude += "p";
+ if (!stateJoinRestricted) exclude += "j";
+ exclude += "]*";
+ if (stateProgress && statePassword && stateJoinRestricted) exclude = ".*";
+ filter = "^" + exclude;
+ if (!stateLobby) filter += "g" + exclude;
+ filter += "$";
+ }
+ //qDebug() << filter;
+
+ stateFilteredModel->setFilterRegExp(filter);
}
void PageRoomsList::setSettings(QSettings *settings)
--- a/QTfrontend/ui/page/pageroomslist.h Sun Jan 18 16:57:32 2015 -0500
+++ b/QTfrontend/ui/page/pageroomslist.h Sun Jan 18 17:14:37 2015 -0500
@@ -96,6 +96,8 @@
QSortFilterProxyModel * stateFilteredModel;
QAction * showGamesInLobby;
QAction * showGamesInProgress;
+ QAction * showPassword;
+ QAction * showJoinRestricted;
QSplitter * m_splitter;
AmmoSchemeModel * ammoSchemeModel;
--- a/hedgewars/uChat.pas Sun Jan 18 16:57:32 2015 -0500
+++ b/hedgewars/uChat.pas Sun Jan 18 17:14:37 2015 -0500
@@ -32,7 +32,7 @@
procedure SendHogSpeech(s: shortstring);
implementation
-uses SDLh, uInputHandler, uTypes, uVariables, uCommands, uUtils, uTextures, uRender, uIO, uScript;
+uses SDLh, uInputHandler, uTypes, uVariables, uCommands, uUtils, uTextures, uRender, uIO, uScript, uRenderUtils;
const MaxStrIndex = 27;
@@ -91,8 +91,6 @@
dstrect : TSDL_Rect; // destination rectangle for blitting
font : THWFont;
const
- shadowcolor: TSDL_Color = (r:$00; g:$00; b:$00; a:$FF);
- //shadowcolor: TSDL_Color = (r:$00; g:$00; b:$00; a:$80);
shadowint = $80 shl AShift;
begin
@@ -117,23 +115,11 @@
// draw background
SDL_FillRect(resSurface, @dstrect, shadowint);
-dstrect.x:= Padding + 1;
-dstrect.y:= Padding + 1;
-// doesn't matter if .w and .h still include padding, SDL_UpperBlit will clip
-
-
-// create and blit text shadow
-strSurface:= TTF_RenderUTF8_Solid(Fontz[font].Handle, Str2PChar(str), shadowcolor);
-SDL_UpperBlit(strSurface, nil, resSurface, @dstrect);
-SDL_FreeSurface(strSurface);
-
-// non-shadow text starts at padding
-dstrect.x:= Padding;
-dstrect.y:= Padding;
// create and blit text
strSurface:= TTF_RenderUTF8_Blended(Fontz[font].Handle, Str2PChar(str), cl.color);
-SDL_UpperBlit(strSurface, nil, resSurface, @dstrect);
+//SDL_UpperBlit(strSurface, nil, resSurface, @dstrect);
+if strSurface <> nil then copyTOXY(strSurface, resSurface, Padding, Padding);
SDL_FreeSurface(strSurface);
cl.Tex:= Surface2Tex(resSurface, false);
--- a/hedgewars/uVisualGearsHandlers.pas Sun Jan 18 16:57:32 2015 -0500
+++ b/hedgewars/uVisualGearsHandlers.pas Sun Jan 18 17:14:37 2015 -0500
@@ -125,7 +125,7 @@
if (round(X) >= cLeftScreenBorder)
and (round(X) <= cRightScreenBorder)
- and (round(Y) - 75 <= LAND_HEIGHT)
+ and (round(Y) - 250 <= LAND_HEIGHT)
and (Timer > 0) and (Timer-Steps > 0) then
begin
if tdX > 0 then
@@ -152,23 +152,31 @@
X:= X + cScreenSpace;
moved:= true
end
- else
- if round(X) > cRightScreenBorder then
- begin
- X:= X - cScreenSpace;
- moved:= true
- end;
+ else if round(X) > cRightScreenBorder then
+ begin
+ X:= X - cScreenSpace;
+ moved:= true
+ end;
// if round(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + 25.0; // For if flag is set for flakes rising upwards?
- if (Gear^.Layer = 2) and (round(Y) - 225 > LAND_HEIGHT) then
+ if (Gear^.Layer = 2) and (round(Y) - 400 > LAND_HEIGHT) and (cGravityf >= 0) then
begin
X:= cLeftScreenBorder + random(cScreenSpace);
- Y:= Y - (1024 + 250 + random(50)); // TODO - configure in theme (jellies for example could use limited range)
+ Y:= Y-(1024 + 400 + random(50)); // TODO - configure in theme (jellies for example could use limited range)
moved:= true
end
- else if (Gear^.Layer <> 2) and (round(Y) + 50 > LAND_HEIGHT) then
+ else if (Gear^.Layer <> 2) and (round(Y) - 150 > LAND_HEIGHT) and (cGravityf >= 0) then
begin
X:= cLeftScreenBorder + random(cScreenSpace);
- Y:= Y - (1024 + random(25));
+ Y:= Y-(1024 + 200 + random(50));
+ moved:= true
+ end
+ else if (round(Y) < LAND_HEIGHT-1200) and (cGravityf < 0) then // gravity can make flakes move upwards
+ begin
+ X:= cLeftScreenBorder + random(cScreenSpace);
+ if Gear^.Layer = 2 then
+ Y:= Y+(1024 + 150 + random(100))
+ else
+ Y:= Y+(1024 + random(50));
moved:= true
end;
if moved then