forked from Kolyah35/minecraft-pe-0.6.1
FIX: grass color | small improvements
This commit is contained in:
@@ -516,7 +516,7 @@ void Minecraft::tick(int nTick, int maxTick) {
|
||||
if (missTime > 0) missTime--;
|
||||
#ifndef STANDALONE_SERVER
|
||||
if (!screen && player) {
|
||||
if (player->health <= 0) {
|
||||
if (player->hasDied()) {
|
||||
setScreen(new DeathScreen());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,22 +204,23 @@ void ScrollingPane::render( int xm, int ym, float alpha ) {
|
||||
|
||||
const float bxx = bbox.x - (fpx /*+ dx*alpha*/) + (nw.xf - nw.x);
|
||||
const float byy = bbox.y - (fpy /*+ dy*alpha*/) + (nw.yf - nw.y);
|
||||
for (int y = nw.y; y <= se.y; ++y)
|
||||
for (int x = nw.x; x <= se.x; ++x) {
|
||||
int id = y * columns + x;
|
||||
if (y <0 || id < 0 || id >= numItems) continue; // @todo: break rather
|
||||
if (isNotSet(SF_WrapX) && (x < 0 || x >= columns)) continue; // @todo: break rather
|
||||
GridItem item; //@todo: v- Does not support SF_Wrapping
|
||||
item.id = id;
|
||||
item.xf = bxx + x * itemBbox.w;
|
||||
item.yf = byy + y * itemBbox.h;
|
||||
item.x = (int)item.xf;
|
||||
item.y = (int)item.yf;
|
||||
//LOGI("i: %d (%.1f, %.1f)\t", id, item.xf, item.yf);
|
||||
if (isSet(SF_MultiSelect)) item.selected = selected[id];
|
||||
else item.selected = (id == selectedId);
|
||||
for (int y = nw.y; y <= se.y; ++y) {
|
||||
for (int x = nw.x; x <= se.x; ++x) {
|
||||
int id = y * columns + x;
|
||||
if (y <0 || id < 0 || id >= numItems) continue; // @todo: break rather
|
||||
if (isNotSet(SF_WrapX) && (x < 0 || x >= columns)) continue; // @todo: break rather
|
||||
GridItem item; //@todo: v- Does not support SF_Wrapping
|
||||
item.id = id;
|
||||
item.xf = bxx + x * itemBbox.w;
|
||||
item.yf = byy + y * itemBbox.h;
|
||||
item.x = (int)item.xf;
|
||||
item.y = (int)item.yf;
|
||||
//LOGI("i: %d (%.1f, %.1f)\t", id, item.xf, item.yf);
|
||||
if (isSet(SF_MultiSelect)) item.selected = selected[id];
|
||||
else item.selected = (id == selectedId);
|
||||
|
||||
itemsToRender.push_back(item);
|
||||
itemsToRender.push_back(item);
|
||||
}
|
||||
}
|
||||
renderBatch(itemsToRender, alpha);
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ void DeathScreen::render( int xm, int ym, float a )
|
||||
if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) == 2){
|
||||
glPushMatrix2();
|
||||
glScalef2(2, 2, 2);
|
||||
drawCenteredString(font, "Game over!", width / 2 / 2, height / 8, 0xffffff);
|
||||
drawCenteredString(font, I18n::get("deathScreen.title.hardcore"), width / 4, height / 8, 0xffffff);
|
||||
glPopMatrix2();
|
||||
std::stringstream ss;
|
||||
ss << "Score: &e" << minecraft->player->getScore();
|
||||
@@ -80,7 +80,7 @@ if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) == 2){
|
||||
} else {
|
||||
glPushMatrix2();
|
||||
glScalef2(2, 2, 2);
|
||||
drawCenteredString(font, "You died!", width / 2 / 2, height / 8, 0xffffff);
|
||||
drawCenteredString(font, I18n::get("deathScreen.title"), width / 4, height / 8, 0xffffff);
|
||||
glPopMatrix2();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,13 +8,14 @@
|
||||
#include "../../../platform/time.h"
|
||||
#include "../../../platform/input/Keyboard.h"
|
||||
#include "../../../platform/log.h"
|
||||
#include <locale/I18n.h>
|
||||
|
||||
SimpleChooseLevelScreen::SimpleChooseLevelScreen(const std::string& levelName)
|
||||
: bHeader(0),
|
||||
bGamemode(0),
|
||||
bCheats(0),
|
||||
bBack(0),
|
||||
bCreate(0),
|
||||
: bHeader(nullptr),
|
||||
bGamemode(nullptr),
|
||||
bCheats(nullptr),
|
||||
bBack(nullptr),
|
||||
bCreate(nullptr),
|
||||
levelName(levelName),
|
||||
hasChosen(false),
|
||||
gamemode(GameType::Survival),
|
||||
@@ -42,10 +43,10 @@ void SimpleChooseLevelScreen::init()
|
||||
// first") when the name already existed.
|
||||
ChooseLevelScreen::init();
|
||||
|
||||
tLevelName.text = "New world";
|
||||
tLevelName.text = I18n::get("selectWorld.newWorld");
|
||||
|
||||
// header + close button
|
||||
bHeader = new Touch::THeader(0, "Create World");
|
||||
bHeader = new Touch::THeader(0, I18n::get("selectWorld.create"));
|
||||
// create the back/X button as ImageButton like CreditsScreen
|
||||
bBack = new ImageButton(2, "");
|
||||
{
|
||||
@@ -56,14 +57,14 @@ void SimpleChooseLevelScreen::init()
|
||||
def.setSrc(IntRectangle(150, 0, (int)def.width, (int)def.height));
|
||||
bBack->setImageDef(def, true);
|
||||
}
|
||||
if (/* minecraft->useTouchscreen() */ true) {
|
||||
bGamemode = new Touch::TButton(1, "Survival mode");
|
||||
if (minecraft->options.getIntValue(OPTIONS_MENU_STYLE) != 2) {
|
||||
bGamemode = new Touch::TButton(1, I18n::get("selectWorld.gameMode.survival"));
|
||||
bCheats = new Touch::TButton(4, "Cheats: Off");
|
||||
bCreate = new Touch::TButton(3, "Create");
|
||||
bCreate = new Touch::TButton(3, I18n::get("selectWorld.create"));
|
||||
} else {
|
||||
bGamemode = new Button(1, "Survival mode");
|
||||
bGamemode = new Button(1, I18n::get("selectWorld.gameMode.survival"));
|
||||
bCheats = new Button(4, "Cheats: Off");
|
||||
bCreate = new Button(3, "Create");
|
||||
bCreate = new Button(3, I18n::get("Create"));
|
||||
}
|
||||
|
||||
buttons.push_back(bHeader);
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
|
||||
void tick();
|
||||
|
||||
float yBob, xBob; // shredder added from b1.8/4j for the hand swaying animation
|
||||
float yBob, xBob; // shredder added from b1.8/4j for the hand swaying animation
|
||||
float yBobO, xBobO; // shredder added from b1.8/4j for the hand swaying animation
|
||||
|
||||
void move(float xa, float ya, float za);
|
||||
|
||||
@@ -440,7 +440,7 @@ float GameRenderer::getFov(float a, bool applyEffects) {
|
||||
fov *= this->oFov + (this->fov - this->oFov) * a;
|
||||
|
||||
if (player->isUnderLiquid(Material::water)) fov = 60;
|
||||
if (player->health <= 0) {
|
||||
if (player->hasDied()) {
|
||||
float duration = player->deathTime + a;
|
||||
|
||||
fov /= ((1 - 500 / (duration + 500)) * 2.0f + 1);
|
||||
@@ -537,7 +537,7 @@ void GameRenderer::bobHurt(float a) {
|
||||
|
||||
float hurt = player->hurtTime - a;
|
||||
|
||||
if (player->health <= 0) {
|
||||
if (player->hasDied()) {
|
||||
float duration = player->deathTime + a;
|
||||
glRotatef2(40 - (40 * 200) / (duration + 200), 0, 0, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user