forked from Kolyah35/minecraft-pe-0.6.1
pragma once everywhere
This commit is contained in:
@@ -1,73 +1,71 @@
|
||||
#ifndef NET_MINECRAFT_CLIENT_GUI_SCREENS_TOUCH__TouchIngameBlockSelectionScreen_H__
|
||||
#define NET_MINECRAFT_CLIENT_GUI_SCREENS_TOUCH__TouchIngameBlockSelectionScreen_H__
|
||||
|
||||
#include "../../Screen.h"
|
||||
#include "../../components/InventoryPane.h"
|
||||
#include "../../components/Button.h"
|
||||
#include "../../components/ScrollingPane.h"
|
||||
#include "../../components/ItemPane.h"
|
||||
#include "../../TweenData.h"
|
||||
#include "../../../player/input/touchscreen/TouchAreaModel.h"
|
||||
#include "../../../../AppPlatform.h"
|
||||
|
||||
namespace Touch {
|
||||
|
||||
class IngameBlockSelectionScreen : public Screen,
|
||||
public IInventoryPaneCallback
|
||||
{
|
||||
typedef Screen super;
|
||||
|
||||
public:
|
||||
IngameBlockSelectionScreen();
|
||||
virtual ~IngameBlockSelectionScreen();
|
||||
|
||||
virtual void init() override;
|
||||
virtual void setupPositions() override;
|
||||
virtual void removed() override;
|
||||
|
||||
void tick() override;
|
||||
void render(int xm, int ym, float a) override;
|
||||
|
||||
bool hasClippingArea(IntRectangle& out) override;
|
||||
|
||||
// IInventoryPaneCallback
|
||||
bool addItem(const InventoryPane* pane, int itemId) override;
|
||||
bool isAllowed(int slot) override;
|
||||
std::vector<const ItemInstance*> getItems(const InventoryPane* forPane) override;
|
||||
|
||||
void buttonClicked(Button* button) override;
|
||||
protected:
|
||||
virtual void mouseClicked(int x, int y, int buttonNum) override;
|
||||
virtual void mouseReleased(int x, int y, int buttonNum) override;
|
||||
|
||||
// also support wheel scrolling
|
||||
virtual void mouseWheel(int dx, int dy, int xm, int ym) override;
|
||||
private:
|
||||
void renderDemoOverlay();
|
||||
|
||||
//int getLinearSlotId(int x, int y);
|
||||
int getSlotPosX(int slotX);
|
||||
int getSlotPosY(int slotY);
|
||||
int getSlotHeight();
|
||||
|
||||
private:
|
||||
int selectedItem;
|
||||
bool _pendingClose;
|
||||
InventoryPane* _blockList;
|
||||
|
||||
THeader bHeader;
|
||||
ImageButton bDone;
|
||||
TButton bCraft;
|
||||
TButton bArmor;
|
||||
TButton bMenu;
|
||||
|
||||
IntRectangle clippingArea;
|
||||
|
||||
int InventoryRows;
|
||||
int InventorySize;
|
||||
int InventoryColumns;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /*NET_MINECRAFT_CLIENT_GUI_SCREENS_TOUCH__TouchIngameBlockSelectionScreen_H__*/
|
||||
#pragma once
|
||||
|
||||
#include "../../Screen.h"
|
||||
#include "../../components/InventoryPane.h"
|
||||
#include "../../components/Button.h"
|
||||
#include "../../components/ScrollingPane.h"
|
||||
#include "../../components/ItemPane.h"
|
||||
#include "../../TweenData.h"
|
||||
#include "../../../player/input/touchscreen/TouchAreaModel.h"
|
||||
#include "../../../../AppPlatform.h"
|
||||
|
||||
namespace Touch {
|
||||
|
||||
class IngameBlockSelectionScreen : public Screen,
|
||||
public IInventoryPaneCallback
|
||||
{
|
||||
typedef Screen super;
|
||||
|
||||
public:
|
||||
IngameBlockSelectionScreen();
|
||||
virtual ~IngameBlockSelectionScreen();
|
||||
|
||||
virtual void init() override;
|
||||
virtual void setupPositions() override;
|
||||
virtual void removed() override;
|
||||
|
||||
void tick() override;
|
||||
void render(int xm, int ym, float a) override;
|
||||
|
||||
bool hasClippingArea(IntRectangle& out) override;
|
||||
|
||||
// IInventoryPaneCallback
|
||||
bool addItem(const InventoryPane* pane, int itemId) override;
|
||||
bool isAllowed(int slot) override;
|
||||
std::vector<const ItemInstance*> getItems(const InventoryPane* forPane) override;
|
||||
|
||||
void buttonClicked(Button* button) override;
|
||||
protected:
|
||||
virtual void mouseClicked(int x, int y, int buttonNum) override;
|
||||
virtual void mouseReleased(int x, int y, int buttonNum) override;
|
||||
|
||||
// also support wheel scrolling
|
||||
virtual void mouseWheel(int dx, int dy, int xm, int ym) override;
|
||||
private:
|
||||
void renderDemoOverlay();
|
||||
|
||||
//int getLinearSlotId(int x, int y);
|
||||
int getSlotPosX(int slotX);
|
||||
int getSlotPosY(int slotY);
|
||||
int getSlotHeight();
|
||||
|
||||
private:
|
||||
int selectedItem;
|
||||
bool _pendingClose;
|
||||
InventoryPane* _blockList;
|
||||
|
||||
THeader bHeader;
|
||||
ImageButton bDone;
|
||||
TButton bCraft;
|
||||
TButton bArmor;
|
||||
TButton bMenu;
|
||||
|
||||
IntRectangle clippingArea;
|
||||
|
||||
int InventoryRows;
|
||||
int InventorySize;
|
||||
int InventoryColumns;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,74 +1,72 @@
|
||||
#ifndef NET_MINECRAFT_CLIENT_GUI_SCREENS_TOUCH__TouchJoinGameScreen_H__
|
||||
#define NET_MINECRAFT_CLIENT_GUI_SCREENS_TOUCH__TouchJoinGameScreen_H__
|
||||
|
||||
#include "../../Screen.h"
|
||||
#include "../../components/Button.h"
|
||||
#include "../../components/RolledSelectionListV.h"
|
||||
#include "../../../Minecraft.h"
|
||||
#include "../../../../platform/input/Multitouch.h"
|
||||
#include "../../../../network/RakNetInstance.h"
|
||||
|
||||
namespace Touch {
|
||||
|
||||
class JoinGameScreen;
|
||||
|
||||
class AvailableGamesList : public RolledSelectionListV
|
||||
{
|
||||
int startSelected;
|
||||
int selectedItem;
|
||||
ServerList copiedServerList;
|
||||
|
||||
friend class JoinGameScreen;
|
||||
|
||||
public:
|
||||
AvailableGamesList(Minecraft* _minecraft, int _width, int _height)
|
||||
: RolledSelectionListV(_minecraft, _width, _height, 0, _width, 24, _height, 34),
|
||||
selectedItem(-1),
|
||||
startSelected(-1)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
virtual int getNumberOfItems() { return (int)copiedServerList.size(); }
|
||||
|
||||
virtual void selectCancel();
|
||||
virtual void selectStart(int item);
|
||||
virtual void selectItem(int item, bool doubleClick);
|
||||
|
||||
virtual bool isSelectedItem(int item) { return item == selectedItem; }
|
||||
|
||||
virtual void renderBackground() {}
|
||||
virtual void renderItem(int i, int x, int y, int h, Tesselator& t);
|
||||
};
|
||||
|
||||
class JoinGameScreen: public Screen
|
||||
{
|
||||
public:
|
||||
JoinGameScreen();
|
||||
virtual ~JoinGameScreen();
|
||||
|
||||
void init();
|
||||
void setupPositions();
|
||||
|
||||
virtual bool handleBackEvent(bool isDown);
|
||||
|
||||
virtual bool isIndexValid(int index);
|
||||
|
||||
virtual void tick();
|
||||
void render(int xm, int ym, float a);
|
||||
|
||||
void buttonClicked(Button* button);
|
||||
|
||||
bool isInGameScreen();
|
||||
private:
|
||||
Button bJoin;
|
||||
TButton bBack;
|
||||
TButton bJoinByIp;
|
||||
THeader bHeader;
|
||||
AvailableGamesList* gamesList;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_CLIENT_GUI_SCREENS_TOUCH__TouchJoinGameScreen_H__*/
|
||||
#pragma once
|
||||
|
||||
#include "../../Screen.h"
|
||||
#include "../../components/Button.h"
|
||||
#include "../../components/RolledSelectionListV.h"
|
||||
#include "../../../Minecraft.h"
|
||||
#include "../../../../platform/input/Multitouch.h"
|
||||
#include "../../../../network/RakNetInstance.h"
|
||||
|
||||
namespace Touch {
|
||||
|
||||
class JoinGameScreen;
|
||||
|
||||
class AvailableGamesList : public RolledSelectionListV
|
||||
{
|
||||
int startSelected;
|
||||
int selectedItem;
|
||||
ServerList copiedServerList;
|
||||
|
||||
friend class JoinGameScreen;
|
||||
|
||||
public:
|
||||
AvailableGamesList(Minecraft* _minecraft, int _width, int _height)
|
||||
: RolledSelectionListV(_minecraft, _width, _height, 0, _width, 24, _height, 34),
|
||||
selectedItem(-1),
|
||||
startSelected(-1)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
virtual int getNumberOfItems() { return (int)copiedServerList.size(); }
|
||||
|
||||
virtual void selectCancel();
|
||||
virtual void selectStart(int item);
|
||||
virtual void selectItem(int item, bool doubleClick);
|
||||
|
||||
virtual bool isSelectedItem(int item) { return item == selectedItem; }
|
||||
|
||||
virtual void renderBackground() {}
|
||||
virtual void renderItem(int i, int x, int y, int h, Tesselator& t);
|
||||
};
|
||||
|
||||
class JoinGameScreen: public Screen
|
||||
{
|
||||
public:
|
||||
JoinGameScreen();
|
||||
virtual ~JoinGameScreen();
|
||||
|
||||
void init();
|
||||
void setupPositions();
|
||||
|
||||
virtual bool handleBackEvent(bool isDown);
|
||||
|
||||
virtual bool isIndexValid(int index);
|
||||
|
||||
virtual void tick();
|
||||
void render(int xm, int ym, float a);
|
||||
|
||||
void buttonClicked(Button* button);
|
||||
|
||||
bool isInGameScreen();
|
||||
private:
|
||||
Button bJoin;
|
||||
TButton bBack;
|
||||
TButton bJoinByIp;
|
||||
THeader bHeader;
|
||||
AvailableGamesList* gamesList;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,122 +1,120 @@
|
||||
#ifndef NET_MINECRAFT_CLIENT_GUI_SCREENS_TOUCH__TouchSelectWorldScreen_H__
|
||||
#define NET_MINECRAFT_CLIENT_GUI_SCREENS_TOUCH__TouchSelectWorldScreen_H__
|
||||
|
||||
#include "../ConfirmScreen.h"
|
||||
#include "../../Screen.h"
|
||||
#include "../../TweenData.h"
|
||||
#include "../../components/ImageButton.h"
|
||||
#include "../../components/Button.h"
|
||||
#include "../../components/RolledSelectionListH.h"
|
||||
#include "../../../Minecraft.h"
|
||||
#include "../../../../world/level/storage/LevelStorageSource.h"
|
||||
|
||||
|
||||
namespace Touch {
|
||||
|
||||
class SelectWorldScreen;
|
||||
|
||||
//
|
||||
// Scrolling World selection list
|
||||
//
|
||||
class TouchWorldSelectionList : public RolledSelectionListH
|
||||
{
|
||||
public:
|
||||
TouchWorldSelectionList(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();
|
||||
|
||||
virtual void selectStart(int item, int localX, int localY);
|
||||
virtual void selectCancel();
|
||||
private:
|
||||
TweenData td;
|
||||
void tweenInited();
|
||||
|
||||
int selectedItem;
|
||||
bool _newWorldSelected; // Is the PLUS button pressed?
|
||||
int _height;
|
||||
LevelSummaryList levels;
|
||||
std::vector<StringVector> _descriptions;
|
||||
StringVector _imageNames;
|
||||
|
||||
bool hasPickedLevel;
|
||||
LevelSummary pickedLevel;
|
||||
int pickedIndex;
|
||||
|
||||
int stoppedTick;
|
||||
int currentTick;
|
||||
float accRatio;
|
||||
int mode;
|
||||
|
||||
friend class SelectWorldScreen;
|
||||
};
|
||||
|
||||
//
|
||||
// Delete World screen
|
||||
//
|
||||
class TouchDeleteWorldScreen: public ConfirmScreen
|
||||
{
|
||||
public:
|
||||
TouchDeleteWorldScreen(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() override;
|
||||
virtual void setupPositions() override;
|
||||
|
||||
virtual void tick() override;
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
|
||||
virtual bool isIndexValid(int index);
|
||||
virtual bool handleBackEvent(bool isDown) override;
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
virtual void keyPressed(int eventKey) override;
|
||||
|
||||
// support for mouse wheel when desktop code uses touch variant
|
||||
virtual void mouseWheel(int dx, int dy, int xm, int ym) override;
|
||||
|
||||
bool isInGameScreen() override;
|
||||
private:
|
||||
void loadLevelSource();
|
||||
std::string getUniqueLevelName(const std::string& level);
|
||||
|
||||
ImageButton bDelete;
|
||||
TButton bCreate;
|
||||
THeader bHeader;
|
||||
TButton bBack;
|
||||
Button bWorldView;
|
||||
TouchWorldSelectionList* worldsList;
|
||||
LevelSummaryList levels;
|
||||
|
||||
bool _mouseHasBeenUp;
|
||||
bool _hasStartedLevel;
|
||||
//LevelStorageSource* levels;
|
||||
};
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_CLIENT_GUI_SCREENS_TOUCH__TouchSelectWorldScreen_H__*/
|
||||
#pragma once
|
||||
|
||||
#include "../ConfirmScreen.h"
|
||||
#include "../../Screen.h"
|
||||
#include "../../TweenData.h"
|
||||
#include "../../components/ImageButton.h"
|
||||
#include "../../components/Button.h"
|
||||
#include "../../components/RolledSelectionListH.h"
|
||||
#include "../../../Minecraft.h"
|
||||
#include "../../../../world/level/storage/LevelStorageSource.h"
|
||||
|
||||
|
||||
namespace Touch {
|
||||
|
||||
class SelectWorldScreen;
|
||||
|
||||
//
|
||||
// Scrolling World selection list
|
||||
//
|
||||
class TouchWorldSelectionList : public RolledSelectionListH
|
||||
{
|
||||
public:
|
||||
TouchWorldSelectionList(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();
|
||||
|
||||
virtual void selectStart(int item, int localX, int localY);
|
||||
virtual void selectCancel();
|
||||
private:
|
||||
TweenData td;
|
||||
void tweenInited();
|
||||
|
||||
int selectedItem;
|
||||
bool _newWorldSelected; // Is the PLUS button pressed?
|
||||
int _height;
|
||||
LevelSummaryList levels;
|
||||
std::vector<StringVector> _descriptions;
|
||||
StringVector _imageNames;
|
||||
|
||||
bool hasPickedLevel;
|
||||
LevelSummary pickedLevel;
|
||||
int pickedIndex;
|
||||
|
||||
int stoppedTick;
|
||||
int currentTick;
|
||||
float accRatio;
|
||||
int mode;
|
||||
|
||||
friend class SelectWorldScreen;
|
||||
};
|
||||
|
||||
//
|
||||
// Delete World screen
|
||||
//
|
||||
class TouchDeleteWorldScreen: public ConfirmScreen
|
||||
{
|
||||
public:
|
||||
TouchDeleteWorldScreen(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() override;
|
||||
virtual void setupPositions() override;
|
||||
|
||||
virtual void tick() override;
|
||||
virtual void render(int xm, int ym, float a) override;
|
||||
|
||||
virtual bool isIndexValid(int index);
|
||||
virtual bool handleBackEvent(bool isDown) override;
|
||||
virtual void buttonClicked(Button* button) override;
|
||||
virtual void keyPressed(int eventKey) override;
|
||||
|
||||
// support for mouse wheel when desktop code uses touch variant
|
||||
virtual void mouseWheel(int dx, int dy, int xm, int ym) override;
|
||||
|
||||
bool isInGameScreen() override;
|
||||
private:
|
||||
void loadLevelSource();
|
||||
std::string getUniqueLevelName(const std::string& level);
|
||||
|
||||
ImageButton bDelete;
|
||||
TButton bCreate;
|
||||
THeader bHeader;
|
||||
TButton bBack;
|
||||
Button bWorldView;
|
||||
TouchWorldSelectionList* worldsList;
|
||||
LevelSummaryList levels;
|
||||
|
||||
bool _mouseHasBeenUp;
|
||||
bool _hasStartedLevel;
|
||||
//LevelStorageSource* levels;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,43 +1,41 @@
|
||||
#ifndef NET_MINECRAFT_CLIENT_GUI_SCREENS_TOUCH__TouchStartMenuScreen_H__
|
||||
#define NET_MINECRAFT_CLIENT_GUI_SCREENS_TOUCH__TouchStartMenuScreen_H__
|
||||
|
||||
#include "../../Screen.h"
|
||||
#include "../../components/LargeImageButton.h"
|
||||
#include "../../components/ImageButton.h"
|
||||
#include "../../components/TextBox.h"
|
||||
|
||||
namespace Touch {
|
||||
|
||||
class StartMenuScreen: public Screen
|
||||
{
|
||||
public:
|
||||
StartMenuScreen();
|
||||
virtual ~StartMenuScreen();
|
||||
|
||||
void init();
|
||||
void setupPositions();
|
||||
|
||||
void render(int xm, int ym, float a);
|
||||
|
||||
void buttonClicked(Button* button);
|
||||
virtual void mouseClicked(int x, int y, int buttonNum);
|
||||
bool handleBackEvent(bool isDown);
|
||||
bool isInGameScreen();
|
||||
private:
|
||||
|
||||
LargeImageButton bHost;
|
||||
LargeImageButton bJoin;
|
||||
LargeImageButton bOptions;
|
||||
ImageButton bQuit; // X close icon
|
||||
|
||||
std::string copyright;
|
||||
int copyrightPosX;
|
||||
|
||||
std::string version;
|
||||
int versionPosX;
|
||||
|
||||
std::string username;
|
||||
};
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_CLIENT_GUI_SCREENS_TOUCH__TouchStartMenuScreen_H__*/
|
||||
#pragma once
|
||||
|
||||
#include "../../Screen.h"
|
||||
#include "../../components/LargeImageButton.h"
|
||||
#include "../../components/ImageButton.h"
|
||||
#include "../../components/TextBox.h"
|
||||
|
||||
namespace Touch {
|
||||
|
||||
class StartMenuScreen: public Screen
|
||||
{
|
||||
public:
|
||||
StartMenuScreen();
|
||||
virtual ~StartMenuScreen();
|
||||
|
||||
void init();
|
||||
void setupPositions();
|
||||
|
||||
void render(int xm, int ym, float a);
|
||||
|
||||
void buttonClicked(Button* button);
|
||||
virtual void mouseClicked(int x, int y, int buttonNum);
|
||||
bool handleBackEvent(bool isDown);
|
||||
bool isInGameScreen();
|
||||
private:
|
||||
|
||||
LargeImageButton bHost;
|
||||
LargeImageButton bJoin;
|
||||
LargeImageButton bOptions;
|
||||
ImageButton bQuit; // X close icon
|
||||
|
||||
std::string copyright;
|
||||
int copyrightPosX;
|
||||
|
||||
std::string version;
|
||||
int versionPosX;
|
||||
|
||||
std::string username;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user