Skip to content

Commit

Permalink
#1717 + rollback to qt 6,5,2 due to ci + more map download work
Browse files Browse the repository at this point in the history
  • Loading branch information
Robosturm committed Dec 2, 2023
1 parent aeb0ac8 commit 3aab30b
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Commnader_Wars
on: [push]
env:
BUILD_TYPE: Release
QT_Version: '6.6.1'
QT_Version: '6.5.2'
workspace: 'D:/a/Commander_Wars/Commander_Wars'
GCC_PATH: 'D:/a/Commander_Wars/Commander_Wars/qt/Qt/Tools/mingw1120_64/bin/'
JAVA_PATH: 'C:/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/11.0.21-9/x64/'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Commnader_Wars_Release

env:
BUILD_TYPE: Release
QT_Version: '6.6.1'
QT_Version: '6.5.2'
workspace: 'D:/a/Commander_Wars/Commander_Wars'
JAVA_PATH: 'C:/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/11.0.21-9/x64/'
ANDROID_OPEN_SSL_TAG: '7f5f34d16040883f7353b3f99bc3fc83ecdc2a4b'
Expand Down
7 changes: 7 additions & 0 deletions multiplayer/dialogotherlobbyinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "multiplayer/dialogotherlobbyinfo.h"
#include "multiplayer/dialogcostatsinfo.h"
#include "multiplayer/lobbymenu.h"
#include "multiplayer/dialogselectdownloadmap.h"

#include "ui_reader/uifactory.h"

Expand Down Expand Up @@ -72,6 +73,12 @@ void DialogOtherLobbyInfo::showAutoMatches()
m_pLobbyMenu->requestShowAutoMatches();
}

void DialogOtherLobbyInfo::showDownloadMap()
{
spDialogSelectDownloadMap pSelectDownloadMap = MemoryManagement::create<DialogSelectDownloadMap>(m_pLobbyMenu);
addChild(pSelectDownloadMap);
}

void DialogOtherLobbyInfo::receivedShowAutoMatches(const QJsonObject & objData)
{

Expand Down
1 change: 1 addition & 0 deletions multiplayer/dialogotherlobbyinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class DialogOtherLobbyInfo final : public CustomDialog
Q_INVOKABLE void showPlayerStats(const QString & player);
Q_INVOKABLE void showAutoMatches();
Q_INVOKABLE LobbyMenu* getLobbyMenu();
Q_INVOKABLE void showDownloadMap();
private slots:
void onSearchedPlayersReceived(const QStringList & foundPlayers);
void receivedPlayerStats(const QJsonObject & objData);
Expand Down
5 changes: 4 additions & 1 deletion multiplayer/dialogselectdownloadmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ DialogSelectDownloadMap::DialogSelectDownloadMap(LobbyMenu* pBaseMenu)
m_uiXml = "ui/multiplayer/selectDownloadMap.xml";
loadXmlFile(m_uiXml);
connect(m_pBaseMenu, &LobbyMenu::sigOnDownloadedResponse, this, &DialogSelectDownloadMap::onMapDownloaded, Qt::QueuedConnection);
connect(m_pBaseMenu, &LobbyMenu::sigReceivedAvailableMaps, this, &DialogSelectDownloadMap::receivedMapData, Qt::QueuedConnection);
}

void DialogSelectDownloadMap::showMapFilter()
Expand Down Expand Up @@ -84,6 +85,7 @@ qint32 DialogSelectDownloadMap::getPageCount()
void DialogSelectDownloadMap::filterChanged()
{
QString command = QString(NetworkCommands::REQUESTAVAILABLEMAPS);
CONSOLE_PRINT("Sending command " + command, GameConsole::eDEBUG);
QJsonObject data = m_mapFilter.toJson();
data.insert(JsonKeys::JSONKEY_COMMAND, command);
data.insert(JsonKeys::JSONKEY_ITEMSPERPAGE, ITEMS_PER_PAGE);
Expand All @@ -93,8 +95,8 @@ void DialogSelectDownloadMap::filterChanged()

void DialogSelectDownloadMap::receivedMapData(const QJsonObject &objData)
{
m_currentStartIndex = objData.value(JsonKeys::JSONKEY_STARTINDEX).toInt();
m_mapData = objData;
m_currentStartIndex = objData.value(JsonKeys::JSONKEY_STARTINDEX).toInt();
m_minimapImages.clear();
QJsonArray mapArray = m_mapData.value(JsonKeys::JSONKEY_FOUNDITEMS).toArray();
for (const auto & mapData : mapArray)
Expand All @@ -109,6 +111,7 @@ void DialogSelectDownloadMap::receivedMapData(const QJsonObject &objData)
Mainapp::getInstance()->loadResAnim(minimapImage, img, 1, 1, 1);
m_minimapSprites.push_back(minimapImage);
}
CONSOLE_PRINT("Refreshing ui with the received maps " + QString::number(m_minimapImages.size()), GameConsole::eDEBUG);
refreshUi();
}

Expand Down
7 changes: 0 additions & 7 deletions multiplayer/lobbymenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "multiplayer/multiplayermenu.h"
#include "multiplayer/networkgamedataview.h"
#include "multiplayer/dialogotherlobbyinfo.h"
#include "multiplayer/dialogselectdownloadmap.h"

#include "coreengine/mainapp.h"
#include "coreengine/gameconsole.h"
Expand Down Expand Up @@ -1057,9 +1056,3 @@ void LobbyMenu::requestAvailableMaps(const QJsonObject & objData)
QJsonDocument doc(objData);
emit m_pTCPClient->sig_sendData(0, doc.toJson(QJsonDocument::JsonFormat::Compact), NetworkInterface::NetworkSerives::ServerHostingJson, false);
}

void LobbyMenu::showDownloadMap()
{
spDialogSelectDownloadMap pSelectDownloadMap = MemoryManagement::create<DialogSelectDownloadMap>(this);
addChild(pSelectDownloadMap);
}
1 change: 0 additions & 1 deletion multiplayer/lobbymenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class LobbyMenu final : public Basemenu
Q_INVOKABLE void requestPlayerStats(const QString & player);
Q_INVOKABLE void uploadMap(const QString & selectedFilePath);
Q_INVOKABLE void requestDownloadMap(const QJsonObject & objData);
Q_INVOKABLE void showDownloadMap();
void requestAvailableMaps(const QJsonObject & objData);
signals:
void sigExitMenue();
Expand Down
4 changes: 4 additions & 0 deletions network/mainserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ void MainServer::recieveData(quint64 socketID, QByteArray data, NetworkInterface
{
m_mapFileServer.onRequestDownloadMap(socketID, objData);
}
else if (messageType == NetworkCommands::REQUESTAVAILABLEMAPS)
{
m_mapFileServer.onRequestFilteredMaps(socketID, objData);
}
else
{
CONSOLE_PRINT("Unknown command in MainServer::recieveData " + messageType + " received", GameConsole::eDEBUG);
Expand Down
2 changes: 1 addition & 1 deletion resources/scripts/units/gunboat.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var Constructor = function()
animation.setSound("moveship.wav", -2);
return animation;
};
this.actionList = ["ACTION_CAPTURE", "ACTION_FIRE", "ACTION_JOIN", "ACTION_LOAD", "ACTION_UNLOAD", "ACTION_WAIT", "ACTION_CO_UNIT_0", "ACTION_CO_UNIT_1"];
this.actionList = ["ACTION_FIRE", "ACTION_MISSILE", "ACTION_CAPTURE", "ACTION_JOIN", "ACTION_LOAD", "ACTION_UNLOAD", "ACTION_WAIT", "ACTION_CO_UNIT_0", "ACTION_CO_UNIT_1"];
this.canMoveAndFire = function()
{
return true;
Expand Down
7 changes: 4 additions & 3 deletions resources/ui/multiplayer/selectDownloadMap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Button>
<x>10</x>
<y>10</y>
<width>150</width>
<width>250</width>
<text>QT_TRANSLATE_NOOP("GAME","Select map filter")</text>
<tooltip>QT_TRANSLATE_NOOP("GAME","Select the filter for which maps you see for downloading.")</tooltip>
<onEvent>currentMenu.showMapFilter();</onEvent>
Expand Down Expand Up @@ -114,7 +114,7 @@
</Panel>

<IconButton>
<x>10</x>
<x>(settings.getStageWidth() - 20) / 2 - 135</x>
<y>lastY + lastHeight + 10</y>
<sprite>"toStart"</sprite>
<tooltip>QT_TRANSLATE_NOOP("GAME","Goes to the first page.")</tooltip>
Expand All @@ -130,10 +130,11 @@
<Label>
<x>lastX + lastWidth + 10</x>
<y>lastY</y>
<width>200</width>
<width>100</width>
<text>SelectDownloadMap.getPageText()</text>
<font>"main"</font>
<fontSize>24</fontSize>
<hAlign>"Middle"</hAlign>
</Label>
<IconButton>
<x>lastX + lastWidth + 10</x>
Expand Down

0 comments on commit 3aab30b

Please sign in to comment.