Crossfire Server, Trunk
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
v
w
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
i
j
k
m
n
o
p
r
s
t
u
v
Enumerations
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
Enumerator
Properties
a
b
c
d
e
f
h
i
j
k
l
m
n
p
q
r
s
t
y
Related Functions
:
b
d
o
s
w
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
w
y
z
Typedefs
a
c
d
e
f
i
j
k
l
m
n
o
p
q
s
t
y
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
QuestsWrapper.cpp
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
#include <QtWidgets>
14
15
#include "
QuestsWrapper.h
"
16
#include "
AssetsManager.h
"
17
#include "
assets/AssetOriginAndCreationDialog.h
"
18
19
void
QuestsWrapper::fillMenu
(QMenu *menu) {
20
connect
(menu->addAction(tr(
"Add quest"
)), &QAction::triggered, [
this
] () {
addQuest
(); });
21
}
22
23
void
QuestsWrapper::addQuest
() {
24
auto
origins =
myResources
->
questFiles
();
25
auto
keys
=
getManager
()->
quests
()->
keys
();
26
27
AssetOriginAndCreationDialog
aqd(
AssetOriginAndCreationDialog::Quest
,
AssetOriginAndCreationDialog::CreateAsset
,
""
, origins,
keys
);
28
if
(aqd.exec() != QDialog::Accepted) {
29
return
;
30
}
31
32
quest_definition
*qd =
quest_create
(aqd.
code
().toStdString().c_str());
33
qd->
quest_title
=
add_string
(qd->
quest_code
);
34
getManager
()->
quests
()->
define
(qd->
quest_code
, qd);
35
myResources
->
assetDefined
(qd, aqd.
file
().toStdString());
36
myResources
->
questModified
(qd);
37
markModified
(
BeforeChildAdd
,
myAssets
.size());
38
myAssets
.push_back(
myResources
->
wrap
(qd,
this
));
39
markModified
(
AfterChildAdd
,
myAssets
.size());
40
}
AssetWrapper::AfterChildAdd
@ AfterChildAdd
Definition:
AssetWrapper.h:33
AssetsManager.h
QuestsWrapper::addQuest
void addQuest()
Definition:
QuestsWrapper.cpp:23
ResourcesManager::questModified
void questModified(quest_definition *quest)
Definition:
ResourcesManager.cpp:222
ResourcesManager::wrap
ArchetypeWrapper * wrap(archetype *arch, AssetWrapper *parent)
Definition:
ResourcesManager.h:132
ResourcesManager::assetDefined
virtual void assetDefined(const archetype *arch, const std::string &filename) override
Definition:
ResourcesManager.h:101
ResourcesManager::questFiles
std::vector< std::string > questFiles() const
Definition:
ResourcesManager.h:115
hall_of_fame.keys
keys
Definition:
hall_of_fame.py:43
getManager
AssetsManager * getManager()
Definition:
assets.cpp:305
AssetsCollection::keys
std::vector< Key > keys() const
Definition:
AssetsCollection.h:183
quest_definition::quest_title
sstring quest_title
Definition:
quest.h:39
AssetOriginAndCreationDialog::CreateAsset
@ CreateAsset
Definition:
AssetOriginAndCreationDialog.h:25
AssetWrapper::BeforeChildAdd
@ BeforeChildAdd
Definition:
AssetWrapper.h:33
AssetsCollection::define
T * define(const Key &name, T *asset)
Definition:
AssetsCollection.h:120
AssetOriginAndCreationDialog.h
add_string
sstring add_string(const char *str)
Definition:
shstr.cpp:124
quest_definition::quest_code
sstring quest_code
Definition:
quest.h:38
QuestsWrapper::myResources
ResourcesManager * myResources
Definition:
QuestsWrapper.h:40
AssetOriginAndCreationDialog
Definition:
AssetOriginAndCreationDialog.h:21
AssetsManager::quests
Quests * quests()
Definition:
AssetsManager.h:71
QuestsWrapper.h
quest_definition
Definition:
quest.h:37
AssetWrapper::markModified
void markModified(ChangeType change, int extra=0)
Definition:
AssetWrapper.h:55
AssetsCollectionWrapper< quest_definition >::myAssets
QVector< AssetWrapper * > myAssets
Definition:
AssetsCollectionWrapper.h:41
AssetOriginAndCreationDialog::Quest
@ Quest
Definition:
AssetOriginAndCreationDialog.h:24
connect
Definition:
connect.py:1
quest_create
quest_definition * quest_create(const char *name)
Definition:
Quests.cpp:63
AssetOriginAndCreationDialog::code
QString code() const
Definition:
AssetOriginAndCreationDialog.h:37
AssetOriginAndCreationDialog::file
QString file() const
Definition:
AssetOriginAndCreationDialog.h:38
QuestsWrapper::fillMenu
virtual void fillMenu(QMenu *menu) override
Definition:
QuestsWrapper.cpp:19
crossfire-crossfire-server
utils
cre
quests
QuestsWrapper.cpp
Generated by
1.8.17