Merge remote-tracking branch 'origin/noggit-shadowlands' into noggit-shadowlands
This commit is contained in:
2
src/external/blizzard-database-library
vendored
2
src/external/blizzard-database-library
vendored
Submodule src/external/blizzard-database-library updated: e6ea6da13d...d3b24f5905
@@ -51,28 +51,19 @@
|
||||
|
||||
#include <glm/gtc/quaternion.hpp>
|
||||
#include <glm/gtx/quaternion.hpp>
|
||||
#include <blizzard-database-library/include/BlizzardDatabaseRecord.h>
|
||||
|
||||
bool World::IsEditableWorld(int pMapId)
|
||||
bool World::IsEditableWorld(BlizzardDatabaseLib::Structures::BlizzardDatabaseRow& record)
|
||||
{
|
||||
ZoneScoped;
|
||||
std::string lMapName;
|
||||
try
|
||||
{
|
||||
DBCFile::Record map = gMapDB.getByID((unsigned int)pMapId);
|
||||
lMapName = map.getString(MapDB::InternalName);
|
||||
}
|
||||
catch (int)
|
||||
{
|
||||
LogError << "Did not find map with id " << pMapId << ". This is NOT editable.." << std::endl;
|
||||
return false;
|
||||
}
|
||||
std::string lMapName = record.Columns["Directory"].Value;
|
||||
|
||||
std::stringstream ssfilename;
|
||||
ssfilename << "World\\Maps\\" << lMapName << "\\" << lMapName << ".wdt";
|
||||
|
||||
if (!Noggit::Application::NoggitApplication::instance()->clientData()->exists(ssfilename.str()))
|
||||
{
|
||||
Log << "World " << pMapId << ": " << lMapName << " has no WDT file!" << std::endl;
|
||||
Log << "World " << record.RecordId << ": " << lMapName << " has no WDT file!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
#include <array>
|
||||
#include <noggit/project/ApplicationProject.h>
|
||||
|
||||
namespace Noggit
|
||||
{
|
||||
@@ -347,7 +348,7 @@ public:
|
||||
// used after the uid fix all
|
||||
void unload_every_model_and_wmo_instance();
|
||||
|
||||
static bool IsEditableWorld(int pMapId);
|
||||
static bool IsEditableWorld(BlizzardDatabaseLib::Structures::BlizzardDatabaseRow& record);
|
||||
|
||||
void clearHeight(glm::vec3 const& pos);
|
||||
void clearAllModelsOnADT(TileIndex const& tile);
|
||||
|
||||
@@ -30,7 +30,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
auto noggit = Noggit::Application::NoggitApplication::instance();
|
||||
noggit->Initalize(argc, argv);
|
||||
noggit->Start();
|
||||
|
||||
auto projectSelectionPage = std::make_unique<Noggit::Ui::Windows::noggitRedProjectPage>(noggit);
|
||||
projectSelectionPage->show();
|
||||
|
||||
return qApplication.exec();
|
||||
}
|
||||
@@ -110,30 +110,6 @@ namespace Noggit::Application
|
||||
//All of the below should be Project Initalisation
|
||||
srand(::time(nullptr));
|
||||
|
||||
QSettings settings;
|
||||
QDir path(settings.value("project/game_path").toString());
|
||||
|
||||
wowpath = path.absolutePath().toStdString();
|
||||
|
||||
Log << "Game path: " << wowpath << std::endl;
|
||||
|
||||
project_path = settings.value("project/path", path.absolutePath()).toString().toStdString();
|
||||
settings.setValue("project/path", QString::fromStdString(project_path));
|
||||
|
||||
Log << "Project path: " << project_path << std::endl;
|
||||
|
||||
settings.setValue("project/game_path", path.absolutePath());
|
||||
settings.setValue("project/path", QString::fromStdString(project_path));
|
||||
}
|
||||
|
||||
void NoggitApplication::Start()
|
||||
{
|
||||
_client_data = std::make_unique<BlizzardArchive::ClientData>(wowpath.string(), BlizzardArchive::ClientVersion::WOTLK, BlizzardArchive::Locale::AUTO, project_path);
|
||||
|
||||
OpenDBs();
|
||||
|
||||
projectSelectionPage = std::make_unique<Noggit::Ui::Windows::noggitRedProjectPage>(this);
|
||||
projectSelectionPage->show();
|
||||
}
|
||||
|
||||
std::shared_ptr<Noggit::Application::NoggitApplicationConfiguration> NoggitApplication::GetConfiguration()
|
||||
|
||||
@@ -45,9 +45,9 @@ namespace Noggit::Application {
|
||||
return &inst;
|
||||
}
|
||||
|
||||
BlizzardArchive::ClientData* clientData() { return _client_data.get(); };
|
||||
BlizzardArchive::ClientData* clientData() { return _client_data.get(); }
|
||||
void clientData(std::shared_ptr<BlizzardArchive::ClientData> data) { _client_data = data; }
|
||||
|
||||
void Start();
|
||||
void Initalize(int argc, char* argv[]);
|
||||
std::shared_ptr<Noggit::Application::NoggitApplicationConfiguration> GetConfiguration();
|
||||
static void TerminationHandler();
|
||||
@@ -56,10 +56,8 @@ namespace Noggit::Application {
|
||||
|
||||
std::shared_ptr<Noggit::Application::NoggitApplicationConfiguration> _applicationConfiguration;
|
||||
std::unique_ptr<Noggit::Ui::Windows::noggitRedProjectPage> projectSelectionPage;
|
||||
std::unique_ptr<BlizzardArchive::ClientData> _client_data;
|
||||
std::shared_ptr<BlizzardArchive::ClientData> _client_data;
|
||||
|
||||
std::filesystem::path wowpath;
|
||||
std::string project_path;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <memory>
|
||||
#include <blizzard-archive-library/include/CASCArchive.hpp>
|
||||
#include <blizzard-archive-library/include/ClientFile.hpp>
|
||||
#include <blizzard-database-library/include/BlizzardDatabase.h>
|
||||
#include <noggit/application/Configuration/NoggitApplicationConfiguration.hpp>
|
||||
#include <noggit/ui/windows/downloadFileDialog/DownloadFileDialog.h>
|
||||
#include <QJsonDocument>
|
||||
@@ -46,8 +47,10 @@ namespace Noggit::Project
|
||||
{
|
||||
public:
|
||||
std::string ProjectName;
|
||||
std::string ClientDatabaseFilePath;
|
||||
std::string ClientPath;
|
||||
ProjectVersion ProjectVersion;
|
||||
std::shared_ptr<BlizzardDatabaseLib::BlizzardDatabase> ClientDatabase;
|
||||
std::shared_ptr<BlizzardArchive::ClientData> ClientData;
|
||||
};
|
||||
|
||||
class ApplicationProject
|
||||
@@ -76,7 +79,7 @@ namespace Noggit::Project
|
||||
project.Client.ClientVersion = clientVersion;
|
||||
project.Client.ClientPath = clientPath.generic_string();
|
||||
|
||||
auto projectConfigurationFilePath = (projectPath / (projectName + std::string(".json")));
|
||||
auto projectConfigurationFilePath = (projectPath / (projectName + std::string(".noggitproj")));
|
||||
auto projectConfigurationFile = QFile(QString::fromStdString(projectConfigurationFilePath.generic_string()));
|
||||
projectConfigurationFile.open(QIODevice::WriteOnly);
|
||||
|
||||
@@ -179,7 +182,7 @@ namespace Noggit::Project
|
||||
|
||||
std::shared_ptr<NoggitProject> LoadProject(std::filesystem::path projectPath, std::string projectName)
|
||||
{
|
||||
auto projectConfigurationFilePath = (projectPath / (projectName + std::string(".json")));
|
||||
auto projectConfigurationFilePath = (projectPath / (projectName + std::string(".noggitproj")));
|
||||
|
||||
QFile inputFile(QString::fromStdString(projectConfigurationFilePath.generic_string()));
|
||||
inputFile.open(QIODevice::ReadOnly);
|
||||
@@ -197,22 +200,45 @@ namespace Noggit::Project
|
||||
if (projectConfiguration.contains("Client") && projectConfiguration["Client"].isObject())
|
||||
{
|
||||
auto projectClientConfiguration = projectConfiguration["Client"].toObject();
|
||||
|
||||
if (projectClientConfiguration.contains("ClientPath"))
|
||||
{
|
||||
project.ClientPath = projectClientConfiguration["ClientPath"].toString().toStdString();
|
||||
}
|
||||
|
||||
if (projectClientConfiguration.contains("ClientVersion"))
|
||||
{
|
||||
auto clientVersion = projectClientConfiguration["ClientVersion"].toString().toStdString();
|
||||
|
||||
auto clientVersionEnum = Noggit::Project::ProjectVersion::WOTLK;
|
||||
auto clientBuild = BlizzardDatabaseLib::Structures::Build("3.3.5.12340");
|
||||
auto clientArchiveVersion = BlizzardArchive::ClientVersion::WOTLK;
|
||||
auto clientArchiveLocale = BlizzardArchive::Locale::AUTO;
|
||||
if (clientVersion == std::string("Shadowlands"))
|
||||
{
|
||||
clientVersionEnum = Noggit::Project::ProjectVersion::SL;
|
||||
clientArchiveVersion = BlizzardArchive::ClientVersion::SL;
|
||||
clientBuild = BlizzardDatabaseLib::Structures::Build("9.1.0.39584");
|
||||
clientArchiveLocale = BlizzardArchive::Locale::enUS;
|
||||
}
|
||||
|
||||
if (clientVersion == std::string("Wrath Of The Lich King"))
|
||||
{
|
||||
clientVersionEnum = Noggit::Project::ProjectVersion::WOTLK;
|
||||
|
||||
clientArchiveVersion = BlizzardArchive::ClientVersion::WOTLK;
|
||||
clientBuild = BlizzardDatabaseLib::Structures::Build("3.3.5.12340");
|
||||
clientArchiveLocale = BlizzardArchive::Locale::AUTO;
|
||||
}
|
||||
|
||||
project.ProjectVersion = clientVersionEnum;
|
||||
|
||||
|
||||
std::string dbcFileDirectory = (projectPath / "workspace" / "DBFilesClient").generic_string();
|
||||
std::string dbdFileDirectory = _configuration->ApplicationDatabaseDefinitionsPath;
|
||||
|
||||
project.ClientDatabase = std::make_shared<BlizzardDatabaseLib::BlizzardDatabase>(dbcFileDirectory, dbdFileDirectory, clientBuild);
|
||||
project.ClientData = std::make_shared<BlizzardArchive::ClientData>(project.ClientPath, clientArchiveVersion, clientArchiveLocale, std::string(""));
|
||||
}
|
||||
}
|
||||
|
||||
project.ClientDatabaseFilePath = (projectPath / "workspace" / "DBFilesClient").generic_string();
|
||||
}
|
||||
|
||||
return std::make_shared<NoggitProject>(project);
|
||||
|
||||
@@ -29,9 +29,8 @@
|
||||
|
||||
using namespace Noggit::Ui::Tools::MapCreationWizard::Ui;
|
||||
|
||||
MapCreationWizard::MapCreationWizard(QWidget* parent) : Noggit::Ui::widget(parent)
|
||||
MapCreationWizard::MapCreationWizard(std::shared_ptr<Project::NoggitProject> project, QWidget* parent) : Noggit::Ui::widget(parent), _project(project)
|
||||
{
|
||||
|
||||
auto layout = new QHBoxLayout(this);
|
||||
|
||||
// Left side
|
||||
@@ -69,20 +68,27 @@ MapCreationWizard::MapCreationWizard(QWidget* parent) : Noggit::Ui::widget(paren
|
||||
_corpse_map_id->setItemData(0, QVariant (-1));
|
||||
|
||||
// Fill selector combo
|
||||
|
||||
const auto& table = std::string("map");
|
||||
auto mapTable = _project->ClientDatabase->LoadTable(table);
|
||||
|
||||
int count = 0;
|
||||
for (DBCFile::Iterator i = gMapDB.begin(); i != gMapDB.end(); ++i)
|
||||
auto iterator = mapTable.Records();
|
||||
while (iterator.HasRecords())
|
||||
{
|
||||
int map_id = i->getInt(MapDB::MapID);
|
||||
std::string name = i->getLocalizedString(MapDB::Name);
|
||||
int area_type = i->getUInt(MapDB::AreaType);
|
||||
auto record = iterator.Next();
|
||||
|
||||
if (area_type < 0 || area_type > 4 || !World::IsEditableWorld(map_id))
|
||||
continue;
|
||||
int map_id = record.RecordId;
|
||||
std::string name = record.Columns["MapName_lang"].Value;
|
||||
int area_type = std::stoi(record.Columns["InstanceType"].Value);
|
||||
|
||||
_corpse_map_id->addItem(QString::number(map_id) + " - " + QString::fromUtf8 (name.c_str()));
|
||||
_corpse_map_id->setItemData(count + 1, QVariant (map_id));
|
||||
if (area_type < 0 || area_type > 4 || !World::IsEditableWorld(record))
|
||||
continue;
|
||||
|
||||
count++;
|
||||
_corpse_map_id->addItem(QString::number(map_id) + " - " + QString::fromUtf8(name.c_str()));
|
||||
_corpse_map_id->setItemData(count + 1, QVariant(map_id));
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
auto add_btn = new QPushButton("New",this);
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Noggit
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MapCreationWizard(QWidget *parent = nullptr);
|
||||
MapCreationWizard(std::shared_ptr<Project::NoggitProject> project, QWidget *parent = nullptr);
|
||||
~MapCreationWizard();
|
||||
|
||||
void wheelEvent(QWheelEvent *event) override;
|
||||
@@ -91,6 +91,7 @@ namespace Noggit
|
||||
void map_dbc_updated();
|
||||
|
||||
private:
|
||||
std::shared_ptr<Project::NoggitProject> _project;
|
||||
Noggit::Ui::minimap_widget* _minimap_widget;
|
||||
int _selected_map;
|
||||
QGroupBox* _map_settings;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
using namespace Noggit::Ui::Tools::PresetEditor::Ui;
|
||||
using namespace Noggit::Ui;
|
||||
|
||||
PresetEditorWidget::PresetEditorWidget(QWidget *parent)
|
||||
: QMainWindow(parent, Qt::Window)
|
||||
PresetEditorWidget::PresetEditorWidget(std::shared_ptr<Project::NoggitProject> project, QWidget *parent)
|
||||
: QMainWindow(parent, Qt::Window), _project(project)
|
||||
{
|
||||
setWindowTitle("Preset Editor");
|
||||
|
||||
@@ -72,24 +72,30 @@ PresetEditorWidget::PresetEditorWidget(QWidget *parent)
|
||||
// Fill selector combo
|
||||
ui->worldSelector->addItem("None");
|
||||
ui->worldSelector->setItemData(0, QVariant(-1));
|
||||
|
||||
const auto& table = std::string("map");
|
||||
auto mapTable = _project->ClientDatabase->LoadTable(table);
|
||||
|
||||
int count = 1;
|
||||
for (DBCFile::Iterator i = gMapDB.begin(); i != gMapDB.end(); ++i)
|
||||
auto iterator = mapTable.Records();
|
||||
while (iterator.HasRecords())
|
||||
{
|
||||
int map_id = i->getInt(MapDB::MapID);
|
||||
std::string name = i->getLocalizedString(MapDB::Name);
|
||||
int area_type = i->getUInt(MapDB::AreaType);
|
||||
auto record = iterator.Next();
|
||||
|
||||
if (area_type < 0 || area_type > 4 || !World::IsEditableWorld(map_id))
|
||||
continue;
|
||||
int map_id = record.RecordId;
|
||||
std::string name = record.Columns["MapName_lang"].Value;
|
||||
int area_type = std::stoi(record.Columns["InstanceType"].Value);
|
||||
|
||||
ui->worldSelector->addItem(QString::number(map_id) + " - " + QString::fromUtf8 (name.c_str()));
|
||||
ui->worldSelector->setItemData(count, QVariant(map_id), Qt::UserRole);
|
||||
if (area_type < 0 || area_type > 4 || !World::IsEditableWorld(record))
|
||||
continue;
|
||||
|
||||
auto map_internal_name = i->getString(MapDB::InternalName);
|
||||
ui->worldSelector->setItemData(count, QVariant(QString::fromStdString(map_internal_name)), Qt::UserRole + 1);
|
||||
ui->worldSelector->addItem(QString::number(map_id) + " - " + QString::fromUtf8(name.c_str()));
|
||||
ui->worldSelector->setItemData(count, QVariant(map_id), Qt::UserRole);
|
||||
|
||||
count++;
|
||||
auto map_internal_name = record.Columns["Directory"].Value;
|
||||
ui->worldSelector->setItemData(count, QVariant(QString::fromStdString(map_internal_name)), Qt::UserRole + 1);
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
// Handle minimap widget
|
||||
|
||||
@@ -19,12 +19,12 @@ namespace Noggit
|
||||
class PresetEditorWidget : public QMainWindow
|
||||
{
|
||||
public:
|
||||
PresetEditorWidget(QWidget* parent = nullptr);
|
||||
PresetEditorWidget(std::shared_ptr<Project::NoggitProject> project, QWidget* parent = nullptr);
|
||||
~PresetEditorWidget();
|
||||
|
||||
private:
|
||||
void setupConnectsCommon();
|
||||
|
||||
std::shared_ptr<Project::NoggitProject> _project;
|
||||
::Ui::PresetEditor* ui;
|
||||
::Ui::PresetEditorOverlay* viewport_overlay_ui;
|
||||
QFileSystemModel* _model;
|
||||
|
||||
@@ -65,8 +65,9 @@ namespace Noggit::Ui
|
||||
setWindowTitle (QString::fromStdString (title.str()));
|
||||
setWindowIcon (QIcon (":/icon"));
|
||||
|
||||
setCentralWidget (_null_widget);
|
||||
//OpenDBs();
|
||||
|
||||
setCentralWidget (_null_widget);
|
||||
createBookmarkList();
|
||||
|
||||
_about = new about(this);
|
||||
@@ -114,11 +115,7 @@ namespace Noggit::Ui
|
||||
|
||||
_menuBar->adjustSize();
|
||||
|
||||
if (_project->ProjectVersion == Noggit::Project::ProjectVersion::SL)
|
||||
build_menu(true);
|
||||
else
|
||||
build_menu(false);
|
||||
|
||||
build_menu();
|
||||
}
|
||||
|
||||
void main_window::check_uid_then_enter_map
|
||||
@@ -198,6 +195,9 @@ namespace Noggit::Ui
|
||||
|
||||
_world.reset();
|
||||
|
||||
auto table = _project->ClientDatabase->LoadTable("Map");
|
||||
auto record = table.Record(mapID);
|
||||
|
||||
for (DBCFile::Iterator it = gMapDB.begin(); it != gMapDB.end(); ++it)
|
||||
{
|
||||
if (it->getInt(MapDB::MapID) == mapID)
|
||||
@@ -213,7 +213,7 @@ namespace Noggit::Ui
|
||||
LogError << "Map with ID " << mapID << " not found. Failed loading." << std::endl;
|
||||
}
|
||||
|
||||
void main_window::build_menu(bool isShadowlands)
|
||||
void main_window::build_menu()
|
||||
{
|
||||
_stack_widget = new StackedWidget(this);
|
||||
_stack_widget->setAutoResize(true);
|
||||
@@ -258,7 +258,7 @@ namespace Noggit::Ui
|
||||
|
||||
layout->addWidget (entry_points_tabs);
|
||||
|
||||
build_map_lists(isShadowlands);
|
||||
build_map_lists();
|
||||
|
||||
qulonglong bookmark_index (0);
|
||||
for (auto entry : mBookmarks)
|
||||
@@ -314,12 +314,12 @@ namespace Noggit::Ui
|
||||
right_side->addTab(minimap_holder, "Enter map");
|
||||
minimap_holder->setAccessibleName("main_menu_minimap_holder");
|
||||
|
||||
_map_creation_wizard = new Noggit::Ui::Tools::MapCreationWizard::Ui::MapCreationWizard(this);
|
||||
_map_creation_wizard = new Noggit::Ui::Tools::MapCreationWizard::Ui::MapCreationWizard(_project,this);
|
||||
|
||||
_map_wizard_connection = connect(_map_creation_wizard, &Noggit::Ui::Tools::MapCreationWizard::Ui::MapCreationWizard::map_dbc_updated
|
||||
,[=]
|
||||
{
|
||||
build_map_lists(isShadowlands);
|
||||
build_map_lists();
|
||||
}
|
||||
);
|
||||
|
||||
@@ -332,61 +332,37 @@ namespace Noggit::Ui
|
||||
_minimap->adjustSize();
|
||||
}
|
||||
|
||||
void Noggit::Ui::main_window::build_map_lists(bool isShadowlands)
|
||||
void Noggit::Ui::main_window::build_map_lists()
|
||||
{
|
||||
std::array<QListWidget*, 5> type_to_table
|
||||
{{_continents_table, _dungeons_table, _raids_table, _battlegrounds_table, _arenas_table}};
|
||||
|
||||
std::array<QListWidget*, 5> type_to_table
|
||||
{{_continents_table, _dungeons_table, _raids_table, _battlegrounds_table, _arenas_table}};
|
||||
for (auto& table : type_to_table)
|
||||
{
|
||||
table->clear();
|
||||
}
|
||||
|
||||
for (auto& table : type_to_table)
|
||||
{
|
||||
table->clear();
|
||||
}
|
||||
const auto& table = std::string("map");
|
||||
auto mapTable = _project->ClientDatabase->LoadTable(table);
|
||||
|
||||
if(isShadowlands)
|
||||
{
|
||||
std::string dbcFileDirectory = _project->ClientDatabaseFilePath;
|
||||
std::string dbdFileDirectory = _applicationConfiguration->ApplicationDatabaseDefinitionsPath;
|
||||
auto iterator = mapTable.Records();
|
||||
while (iterator.HasRecords())
|
||||
{
|
||||
auto record = iterator.Next();
|
||||
MapEntry e;
|
||||
e.mapID = record.RecordId;
|
||||
e.name = record.Columns["MapName_lang"].Value;
|
||||
e.areaType = std::stoi(record.Columns["InstanceType"].Value);
|
||||
|
||||
const auto& build = BlizzardDatabaseLib::Structures::Build("9.1.0.39584");
|
||||
const auto& table = std::string("map");
|
||||
if (e.areaType < 0 || e.areaType > 4 || !World::IsEditableWorld(record))
|
||||
continue;
|
||||
|
||||
auto blizzardDatabase = BlizzardDatabaseLib::BlizzardDatabase(dbcFileDirectory, dbdFileDirectory, build);
|
||||
auto mapTable = blizzardDatabase.LoadTable(table);
|
||||
auto item(new QListWidgetItem(QString::number(e.mapID) + " - " + QString::fromUtf8(e.name.c_str()),
|
||||
type_to_table[e.areaType]));
|
||||
item->setData(Qt::UserRole, QVariant(e.mapID));
|
||||
}
|
||||
|
||||
auto iterator = mapTable.Records();
|
||||
while (iterator.HasRecords())
|
||||
{
|
||||
|
||||
auto record = iterator.Next();
|
||||
MapEntry e;
|
||||
e.mapID = record.RecordId;
|
||||
e.name = record.Columns["MapName_lang"].Value;
|
||||
e.areaType = std::stoi(record.Columns["InstanceType"].Value);
|
||||
|
||||
if (e.areaType < 0 || e.areaType > 4)
|
||||
continue;
|
||||
|
||||
auto item(new QListWidgetItem(QString::number(e.mapID) + " - " + QString::fromUtf8(e.name.c_str()), type_to_table[e.areaType]));
|
||||
item->setData(Qt::UserRole, QVariant(e.mapID));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (DBCFile::Iterator i = gMapDB.begin(); i != gMapDB.end(); ++i)
|
||||
{
|
||||
MapEntry e;
|
||||
e.mapID = i->getInt(MapDB::MapID);
|
||||
e.name = i->getLocalizedString(MapDB::Name);
|
||||
e.areaType = i->getUInt(MapDB::AreaType);
|
||||
|
||||
if (e.areaType < 0 || e.areaType > 4 || !World::IsEditableWorld(e.mapID))
|
||||
continue;
|
||||
|
||||
auto item(new QListWidgetItem(QString::number(e.mapID) + " - " + QString::fromUtf8(e.name.c_str()), type_to_table[e.areaType]));
|
||||
item->setData(Qt::UserRole, QVariant(e.mapID));
|
||||
}
|
||||
}
|
||||
_project->ClientDatabase->UnloadTable(table);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,12 +34,12 @@ namespace Noggit
|
||||
|
||||
void prompt_exit(QCloseEvent* event);
|
||||
void prompt_uid_fix_failure();
|
||||
void build_map_lists(bool isShadowlands);
|
||||
void build_map_lists();
|
||||
|
||||
QMenuBar* _menuBar;
|
||||
|
||||
std::unordered_set<QWidget*> displayed_widgets;
|
||||
void build_menu(bool isShadowlands);
|
||||
void build_menu();
|
||||
signals:
|
||||
void exit_prompt_opened();
|
||||
void map_selected(int map_id);
|
||||
|
||||
@@ -60,6 +60,9 @@ namespace Noggit::Ui::Windows
|
||||
auto projectPath = std::filesystem::path(applicationProjectsFolderPath / projectName);
|
||||
_selectedProject = applicationProjectService.LoadProject(projectPath, projectName);
|
||||
|
||||
//This to not be static, but its hard to remove
|
||||
Noggit::Application::NoggitApplication::instance()->clientData(_selectedProject->ClientData);
|
||||
|
||||
close();
|
||||
projectSelectionPage = std::make_unique<Noggit::Ui::main_window>(_noggitApplication->GetConfiguration(), _selectedProject);
|
||||
projectSelectionPage->showMaximized();
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Noggit
|
||||
, [=]
|
||||
{
|
||||
parent->setEnabled(true);
|
||||
parent->build_menu(true);
|
||||
parent->build_menu();
|
||||
hide();
|
||||
}
|
||||
);
|
||||
@@ -28,7 +28,7 @@ namespace Noggit
|
||||
, [=]
|
||||
{
|
||||
parent->setEnabled(true);
|
||||
parent->build_menu(false);
|
||||
parent->build_menu();
|
||||
hide();
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user