Crossfire Resources Editor
RandomMapPanel.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 "
RandomMapPanel.h
"
16
#include "
RandomMap.h
"
17
#include "
CREMapInformation.h
"
18
19
CRERandomMapPanel::CRERandomMapPanel
(QWidget* parent) :
AssetSWrapperPanel
(parent)
20
{
21
myLayout
->addWidget(
new
QLabel(tr(
"Source map:"
),
this
), 0, 0);
22
myLayout
->addWidget(
mySource
=
new
QLabel(
this
), 0, 1);
23
myLayout
->addWidget(
new
QLabel(tr(
"Parameters:"
),
this
), 1, 0, 1, 2);
24
myLayout
->addWidget(
myInformation
=
new
QTextEdit(
this
), 2, 0, 1, 2);
25
myInformation
->setReadOnly(
true
);
26
}
27
28
void
CRERandomMapPanel::updateItem
()
29
{
30
StringBuffer* sb = write_map_parameters_to_string(
myItem
->
parameters
());
31
char
* text = stringbuffer_finish(sb);
32
myInformation
->setText(text);
33
free(text);
34
35
mySource
->setText(QString(
"%1 [%2, %3]"
).arg(
myItem
->
map
()->
displayName
()).arg(
myItem
->
x
()).arg(
myItem
->
y
()));
36
}
RandomMap::parameters
const RMParms * parameters() const
Definition:
RandomMap.cpp:39
CREMapInformation::displayName
virtual QString displayName() const override
Definition:
CREMapInformation.cpp:47
RandomMap::map
const CREMapInformation * map() const
Definition:
RandomMap.cpp:24
CREMapInformation.h
RandomMap::x
int x() const
Definition:
RandomMap.cpp:29
AssetSWrapperPanel< const RandomMap >::myItem
const RandomMap * myItem
Item to display.
Definition:
AssetWrapperPanel.h:126
RandomMap.h
CRERandomMapPanel::mySource
QLabel * mySource
Definition:
RandomMapPanel.h:32
CRERandomMapPanel::CRERandomMapPanel
CRERandomMapPanel(QWidget *parent)
Definition:
RandomMapPanel.cpp:19
AssetWrapperPanel::myLayout
QGridLayout * myLayout
Definition:
AssetWrapperPanel.h:56
RandomMapPanel.h
RandomMap::y
int y() const
Definition:
RandomMap.cpp:34
AssetSWrapperPanel
Panel displaying information about an AssetWrapper which is its own wrapped item.
Definition:
AssetWrapperPanel.h:113
CRERandomMapPanel::updateItem
virtual void updateItem() override
Called when myItem was updated.
Definition:
RandomMapPanel.cpp:28
CRERandomMapPanel::myInformation
QTextEdit * myInformation
Definition:
RandomMapPanel.h:33
crossfire-crossfire-server
utils
cre
random_maps
RandomMapPanel.cpp
Generated on Mon Sep 1 2025 00:41:08 for Crossfire Resources Editor by
1.8.17