Crossfire Server, Trunk
AnimationPanel.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 <Qt>
14
15
#include "
global.h
"
16
#include "
artifact.h
"
17
#include "
object.h
"
18
#include "
face.h
"
19
20
#include "
AnimationPanel.h
"
21
#include "
AnimationControl.h
"
22
#include "
CREUtils.h
"
23
24
#include "
assets.h
"
25
#include "
AssetsManager.h
"
26
#include "
Archetypes.h
"
27
#include "
CREMapInformationManager.h
"
28
#include "
assets/AssetModel.h
"
29
#include "
animations/AnimationWrapper.h
"
30
31
AnimationPanel::AnimationPanel
(QWidget* parent,
AssetModel
*assets) :
AssetTWrapperPanel
(parent) {
32
addAssetUseTree
(tr(
"Used by"
), assets,
"self"
);
33
34
myFaces
=
addWidget
(
""
,
new
QTreeWidget(
this
),
false
,
nullptr
,
nullptr
);
35
myFaces
->setColumnCount(1);
36
myFaces
->setHeaderLabel(tr(
"Faces"
));
37
myFaces
->setIconSize(QSize(32, 32));
38
39
myDisplay
=
addWidget
(
""
,
new
AnimationControl
(
this
),
false
,
nullptr
,
nullptr
);
40
}
41
42
void
AnimationPanel::updateItem
() {
43
myDisplay
->
setAnimation
(
myItem
);
44
45
myFaces
->clear();
46
auto
root
=
CREUtils::faceNode
(NULL);
47
myFaces
->addTopLevelItem(
root
);
48
root
->setExpanded(
true
);
49
50
for
(
int
face = 0; face <
myItem
->
num_animations
; face++)
51
{
52
CREUtils::faceNode
(
myItem
->
faces
[face],
root
);
53
}
54
}
global.h
AnimationPanel::AnimationPanel
AnimationPanel(QWidget *parent, AssetModel *assets)
Definition:
AnimationPanel.cpp:31
AssetsManager.h
face.h
AnimationControl.h
CREUtils::faceNode
static QTreeWidgetItem * faceNode(QTreeWidgetItem *parent)
Definition:
CREUtils.cpp:46
CREUtils.h
root
static char root[500]
Definition:
mapper.cpp:304
artifact.h
AssetWrapperPanel::addAssetUseTree
AssetUseTree * addAssetUseTree(const QString &label, AssetModel *assets, const char *property)
Definition:
AssetWrapperPanel.cpp:150
AssetTWrapperPanel
Definition:
AssetWrapperPanel.h:92
AnimationWrapper.h
AssetModel
Definition:
AssetModel.h:29
AssetModel.h
Animations::num_animations
uint8_t num_animations
Definition:
face.h:27
CREMapInformationManager.h
AnimationPanel::updateItem
virtual void updateItem() override
Definition:
AnimationPanel.cpp:42
AssetTWrapperPanel< Animations >::myItem
Animations * myItem
Definition:
AssetWrapperPanel.h:106
Animations::faces
const Face ** faces
Definition:
face.h:30
AnimationPanel::myFaces
QTreeWidget * myFaces
Definition:
AnimationPanel.h:37
AnimationPanel::myDisplay
AnimationControl * myDisplay
Definition:
AnimationPanel.h:38
AssetWrapperPanel::addWidget
T * addWidget(const QString &label, T *widget, bool sideBySide, const char *property, const char *widgetProperty)
Definition:
AssetWrapperPanel.h:64
assets.h
Archetypes.h
AnimationControl
Definition:
AnimationControl.h:27
AnimationControl::setAnimation
void setAnimation(const Animations *animation, int facings=-1)
Definition:
AnimationControl.cpp:41
AnimationPanel.h
object.h
crossfire-crossfire-server
utils
cre
animations
AnimationPanel.cpp
Generated by
1.8.17