summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser/MainWindow.h
blob: 997d7a5d23e94a2c0959fe046fafa4f92a85bd7e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once

#include <QList>
#include <QMainWindow>
#include "BiomeView.h"





class MainWindow :
	public QMainWindow
{
	Q_OBJECT

	BiomeView * m_BiomeView;

public:
	MainWindow(QWidget *parent = 0);
	~MainWindow();

private slots:
	/** Opens a generator definition and generates the biomes based on that. */
	void generate();

	/** Opens an existing world and displays the loaded biomes. */
	void open();

	/** Opens a vanilla world that is specified by the calling action. */
	void openVanillaWorld();

protected:
	// Actions:
	QAction * m_actGen;
	QAction * m_actOpen;
	QAction * m_actReload;
	QAction * m_actExit;

	/** List of actions that open the specific vanilla world. */
	QList<QAction *> m_WorldActions;

	/** Path to the vanilla folder. */
	QString m_MinecraftPath;


	/** Initializes the m_MinecraftPath based on the proper MC path */
	void initMinecraftPath();

	/** Creates the actions that the UI supports. */
	void createActions();

	/** Creates the actions that open a specific vanilla world. Iterates over the minecraft saves folder. */
	void createWorldActions();

	/** Creates the menu bar and connects its events. */
	void createMenus();

	/** Returns the name of the vanilla world in the specified path.
	Reads the level.dat file for the name. Returns an empty string on failure. */
	QString getWorldName(const AString & a_Path);
};