mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-19 22:43:32 +00:00
113 lines
2.5 KiB
C++
Executable File
113 lines
2.5 KiB
C++
Executable File
#ifndef NET_MINECRAFT_CLIENT_GUI_SCREENS__SelectWorldScreen_H__
|
|
#define NET_MINECRAFT_CLIENT_GUI_SCREENS__SelectWorldScreen_H__
|
|
|
|
#include "../Screen.h"
|
|
#include "../TweenData.h"
|
|
#include "../components/Button.h"
|
|
#include "../components/RolledSelectionListH.h"
|
|
#include "../../Minecraft.h"
|
|
#include "../../../world/level/storage/LevelStorageSource.h"
|
|
|
|
|
|
class SelectWorldScreen;
|
|
|
|
//
|
|
// Scrolling World selection list
|
|
//
|
|
class WorldSelectionList : public RolledSelectionListH
|
|
{
|
|
public:
|
|
WorldSelectionList(Minecraft* _minecraft, int _width, int _height);
|
|
virtual void tick();
|
|
void stepLeft();
|
|
void stepRight();
|
|
|
|
void commit();
|
|
protected:
|
|
virtual int getNumberOfItems();
|
|
virtual void selectItem(int item, bool doubleClick);
|
|
virtual bool isSelectedItem(int item);
|
|
|
|
virtual void renderBackground() {}
|
|
virtual void renderItem(int i, int x, int y, int h, Tesselator& t);
|
|
virtual float getPos(float alpha);
|
|
virtual void touched() { mode = 0; }
|
|
virtual bool capXPosition();
|
|
private:
|
|
TweenData td;
|
|
void tweenInited();
|
|
|
|
int selectedItem;
|
|
int _height;
|
|
LevelSummaryList levels;
|
|
std::vector<StringVector> _descriptions;
|
|
StringVector _imageNames;
|
|
|
|
bool hasPickedLevel;
|
|
LevelSummary pickedLevel;
|
|
|
|
int stoppedTick;
|
|
int currentTick;
|
|
float accRatio;
|
|
int mode;
|
|
|
|
friend class SelectWorldScreen;
|
|
};
|
|
|
|
//
|
|
// Delete World screen
|
|
//
|
|
#include "ConfirmScreen.h"
|
|
class DeleteWorldScreen: public ConfirmScreen
|
|
{
|
|
public:
|
|
DeleteWorldScreen(const LevelSummary& levelId);
|
|
protected:
|
|
virtual void postResult(bool isOk);
|
|
private:
|
|
LevelSummary _level;
|
|
};
|
|
|
|
|
|
//
|
|
// Select world screen
|
|
//
|
|
class SelectWorldScreen: public Screen
|
|
{
|
|
public:
|
|
SelectWorldScreen();
|
|
virtual ~SelectWorldScreen();
|
|
|
|
virtual void init();
|
|
virtual void setupPositions();
|
|
virtual void tick();
|
|
|
|
virtual bool isIndexValid(int index);
|
|
virtual bool handleBackEvent(bool isDown);
|
|
virtual void buttonClicked(Button* button);
|
|
virtual void keyPressed(int eventKey);
|
|
|
|
void render(int xm, int ym, float a);
|
|
|
|
// mouse wheel scroll (new in desktop implementation)
|
|
virtual void mouseWheel(int dx, int dy, int xm, int ym);
|
|
|
|
bool isInGameScreen();
|
|
private:
|
|
void loadLevelSource();
|
|
std::string getUniqueLevelName(const std::string& level);
|
|
|
|
Button bDelete;
|
|
Button bCreate;
|
|
Button bBack;
|
|
Button bWorldView;
|
|
WorldSelectionList* worldsList;
|
|
LevelSummaryList levels;
|
|
|
|
bool _mouseHasBeenUp;
|
|
bool _hasStartedLevel;
|
|
//LevelStorageSource* levels;
|
|
};
|
|
|
|
#endif /*NET_MINECRAFT_CLIENT_GUI_SCREENS__SelectWorldScreen_H__*/
|