2024-11-12 19:27:35 +00:00
|
|
|
#ifndef MAPHEADERFORM_H
|
|
|
|
#define MAPHEADERFORM_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
2024-11-12 20:57:27 +00:00
|
|
|
#include <QWidget>
|
|
|
|
#include <QPointer>
|
|
|
|
#include "mapheader.h"
|
|
|
|
|
|
|
|
class Project;
|
|
|
|
|
2024-11-12 19:27:35 +00:00
|
|
|
namespace Ui {
|
|
|
|
class MapHeaderForm;
|
|
|
|
}
|
|
|
|
|
|
|
|
class MapHeaderForm : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MapHeaderForm(QWidget *parent = nullptr);
|
|
|
|
~MapHeaderForm();
|
|
|
|
|
2024-11-12 20:57:27 +00:00
|
|
|
void init(const Project * project);
|
2024-11-12 19:27:35 +00:00
|
|
|
void clear();
|
|
|
|
|
2024-11-12 20:57:27 +00:00
|
|
|
void setHeader(MapHeader *header);
|
|
|
|
MapHeader headerData() const;
|
2024-11-12 19:27:35 +00:00
|
|
|
|
2024-11-12 20:57:27 +00:00
|
|
|
void setLocations(QStringList locations);
|
|
|
|
void setLocationsDisabled(bool disabled);
|
2024-11-12 19:27:35 +00:00
|
|
|
|
|
|
|
private:
|
2024-11-12 20:57:27 +00:00
|
|
|
Ui::MapHeaderForm *ui;
|
|
|
|
QPointer<MapHeader> m_header = nullptr;
|
|
|
|
|
|
|
|
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);
|
2024-11-12 19:27:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAPHEADERFORM_H
|