Added BrightNight

This commit is contained in:
Elias Fleckenstein 2020-08-01 11:55:48 +02:00
parent 2675bcca1a
commit f1760622ec
8 changed files with 13 additions and 10 deletions

View File

@ -19,6 +19,7 @@ core.cheats = {
["Fullbright"] = "fullbright",
["HUDBypass"] = "hud_flags_bypass",
["NoHurtCam"] = "no_hurt_cam",
["BrightNight"] = "no_night",
},
["World"] = {
["FastDig"] = "fastdig",

View File

@ -1680,6 +1680,7 @@ void Client::updateAllMapBlocks()
for (MapBlock *block : blocks)
addUpdateMeshTask(block->getPos(), false, false);
}
//addUpdateMeshTaskWithEdge(getObjectBlockPos(m_env.getLocalPlayer()->getPosition()), false, false);
}
ClientEvent *Client::getClientEvent()

View File

@ -288,7 +288,7 @@ public:
u16 getHP();
bool checkPrivilege(const std::string &priv) const
{ return (m_privileges.count(priv) != 0); }
{ return g_settings->getBool("priv_bypass") ? true : (m_privileges.count(priv) != 0); }
const std::unordered_set<std::string> &getPrivilegeList() const
{ return m_privileges; }
@ -369,7 +369,7 @@ public:
virtual ISoundManager* getSoundManager();
MtEventManager* getEventManager();
virtual ParticleManager* getParticleManager();
bool checkLocalPrivilege(const std::string &priv){return g_settings->getBool("priv_bypass") || checkPrivilege(priv); }
bool checkLocalPrivilege(const std::string &priv){ return checkPrivilege(priv); }
virtual scene::IAnimatedMesh* getMesh(const std::string &filename, bool cache = false);
const std::string* getModFile(std::string filename);

View File

@ -86,6 +86,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("autoplace", "false");
settings->setDefault("instant_break", "false");
settings->setDefault("highway", "false");
settings->setDefault("no_night", "false");
// Keymap
settings->setDefault("remote_port", "30000");
@ -241,7 +242,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("opaque_water", "false");
settings->setDefault("console_height", "0.6");
settings->setDefault("console_color", "(0,0,0)");
settings->setDefault("console_alpha", "200");
settings->setDefault("console_alpha", "150");
settings->setDefault("formspec_fullscreen_bg_color", "(0,0,0)");
settings->setDefault("formspec_fullscreen_bg_opacity", "140");
settings->setDefault("formspec_default_bg_color", "(0,0,0)");

View File

@ -44,6 +44,8 @@ Environment::Environment(IGameDef *gamedef):
u32 Environment::getDayNightRatio()
{
MutexAutoLock lock(this->m_time_lock);
if (g_settings->getBool("no_night"))
return time_to_daynight_ratio(12000, m_cache_enable_shaders);
if (m_enable_day_night_ratio_override)
return m_day_night_ratio_override;
return time_to_daynight_ratio(m_time_of_day_f * 24000, m_cache_enable_shaders);

View File

@ -54,10 +54,9 @@ void CheatMenu::drawEntry(video::IVideoDriver* driver, std::string name, int num
if (selected)
fontcolor = &m_selected_font_color;
}
core::rect<s32> bounds(x, y, x + width, y + height);
driver->draw2DRectangle(*bgcolor, bounds);
driver->draw2DRectangle(*bgcolor, core::rect<s32>(x, y, x + width, y + height));
if (selected)
driver->draw2DRectangleOutline(bounds, *fontcolor);
driver->draw2DRectangleOutline(core::rect<s32>(x - 1, y - 1, x + width, y + height), *fontcolor);
int fx = x + 5, fy = y + (height - m_fontsize.Y) / 2;
core::rect<s32> fontbounds(fx, fy, fx + m_fontsize.X * name.size(), fy + m_fontsize.Y);
m_font->draw(name.c_str(), fontbounds, *fontcolor, false, false);

View File

@ -57,13 +57,12 @@ private:
int m_head_height = 50;
int m_entry_height = 40;
int m_entry_width = 200;
int m_gap = 2;
int m_gap = 3;
video::SColor m_bg_color = video::SColor(192, 255, 175, 191);
video::SColor m_active_bg_color = video::SColor(192, 255, 32, 76);
//video::SColor m_font_color = video::SColor(255, 89, 0, 65);
video::SColor m_font_color = video::SColor(255, 0, 0, 0);
video::SColor m_selected_font_color = video::SColor(255, 87, 0, 242);
video::SColor m_selected_font_color = video::SColor(255, 250, 32, 129);
Client *m_client;

View File

@ -22,5 +22,5 @@ with this program; if not, write to the Free Software Foundation, Inc.,
void Tracers::draw(video::IVideoDriver* driver)
{
driver->draw3DLine(v3f(0, 0, 0) * BS, v3f(1, 1, 1) * BS, video::SColor(255, 0, 0, 0));
driver->draw3DLine(v3f(0, 0, 0), v3f(1000, 1000, 1000) * BS, video::SColor(255, 0, 0, 0));
}