aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/SelectWorldScreen.h
blob: e2773f26b4c0b4f0e07fbb24011015298f36e643 (plain)
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
68
69
70
71
72
73
74
#pragma once
#include "Screen.h"
#include "ScrolledSelectionList.h"
class LevelSummary;
class Button;
class Tesselator;


class SelectWorldScreen : public Screen
{
public:
	class WorldSelectionList;

protected:
	static const int BUTTON_CANCEL_ID = 0;
    static const int BUTTON_SELECT_ID = 1;
    static const int BUTTON_DELETE_ID = 2;
    static const int BUTTON_CREATE_ID = 3;
    static const int BUTTON_UP_ID = 4;
    static const int BUTTON_DOWN_ID = 5;
    static const int BUTTON_RENAME_ID = 6;

private:
//	final DateFormat DATE_FORMAT = new SimpleDateFormat();		// 4J - removed

protected:
	Screen *lastScreen;
    wstring title;
private:
	bool done;
    int selectedWorld;
    vector<LevelSummary *> *levelList;
    WorldSelectionList *worldSelectionList;
    wstring worldLang;
    wstring conversionLang;
    bool isDeleting;

	Button *deleteButton;
	Button *selectButton;
	Button *renameButton;

public:
	SelectWorldScreen(Screen *lastScreen);
    virtual void init();
private:
	void loadLevelList();
protected:
	wstring getWorldId(int id);
    wstring getWorldName(int id);
public:
	virtual void postInit();

protected:
	virtual void buttonClicked(Button *button);
public:
	void worldSelected(int id);
    void confirmResult(bool result, int id);
    virtual void render(int xm, int ym, float a);

    class WorldSelectionList : public ScrolledSelectionList
	{
	public:
		SelectWorldScreen *parent;
		// 4J - had to add input parameters to ctor, original is a java subclass of the screen and can access its members
		WorldSelectionList(SelectWorldScreen *sws);
	protected:
		virtual int getNumberOfItems();
        virtual void selectItem(int item, bool doubleClick);
        virtual bool isSelectedItem(int item);
        virtual int getMaxPosition();
        virtual void renderBackground();
        virtual void renderItem(int i, int x, int y, int h, Tesselator *t);
    };
};