mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-17 20:10:23 +03:00
GUI: Fix mobile controls
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
#include "client/options/Options.hpp"
|
||||
|
||||
TouchInputHolder::TouchInputHolder(Minecraft* pMinecraft, Options* pOptions) :
|
||||
m_touchScreenInput(pMinecraft, pOptions),
|
||||
m_touchScreenInput(nullptr),
|
||||
m_unifiedTurnBuild(2, Minecraft::width, Minecraft::height, 200.0f, 1.05f, this),
|
||||
m_pMinecraft(pMinecraft)
|
||||
{
|
||||
@@ -41,7 +41,7 @@ bool TouchInputHolder::allowPicking()
|
||||
|
||||
IMoveInput* TouchInputHolder::getMoveInput()
|
||||
{
|
||||
return &m_touchScreenInput;
|
||||
return m_touchScreenInput;
|
||||
}
|
||||
|
||||
ITurnInput* TouchInputHolder::getTurnInput()
|
||||
@@ -56,8 +56,8 @@ IBuildInput* TouchInputHolder::getBuildInput()
|
||||
|
||||
void TouchInputHolder::setScreenSize(int width, int height)
|
||||
{
|
||||
m_touchScreenInput.setScreenSize(width, height);
|
||||
m_unifiedTurnBuild.field_40 = m_touchScreenInput.getRectangleArea();
|
||||
m_touchScreenInput->setScreenSize(width, height);
|
||||
m_unifiedTurnBuild.field_40 = m_touchScreenInput->getRectangleArea();
|
||||
m_unifiedTurnBuild.field_58 = getRectangleArea(m_pMinecraft->m_pGui, false);
|
||||
m_unifiedTurnBuild.setScreenSize(width, height);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
return m_rectArea;
|
||||
}
|
||||
|
||||
private:
|
||||
protected:
|
||||
Minecraft* m_pMinecraft;
|
||||
Options* m_pOptions;
|
||||
RectangleArea m_rectArea;
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
void setScreenSize(int width, int height) override;
|
||||
|
||||
public:
|
||||
TouchInput m_touchScreenInput;
|
||||
TouchInput *m_touchScreenInput;
|
||||
UnifiedTurnBuild m_unifiedTurnBuild;
|
||||
Minecraft* m_pMinecraft;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user