Crossfire Resources Editor
AssetOriginAndCreationDialog.h
Go to the documentation of this file.
1
/*
2
* Crossfire -- cooperative multi-player graphical RPG and adventure game
3
*
4
* Copyright (c) 2022 the Crossfire Development Team
5
*
6
* Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7
* welcome to redistribute it under certain conditions. For details, please
8
* see COPYING and LICENSE.
9
*
10
* The authors can be reached via e-mail at <crossfire@metalforge.org>.
11
*/
12
13
#ifndef ASSET_ORIGIN_AND_CREATION_DIALOG_H
14
#define ASSET_ORIGIN_AND_CREATION_DIALOG_H
15
16
#include <QtWidgets>
17
21
class
AssetOriginAndCreationDialog
:
public
QDialog {
22
Q_OBJECT
23
public
:
24
enum
Type
{
Quest
= 0,
Treasure
= 1,
Archetype
= 2 };
25
enum
Mode
{
CreateAsset
,
DefineOrigin
};
26
35
AssetOriginAndCreationDialog
(
Type
type,
Mode
mode,
const
QString &
code
,
const
std::vector<std::string> &origins,
const
std::vector<std::string> &assets);
36
37
QString
code
()
const
{
return
myCode
->text(); }
38
QString
file
()
const
{
return
myNewFile
->isEnabled() ?
myNewFile
->text() :
myExistingFile
->currentText(); }
39
40
private
:
41
Type
myType
;
42
QString
myRootDirectory
;
43
QLineEdit *
myCode
;
44
QComboBox *
myExistingFile
;
45
QLineEdit *
myNewFile
;
46
std::vector<std::string>
myAssets
;
52
void
validate
();
53
};
54
55
#endif
/* ASSET_ORIGIN_AND_CREATION_DIALOG_H */
AssetOriginAndCreationDialog::myAssets
std::vector< std::string > myAssets
Existing assets, to avoid duplication.
Definition:
AssetOriginAndCreationDialog.h:46
AssetOriginAndCreationDialog::AssetOriginAndCreationDialog
AssetOriginAndCreationDialog(Type type, Mode mode, const QString &code, const std::vector< std::string > &origins, const std::vector< std::string > &assets)
Standard constructor.
Definition:
AssetOriginAndCreationDialog.cpp:44
AssetOriginAndCreationDialog::DefineOrigin
@ DefineOrigin
Definition:
AssetOriginAndCreationDialog.h:25
AssetOriginAndCreationDialog::CreateAsset
@ CreateAsset
Definition:
AssetOriginAndCreationDialog.h:25
AssetOriginAndCreationDialog::myNewFile
QLineEdit * myNewFile
New file path.
Definition:
AssetOriginAndCreationDialog.h:45
AssetOriginAndCreationDialog::Mode
Mode
Definition:
AssetOriginAndCreationDialog.h:25
AssetOriginAndCreationDialog::myCode
QLineEdit * myCode
Quest code.
Definition:
AssetOriginAndCreationDialog.h:43
AssetOriginAndCreationDialog
Helper dialog to input origin of an asset, and maybe create a new one.
Definition:
AssetOriginAndCreationDialog.h:21
AssetOriginAndCreationDialog::Treasure
@ Treasure
Definition:
AssetOriginAndCreationDialog.h:24
AssetOriginAndCreationDialog::validate
void validate()
Check if data is complete.
Definition:
AssetOriginAndCreationDialog.cpp:109
AssetOriginAndCreationDialog::myRootDirectory
QString myRootDirectory
Base path for this asset type.
Definition:
AssetOriginAndCreationDialog.h:42
AssetOriginAndCreationDialog::Type
Type
Definition:
AssetOriginAndCreationDialog.h:24
AssetOriginAndCreationDialog::Archetype
@ Archetype
Definition:
AssetOriginAndCreationDialog.h:24
AssetOriginAndCreationDialog::Quest
@ Quest
Definition:
AssetOriginAndCreationDialog.h:24
AssetOriginAndCreationDialog::myType
Type myType
Asset type.
Definition:
AssetOriginAndCreationDialog.h:41
AssetOriginAndCreationDialog::code
QString code() const
Definition:
AssetOriginAndCreationDialog.h:37
AssetOriginAndCreationDialog::myExistingFile
QComboBox * myExistingFile
Selected current file.
Definition:
AssetOriginAndCreationDialog.h:44
AssetOriginAndCreationDialog::file
QString file() const
Definition:
AssetOriginAndCreationDialog.h:38
crossfire-crossfire-server
utils
cre
assets
AssetOriginAndCreationDialog.h
Generated on Mon Sep 1 2025 00:41:07 for Crossfire Resources Editor by
1.8.17