aboutsummaryrefslogtreecommitdiff
path: root/src/gui/guiFormSpecMenu.cpp
Commit message (Expand)AuthorAge
* Formspecs: Allow setting alpha value for the box[] elementThomas--S2018-04-23
* Selected ItemStack: Reduce black magic (#6520)SmallJoker2018-04-03
* Formspecs: Use mouse wheel to pick up and deposit single itemsyou2018-04-02
* Add formspec theming using prepended stringsAndrew Ward2018-03-28
* Fix Android build, but there is a remaining linking issue in guiConfirmRegist...Loic Blot2018-03-11
* Formspecs: Unify textarea and field parsing functions, fix wrong fallback textSmallJoker2018-03-09
* Game refactor [4/X]: keycache is now owned by InputHandlerLoic Blot2018-01-20
* Game refactor [2/X]: Various moves (profilergraph, nodePlacementPrediction, ...Loic Blot2018-01-20
* [CSM] Add basic HUD manipulation. (#6067)red-0012018-01-20
* Don't recalculate statustext initial color everytime & review fixesLoic Blot2018-01-05
* GameUI refactor (part 2/X): Move Game::guitext to GameUI + enhancements on St...Loic Blot2018-01-05
* Ensure no item stack is being held before crafting (#4779)Luis Cáceres2017-12-06
* Move files to subdirectories (#6599)Vitaliy2017-11-08
POSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef CLIENTOBJECT_HEADER #define CLIENTOBJECT_HEADER #include "irrlichttypes_extrabloated.h" #include "activeobject.h" #include <map> #include "util/cpp11_container.h" class ClientEnvironment; class ITextureSource; class Client; class IGameDef; class LocalPlayer; struct ItemStack; class WieldMeshSceneNode; class ClientActiveObject : public ActiveObject { public: ClientActiveObject(u16 id, Client *client, ClientEnvironment *env); virtual ~ClientActiveObject(); virtual void addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc, IrrlichtDevice *irr){} virtual void removeFromScene(bool permanent){} // 0 <= light_at_pos <= LIGHT_SUN virtual void updateLight(u8 light_at_pos){} virtual void updateLightNoCheck(u8 light_at_pos){} virtual v3s16 getLightPosition(){return v3s16(0,0,0);} virtual aabb3f *getSelectionBox() { return NULL; } virtual bool getCollisionBox(aabb3f *toset) const { return false; } virtual bool collideWithObjects() const { return false; } virtual v3f getPosition(){return v3f(0,0,0);} virtual float getYaw() const {return 0;} virtual scene::ISceneNode *getSceneNode(){return NULL;} virtual scene::IMeshSceneNode *getMeshSceneNode(){return NULL;} virtual scene::IAnimatedMeshSceneNode *getAnimatedMeshSceneNode(){return NULL;} virtual WieldMeshSceneNode *getWieldMeshSceneNode(){return NULL;} virtual scene::IBillboardSceneNode *getSpriteSceneNode(){return NULL;} virtual bool isPlayer() const {return false;} virtual bool isLocalPlayer() const {return false;} virtual void setAttachments(){} virtual bool doShowSelectionBox(){return true;} virtual void updateCameraOffset(v3s16 camera_offset){}; // Step object in time virtual void step(float dtime, ClientEnvironment *env){} // Process a message sent by the server side object virtual void processMessage(const std::string &data){} virtual std::string infoText() {return "";} virtual std::string debugInfoText() {return "";} /* This takes the return value of ServerActiveObject::getClientInitializationData */ virtual void initialize(const std::string &data){} // Create a certain type of ClientActiveObject static ClientActiveObject* create(ActiveObjectType type, Client *client, ClientEnvironment *env); // If returns true, punch will not be sent to the server virtual bool directReportPunch(v3f dir, const ItemStack *punchitem=NULL, float time_from_last_punch=1000000) { return false; } protected: // Used for creating objects based on type typedef ClientActiveObject* (*Factory)(Client *client, ClientEnvironment *env); static void registerType(u16 type, Factory f); Client *m_client; ClientEnvironment *m_env; private: // Used for creating objects based on type static UNORDERED_MAP<u16, Factory> m_types; }; struct DistanceSortedActiveObject { ClientActiveObject *obj; f32 d; DistanceSortedActiveObject(ClientActiveObject *a_obj, f32 a_d) { obj = a_obj; d = a_d; } bool operator < (const DistanceSortedActiveObject &other) const { return d < other.d; } }; #endif