]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/inventory.h
comments
[dragonfireclient.git] / src / inventory.h
index ff0086102cfc7bb0d33c06d0fe02dfb3c0ee8527..797a675094a342ea77b94d311d2158e96dd2df5f 100644 (file)
@@ -122,16 +122,10 @@ class MaterialItem : public InventoryItem
 #ifndef SERVER
        video::ITexture * getImage()
        {
-               /*if(m_content == CONTENT_TORCH)
-                       return g_texturecache.get("torch_on_floor");
-
-               u16 tile = content_tile(m_content, v3s16(1,0,0));
-               return g_tile_contents[tile].getTexture(0);*/
-               
                if(m_content >= USEFUL_CONTENT_COUNT)
                        return NULL;
                        
-               return g_irrlicht->getTexture(g_content_inventory_textures[m_content]);
+               return g_irrlicht->getTexture(g_content_inventory_texture_paths[m_content]);
        }
 #endif
        std::string getText()
@@ -257,15 +251,18 @@ class CraftItem : public InventoryItem
        video::ITexture * getImage()
        {
                std::string basename;
+
                if(m_subname == "Stick")
-                       basename = "../data/stick.png";
-               // Default to cloud texture
+                       basename = porting::getDataPath("stick.png");
+               else if(m_subname == "lump_of_coal")
+                       basename = porting::getDataPath("lump_of_coal.png");
+               else if(m_subname == "lump_of_iron")
+                       basename = porting::getDataPath("lump_of_iron.png");
                else
-                       basename = tile_texture_path_get(TILE_CLOUD);
+                       basename = porting::getDataPath("cloud.png[[mod:crack3");
                
                // Get such a texture
                return g_irrlicht->getTexture(basename);
-               //return g_irrlicht->getTexture(TextureSpec(finalname, basename, mod));
        }
 #endif
        std::string getText()
@@ -333,12 +330,15 @@ class ToolItem : public InventoryItem
        {
                std::string basename;
                if(m_toolname == "WPick")
-                       basename = "../data/tool_wpick.png";
+                       basename = porting::getDataPath("tool_wpick.png").c_str();
                else if(m_toolname == "STPick")
-                       basename = "../data/tool_stpick.png";
+                       basename = porting::getDataPath("tool_stpick.png").c_str();
+               else if(m_toolname == "MesePick")
+                       basename = porting::getDataPath("tool_mesepick.png").c_str();
                // Default to cloud texture
                else
-                       basename = tile_texture_path_get(TILE_CLOUD);
+                       basename = porting::getDataPath("cloud.png").c_str();
+                       //basename = tile_texture_path_get(TILE_CLOUD);
                
                /*
                        Calculate some progress value with sane amount of
@@ -348,6 +348,12 @@ class ToolItem : public InventoryItem
                u32 toolprogress = (65535-m_wear)/(65535/maxprogress);
                
                // Make texture name for the new texture with a progress bar
+               float value_f = (float)toolprogress / (float)maxprogress;
+               std::ostringstream os;
+               os<<basename<<"[[mod:progressbar"<<value_f;
+               return g_irrlicht->getTexture(os.str());
+
+               /*// Make texture name for the new texture with a progress bar
                std::ostringstream os;
                os<<basename<<"-toolprogress-"<<toolprogress;
                std::string finalname = os.str();
@@ -356,7 +362,7 @@ class ToolItem : public InventoryItem
                
                // Get such a texture
                TextureMod *mod = new ProgressBarTextureMod(value_f);
-               return g_irrlicht->getTexture(TextureSpec(finalname, basename, mod));
+               return g_irrlicht->getTexture(TextureSpec(finalname, basename, mod));*/
        }
 #endif
        std::string getText()