-#ifndef SERVER
- video::ITexture * getImage()
- {
- std::string basename;
- if(m_toolname == "WPick")
- basename = porting::getDataPath("tool_wpick.png").c_str();
- else if(m_toolname == "STPick")
- 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 = porting::getDataPath("cloud.png").c_str();
- //basename = tile_texture_path_get(TILE_CLOUD);
-
- /*
- Calculate some progress value with sane amount of
- maximum states
- */
- u32 maxprogress = 30;
- 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();
-
- 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()
+
+ // Returns a pointer to the item definition struct,
+ // or a fallback one (name="unknown") if the item is unknown.
+ const ItemDefinition& getDefinition(
+ IItemDefManager *itemdef) const