- virtual InventoryItem* clone()
- {
- return new ToolItem(m_toolname, m_wear);
- }
-#ifndef SERVER
- video::ITexture * getImage()
- {
- std::string basename;
- if(m_toolname == "WPick")
- basename = "tool_wpick.png";
- else if(m_toolname == "STPick")
- basename = "tool_stpick.png";
- else if(m_toolname == "MesePick")
- basename = "tool_mesepick.png";
- else
- basename = "cloud.png";
-
- /*
- Calculate a progress value with sane amount of
- maximum states
- */
- u32 maxprogress = 30;
- u32 toolprogress = (65535-m_wear)/(65535/maxprogress);
-
- float value_f = (float)toolprogress / (float)maxprogress;
- std::ostringstream os;
- os<<"[progressbar"<<value_f;
-
- /*TextureSpec spec;
- spec.addTid(g_irrlicht->getTextureId(basename));
- spec.addTid(g_irrlicht->getTextureId(os.str()));
- return g_irrlicht->getTexture(spec);*/
- //TODO
- return NULL;
-
- /*// 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();
-
- float value_f = (float)toolprogress / (float)maxprogress;
-
- // Get such a texture
- TextureMod *mod = new ProgressBarTextureMod(value_f);
- return g_irrlicht->getTexture(TextureSpec(finalname, basename, mod));*/
- }
-#endif
- std::string getText()
- {
- return "";
-
- /*std::ostringstream os;
- u16 f = 4;
- u16 d = 65535/f;
- u16 i;
- for(i=0; i<(65535-m_wear)/d; i++)
- os<<'X';
- for(; i<f; i++)
- os<<'-';
- return os.str();*/
-
- /*std::ostringstream os;
- os<<m_toolname;
- os<<" ";
- os<<(m_wear/655);
- return os.str();*/
- }
- /*
- Special methods
- */
- std::string getToolName()