Remove small HUD setting
parent
2d585c6b59
commit
2bc7a6dd4c
|
@ -25,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "util/string.h"
|
||||
|
||||
#ifdef __IOS__
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "SDVersion.h"
|
||||
#endif
|
||||
|
||||
|
@ -173,7 +172,6 @@ void set_default_settings(Settings *settings) {
|
|||
settings->setDefault("desynchronize_mapblock_texture_animation", "true");
|
||||
settings->setDefault("hud_hotbar_max_width", "1.0");
|
||||
settings->setDefault("hud_move_upwards", "0");
|
||||
settings->setDefault("hud_small", "false");
|
||||
settings->setDefault("round_screen", "0");
|
||||
settings->setDefault("enable_local_map_saving", "false");
|
||||
settings->setDefault("show_entity_selectionbox", "false");
|
||||
|
@ -488,23 +486,19 @@ void set_default_settings(Settings *settings) {
|
|||
settings->setDefault("hud_scaling", "0.55");
|
||||
settings->setDefault("font_size", font_size_str_small);
|
||||
settings->setDefault("mouse_sensitivity", "0.3");
|
||||
settings->setDefault("hud_small", "true");
|
||||
} else if (x_inches > 3.7 && x_inches <= 4.5) {
|
||||
// medium phones
|
||||
settings->setDefault("hud_scaling", "0.6");
|
||||
settings->setDefault("font_size", font_size_str_small);
|
||||
settings->setDefault("hud_small", "true");
|
||||
settings->setDefault("selectionbox_width", "6");
|
||||
} else if (x_inches > 4.5 && x_inches <= 5) {
|
||||
} else if (x_inches > 4.5 && x_inches <= 5.5) {
|
||||
// large 6" phones
|
||||
settings->setDefault("hud_scaling", "0.7");
|
||||
settings->setDefault("mouse_sensitivity", "0.15");
|
||||
settings->setDefault("hud_small", "true");
|
||||
settings->setDefault("selectionbox_width", "6");
|
||||
} else if (x_inches > 5 && x_inches <= 6) {
|
||||
} else if (x_inches > 5.5 && x_inches <= 6.5) {
|
||||
// 7" tablets
|
||||
settings->setDefault("hud_scaling", "0.9");
|
||||
settings->setDefault("hud_small", "true");
|
||||
settings->setDefault("selectionbox_width", "6");
|
||||
}
|
||||
#endif // Android
|
||||
|
@ -523,9 +517,6 @@ void set_default_settings(Settings *settings) {
|
|||
NSString *syslang = [[NSLocale preferredLanguages] firstObject];
|
||||
[syslang getBytes:lang maxLength:2 usedLength:nil encoding:NSASCIIStringEncoding options:0 range:NSMakeRange(0, 2) remainingRange:nil];
|
||||
|
||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
|
||||
settings->setDefault("hud_small", "true");
|
||||
|
||||
// Set the size of the elements depending on the screen size
|
||||
if ([SDVersion deviceVersion] == iPhone4S) {
|
||||
// 3.5" iPhone
|
||||
|
|
17
src/game.cpp
17
src/game.cpp
|
@ -1485,7 +1485,6 @@ private:
|
|||
|
||||
u16 m_round_screen;
|
||||
f32 m_hud_scaling;
|
||||
bool m_hud_small;
|
||||
|
||||
bool m_invert_mouse;
|
||||
bool m_first_loop_after_window_activation;
|
||||
|
@ -3863,9 +3862,9 @@ void Game::handlePointingAtNode(const PointedThing &pointed,
|
|||
}
|
||||
|
||||
if ((getRightClicked() ||
|
||||
runData.repeat_rightclick_timer >= m_repeat_right_click_time) &&
|
||||
!digging && runData.noplace_delay_timer <= 0.0 &&
|
||||
client->checkPrivilege("interact")) {
|
||||
runData.repeat_rightclick_timer >= m_repeat_right_click_time) &&
|
||||
!digging && runData.noplace_delay_timer <= 0.0 &&
|
||||
client->checkPrivilege("interact")) {
|
||||
runData.repeat_rightclick_timer = 0;
|
||||
infostream << "Ground right-clicked" << std::endl;
|
||||
|
||||
|
@ -4493,13 +4492,8 @@ void Game::updateGui(const RunStats &stats, f32 dtime, const CameraOrientation &
|
|||
if (!m_statustext.empty()) {
|
||||
s32 status_width = guitext_status->getTextWidth();
|
||||
s32 status_height = guitext_status->getTextHeight();
|
||||
#if defined(__ANDROID__) || defined(__IOS__)
|
||||
s32 status_y = screensize.Y / 1.25;
|
||||
if (m_hud_small)
|
||||
status_y = (screensize.Y) / 1.5;
|
||||
#else
|
||||
s32 status_y = screensize.Y - 150 * m_hud_scaling;
|
||||
#endif
|
||||
s32 status_y = screensize.Y -
|
||||
150 * porting::getDisplayDensity() * m_hud_scaling;
|
||||
s32 status_x = (screensize.X - status_width) / 2;
|
||||
core::rect<s32> rect(
|
||||
status_x, status_y - status_height,
|
||||
|
@ -4618,7 +4612,6 @@ void Game::readSettings()
|
|||
|
||||
m_round_screen = g_settings->getU16("round_screen");
|
||||
m_hud_scaling = g_settings->getFloat("hud_scaling");
|
||||
m_hud_small = g_settings->getBool("hud_small");
|
||||
|
||||
m_cache_cam_smoothing = 0;
|
||||
if (g_settings->getBool("cinematic"))
|
||||
|
|
|
@ -1162,17 +1162,15 @@ void Client::handleCommand_HudSetParam(NetworkPacket* pkt)
|
|||
LocalPlayer *player = m_env.getLocalPlayer();
|
||||
assert(player != NULL);
|
||||
|
||||
bool hud_small = g_settings->getBool("hud_small");
|
||||
|
||||
// if (param == HUD_PARAM_HOTBAR_ITEMCOUNT && value.size() == 4) {
|
||||
// s32 hotbar_itemcount = readS32((u8*) value.c_str());
|
||||
// if (hotbar_itemcount > 0 && hotbar_itemcount <= HUD_HOTBAR_ITEMCOUNT_MAX)
|
||||
|
||||
// Hotbar over 8 does not fit on a small screen
|
||||
player->hud_hotbar_itemcount = hud_small ? 8 : 9;
|
||||
player->hud_hotbar_itemcount = 9;
|
||||
// }
|
||||
// else if (param == HUD_PARAM_HOTBAR_IMAGE) {
|
||||
player->hotbar_image = hud_small ? "gui_hotbar_small.png" : "gui_hotbar.png";
|
||||
player->hotbar_image = "gui_hotbar.png";
|
||||
// }
|
||||
// else if (param == HUD_PARAM_HOTBAR_SELECTED_IMAGE) {
|
||||
player->hotbar_selected_image = "gui_hotbar_selected.png";
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 377 B |
Loading…
Reference in New Issue