Crossfire Server, Trunk
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 
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 
29 {
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
Definition: AssetWrapperPanel.h:126
RandomMap.h
CRERandomMapPanel::mySource
QLabel * mySource
Definition: RandomMapPanel.h:32
stringbuffer_finish
char * stringbuffer_finish(StringBuffer *sb)
Definition: stringbuffer.cpp:76
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
guild_entry.text
text
Definition: guild_entry.py:41
AssetSWrapperPanel
Definition: AssetWrapperPanel.h:113
StringBuffer
Definition: stringbuffer.cpp:25
CRERandomMapPanel::updateItem
virtual void updateItem() override
Definition: RandomMapPanel.cpp:28
CRERandomMapPanel::myInformation
QTextEdit * myInformation
Definition: RandomMapPanel.h:33
write_map_parameters_to_string
StringBuffer * write_map_parameters_to_string(const RMParms *RP)
Definition: random_map.cpp:749