mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-22 07:53:30 +00:00
idk???
This commit is contained in:
@@ -879,6 +879,13 @@ void Minecraft::tickInput() {
|
|||||||
if (!bai.isRemoveContinue())
|
if (!bai.isRemoveContinue())
|
||||||
handleBuildAction(&bai);
|
handleBuildAction(&bai);
|
||||||
}
|
}
|
||||||
|
#ifdef __ANDROID__
|
||||||
|
bool isTryingToDestroyBlock = (options.useMouseForDigging
|
||||||
|
? (Mouse::isButtonDown(MouseAction::ACTION_LEFT) && mouseDiggable)
|
||||||
|
: Keyboard::isKeyDown(options.keyDestroy.key))
|
||||||
|
|| (buildHandled && bai.isRemove());
|
||||||
|
handleMouseDown(MouseAction::ACTION_LEFT, isTryingToDestroyBlock || (buildHandled && bai.isInteract()));
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
// Desktop: left mouse = destroy/attack
|
// Desktop: left mouse = destroy/attack
|
||||||
if (Mouse::isButtonDown(MouseAction::ACTION_LEFT)) {
|
if (Mouse::isButtonDown(MouseAction::ACTION_LEFT)) {
|
||||||
@@ -921,6 +928,32 @@ void Minecraft::tickInput() {
|
|||||||
TIMER_POP();
|
TIMER_POP();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
void Minecraft::handleMouseDown(int button, bool down) {
|
||||||
|
#ifndef STANDALONE_SERVER
|
||||||
|
#ifndef RPI
|
||||||
|
if(player->isUsingItem()) {
|
||||||
|
if(!down && !Keyboard::isKeyDown(options.keyUse.key)) {
|
||||||
|
gameMode->releaseUsingItem(player);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if(player->isSleeping()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (button == MouseAction::ACTION_LEFT && missTime > 0) return;
|
||||||
|
if (down && hitResult.type == TILE && button == MouseAction::ACTION_LEFT && !hitResult.indirectHit) {
|
||||||
|
int x = hitResult.x;
|
||||||
|
int y = hitResult.y;
|
||||||
|
int z = hitResult.z;
|
||||||
|
gameMode->continueDestroyBlock(x, y, z, hitResult.f);
|
||||||
|
particleEngine->crack(x, y, z, hitResult.f);
|
||||||
|
player->swing();
|
||||||
|
} else {
|
||||||
|
gameMode->stopDestroyBlock();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void Minecraft::handleBuildAction(BuildActionIntention* action) {
|
void Minecraft::handleBuildAction(BuildActionIntention* action) {
|
||||||
#ifndef STANDALONE_SERVER
|
#ifndef STANDALONE_SERVER
|
||||||
|
|||||||
@@ -109,6 +109,8 @@ public:
|
|||||||
|
|
||||||
bool isLevelGenerated();
|
bool isLevelGenerated();
|
||||||
|
|
||||||
|
void handleMouseDown(int button, bool down);
|
||||||
|
|
||||||
void audioEngineOn();
|
void audioEngineOn();
|
||||||
void audioEngineOff();
|
void audioEngineOff();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user