placement and transfer\r
* only_from_disk might not work anymore - check and fix it.\r
* Check the fixmes in the list above\r
+* FIXME: Sneaking doesn't switch sneak node when moving sideways\r
\r
=== Making it more portable\r
* Some MSVC: std::sto* are defined without a namespace and collide\r
IrrlichtDevice *g_device = NULL;\r
Client *g_client = NULL;\r
\r
+//const s16 quickinv_size = 48;\r
+//const s16 quickinv_spacing = 64;\r
+const s16 quickinv_size = 32;\r
+const s16 quickinv_spacing = 40;\r
+const s16 quickinv_itemcount = 8;\r
+\r
/*\r
GUI Stuff\r
*/\r
frametime_old = frametime;\r
}\r
\r
-class GUIQuickInventory : public IEventReceiver\r
+class GUIQuickInventory\r
{\r
public:\r
GUIQuickInventory(\r
m_itemcount(itemcount),\r
m_inventory(inventory)\r
{\r
- core::rect<s32> imgsize(0,0,48,48);\r
- core::rect<s32> textsize(0,0,48,16);\r
- v2s32 spacing(0, 64);\r
+ core::rect<s32> imgsize(0,0,quickinv_size,quickinv_size);\r
+ core::rect<s32> textsize(0,0,quickinv_size,quickinv_size);\r
for(s32 i=0; i<m_itemcount; i++)\r
{\r
m_images.push_back(env->addImage(\r
- imgsize + pos + spacing*i\r
+ imgsize\r
));\r
m_images[i]->setScaleImage(true);\r
m_texts.push_back(env->addStaticText(\r
L"",\r
- textsize + pos + spacing*i,\r
+ textsize,\r
false, false\r
));\r
- m_texts[i]->setBackgroundColor(\r
- video::SColor(128,0,0,0));\r
+ /*m_texts[i]->setBackgroundColor(\r
+ video::SColor(128,0,0,0));*/\r
m_texts[i]->setTextAlignment(\r
- gui::EGUIA_CENTER,\r
- gui::EGUIA_UPPERLEFT);\r
+ gui::EGUIA_LOWERRIGHT,\r
+ gui::EGUIA_LOWERRIGHT);\r
}\r
+\r
+ updatePosition(pos);\r
}\r
\r
~GUIQuickInventory()\r
}\r
}\r
\r
- virtual bool OnEvent(const SEvent& event)\r
+ void updatePosition(v2s32 pos)\r
{\r
- return false;\r
+ v2s32 spacing(quickinv_spacing, 0);\r
+ for(s32 i=0; i<m_itemcount; i++)\r
+ {\r
+ m_images[i]->setRelativePosition(pos + spacing*i);\r
+ m_texts[i]->setRelativePosition(pos + spacing*i);\r
+ }\r
}\r
\r
void setSelection(s32 i)\r
{\r
s32 start = 0;\r
\r
- start = m_selection - m_itemcount / 2;\r
+ //start = m_selection - m_itemcount / 2;\r
\r
InventoryList *mainlist = m_inventory->getList("main");\r
\r
core::rect<s32>(0,0,0,0),\r
false, false); // Disable word wrap as of now\r
//false, true);\r
- guitext_chat->setBackgroundColor(video::SColor(96,0,0,0));\r
+ //guitext_chat->setBackgroundColor(video::SColor(96,0,0,0));\r
core::list<ChatLine> chat_lines;\r
\r
/*\r
return 1;\r
\r
//video::SColor skycolor = video::SColor(255,90,140,200);\r
- video::SColor skycolor = video::SColor(255,166,202,244);\r
+ //video::SColor skycolor = video::SColor(255,166,202,244);\r
+ video::SColor skycolor = video::SColor(255,120,185,244);\r
\r
camera->setFOV(FOV_ANGLE);\r
\r
Add some gui stuff\r
*/\r
\r
+ /*GUIQuickInventory *quick_inventory = new GUIQuickInventory\r
+ (guienv, NULL, v2s32(10, 70), 5, &local_inventory);*/\r
GUIQuickInventory *quick_inventory = new GUIQuickInventory\r
- (guienv, NULL, v2s32(10, 70), 5, &local_inventory);\r
+ (guienv, NULL, v2s32(0, 0), quickinv_itemcount, &local_inventory);\r
\r
// Test the text input system\r
/*(new GUITextInputMenu(guienv, guiroot, -1, &g_menumgr,\r
guitext2->setVisible(true);\r
guitext_info->setVisible(true);\r
guitext_chat->setVisible(true);\r
+\r
+ //s32 guitext_chat_pad_bottom = 70;\r
+\r
+ v2u32 screensize(0,0);\r
+ v2u32 last_screensize(0,0);\r
\r
/*\r
Some statistics are collected in these\r
/*\r
Random calculations\r
*/\r
- v2u32 screensize = driver->getScreenSize();\r
- core::vector2d<s32> displaycenter(screensize.X/2,screensize.Y/2);\r
+ last_screensize = screensize;\r
+ screensize = driver->getScreenSize();\r
+ v2s32 displaycenter(screensize.X/2,screensize.Y/2);\r
+ bool screensize_changed = screensize != last_screensize;\r
\r
// Hilight boxes collected during the loop and displayed\r
core::list< core::aabbox3d<f32> > hilightboxes;\r
// Info text\r
std::wstring infotext;\r
\r
+ // When screen size changes, update positions and sizes of stuff\r
+ if(screensize_changed)\r
+ {\r
+ v2s32 pos(displaycenter.X-((quickinv_itemcount-1)*quickinv_spacing+quickinv_size)/2, screensize.Y-quickinv_spacing);\r
+ quick_inventory->updatePosition(pos);\r
+ }\r
+\r
//TimeTaker //timer1("//timer1");\r
\r
// Time of frame without fps limit\r
camera->setAspectRatio((f32)screensize.X / (f32)screensize.Y);\r
\r
u32 daynight_ratio = client.getDayNightRatio();\r
- /*video::SColor bgcolor = video::SColor(\r
- 255,\r
- skycolor.getRed() * daynight_ratio / 1000,\r
- skycolor.getGreen() * daynight_ratio / 1000,\r
- skycolor.getBlue() * daynight_ratio / 1000);*/\r
-\r
u8 l = decode_light((daynight_ratio * LIGHT_SUN) / 1000);\r
video::SColor bgcolor = video::SColor(\r
255,\r
if(g_settings.getBool("enable_fog") == true)\r
{\r
//f32 range = draw_control.wanted_range * BS + MAP_BLOCKSIZE/2*BS;\r
- f32 range = draw_control.wanted_range * BS + MAP_BLOCKSIZE/3*BS;\r
+ f32 range = draw_control.wanted_range * BS + 0.8*MAP_BLOCKSIZE*BS;\r
+ //f32 range = draw_control.wanted_range * BS + 0.0*MAP_BLOCKSIZE*BS;\r
if(draw_control.range_all)\r
range = 100000*BS;\r
\r
bgcolor,\r
video::EFT_FOG_LINEAR,\r
range*0.6,\r
- range*1.1,\r
+ range*1.0,\r
+ 0.01,\r
+ false, // pixel fog\r
+ false // range fog\r
+ );\r
+ }\r
+ else\r
+ {\r
+ driver->setFog(\r
+ bgcolor,\r
+ video::EFT_FOG_LINEAR,\r
+ 100000*BS,\r
+ 110000*BS,\r
0.01,\r
false, // pixel fog\r
false // range fog\r
- );\r
+ );\r
}\r
\r
\r
chat_lines.erase(it);\r
}\r
guitext_chat->setText(whole.c_str());\r
+\r
// Update gui element size and position\r
+\r
+ /*core::rect<s32> rect(\r
+ 10,\r
+ screensize.Y - guitext_chat_pad_bottom\r
+ - text_height*chat_lines.size(),\r
+ screensize.X - 10,\r
+ screensize.Y - guitext_chat_pad_bottom\r
+ );*/\r
core::rect<s32> rect(\r
10,\r
- screensize.Y - 10 - text_height*chat_lines.size(),\r
+ 50,\r
screensize.X - 10,\r
- screensize.Y - 10\r
+ 50 + text_height*chat_lines.size()\r
);\r
+\r
guitext_chat->setRelativePosition(rect);\r
\r
if(chat_lines.size() == 0)\r