Separate layout/header features of new map dialog

This commit is contained in:
GriffinR
2024-11-12 15:57:27 -05:00
parent 7d7db3857d
commit 8bb0100540
19 changed files with 1134 additions and 820 deletions

View File

@@ -1,18 +1,18 @@
#ifndef MAPHEADERFORM_H
#define MAPHEADERFORM_H
#include "project.h"
#include "map.h"
#include "ui_mapheaderform.h"
#include <QWidget>
/*
This is the UI class used to edit the fields in a map's header.
It's intended to be used anywhere the UI needs to present an editor for a map's header,
e.g. for the current map in the main editor or in the new map dialog.
*/
#include <QWidget>
#include <QPointer>
#include "mapheader.h"
class Project;
namespace Ui {
class MapHeaderForm;
}
@@ -25,32 +25,43 @@ public:
explicit MapHeaderForm(QWidget *parent = nullptr);
~MapHeaderForm();
void setProject(Project * project);
void setMap(Map * map);
void clearDisplay();
void init(const Project * project);
void clear();
void refreshLocationsComboBox();
void setHeader(MapHeader *header);
MapHeader headerData() const;
Ui::MapHeaderForm *ui;
void setLocations(QStringList locations);
void setLocationsDisabled(bool disabled);
private:
QPointer<Map> map = nullptr;
QPointer<Project> project = nullptr;
Ui::MapHeaderForm *ui;
QPointer<MapHeader> m_header = nullptr;
private slots:
void on_comboBox_Song_currentTextChanged(const QString &);
void on_comboBox_Location_currentTextChanged(const QString &);
void on_comboBox_Weather_currentTextChanged(const QString &);
void on_comboBox_Type_currentTextChanged(const QString &);
void on_comboBox_BattleScene_currentTextChanged(const QString &);
void on_checkBox_RequiresFlash_stateChanged(int);
void on_checkBox_ShowLocationName_stateChanged(int);
void on_checkBox_AllowRunning_stateChanged(int);
void on_checkBox_AllowBiking_stateChanged(int);
void on_checkBox_AllowEscaping_stateChanged(int);
void on_spinBox_FloorNumber_valueChanged(int);
void updateUi();
void updateSong();
void updateLocation();
void updateRequiresFlash();
void updateWeather();
void updateType();
void updateBattleScene();
void updateShowsLocationName();
void updateAllowsRunning();
void updateAllowsBiking();
void updateAllowsEscaping();
void updateFloorNumber();
void onSongUpdated(const QString &song);
void onLocationChanged(const QString &location);
void onWeatherChanged(const QString &weather);
void onTypeChanged(const QString &type);
void onBattleSceneChanged(const QString &battleScene);
void onRequiresFlashChanged(int selected);
void onShowLocationNameChanged(int selected);
void onAllowRunningChanged(int selected);
void onAllowBikingChanged(int selected);
void onAllowEscapingChanged(int selected);
void onFloorNumberChanged(int offset);
};
#endif // MAPHEADERFORM_H