aboutsummaryrefslogtreecommitdiff
path: root/builtin
Commit message (Expand)AuthorAge
...
* Fix parameter passing to gettext callPilzAdam2015-10-25
* Check if hitter has inventory when punching itemBlockMen2015-10-25
* Credits: Remove my nameRui2015-10-25
* Escape " in generated settings_translation_file.cppPilzAdam2015-10-25
* Fix setting commentsPilzAdam2015-10-24
* Don't allow games or mods to add secure. settingsPilzAdam2015-10-24
* Better gettext support for protocol version mismatch messagesest312015-10-24
* Improve Lua settings menuPilzAdam2015-10-24
* Add more ways to pass data to check_player_privsRobert Zenz2015-10-22
* Display sane output for empty descriptionsest312015-10-18
* New settings tab contain all possible settingsPilzAdam2015-10-17
* Refactor loggingShadowNinja2015-10-14
* Localize digprop_err functionRui2015-10-12
* Add viewing range GUI settingkilbith2015-10-06
* Added minetest.wallmounted_to_dirFernando Carmona Varo2015-10-04
* Some map border related fixesest312015-09-29
* Add /emergeblocks command and core.emerge_area() Lua APIkwolekr2015-09-23
* Replace "self program" with "this program" in fstk boilerplatesest312015-09-21
* Minor tweaks handle_settings_buttonsRui9142015-09-14
* Change my emailRui9142015-09-03
* Small fixes of minetest.has_featureRui2015-09-03
* Minor tweaks __builtin:falling_nodeRui2015-09-01
* Credits tab: fix accidental merger of two contributorsest312015-08-31
* Use gettext to "None" of texture pack listRui9142015-08-25
* Remove some emails from credits tabkwolekr2015-08-19
* Update credits tabkwolekr2015-08-19
* Client: disable mmdb modstoreest312015-08-19
* Don't do formspec escaping twice for loading descriptionest312015-08-14
* SAPI: Track last executed mod and include in error messageskwolekr2015-08-12
* Fix FSAA dropdown option reset after changing another dropdown optionjeanpatrick.guerrero@gmail.com2015-07-25
* Remove drivers dropdown in the settings tabkilbith2015-07-25
* Update my nameNovatux2015-07-24
* Optional reconnect functionalityest312015-07-23
* Fix crash in mainmenu when loaded subgame does not have a "menu" directorysfan52015-07-21
* Allow random menu images for subgamessfan52015-07-21
* Add antialiasing UI settingMark Schreiber2015-07-18
* Add ability to specify coordinates for /spawnentityMarcin2015-07-18
* Change texture pack description file nameExcaliburZero2015-07-18
* Fix remnant bugs on mainmenujp2015-07-10
* Add new leaves style - simple (glasslike drawtype)RealBadAngel2015-07-08
* Fix attempt to start a world when no world is selected/createdjeanpatrick.guerrero@gmail.com2015-07-04
* Set server_announce to world.mt and respect modes when changing subgameSokomine2015-07-02
* Fix world.mt not written when selecting modeSokomine2015-07-01
* Fix single click world selectest312015-06-30
* Fix bugs in mainmenujeanpatrick.guerrero@gmail.com2015-06-30
* Add Lua errors to error dialogrubenwardy2015-06-29
* Update credits tabest312015-06-16
* Don't highlight entries in creditsWuzzy2015-06-15
* Remove reference to deprecated privilegeCraig Davison2015-06-14
* Add minetest.register_on_player_hpchangeTeTpaAka2015-06-13
********************/ class GUIEngine; class MainMenuScripting; class Clouds; struct MainMenuData; /******************************************************************************/ /* declarations */ /******************************************************************************/ /** GUIEngine specific implementation of TextDest used within guiFormSpecMenu */ class TextDestGuiEngine : public TextDest { public: /** * default constructor * @param engine the engine data is transmitted for further processing */ TextDestGuiEngine(GUIEngine* engine); /** * receive fields transmitted by guiFormSpecMenu * @param fields map containing formspec field elements currently active */ void gotText(const StringMap &fields); /** * receive text/events transmitted by guiFormSpecMenu * @param text textual representation of event */ void gotText(std::wstring text); private: /** target to transmit data to */ GUIEngine* m_engine; }; /** GUIEngine specific implementation of ISimpleTextureSource */ class MenuTextureSource : public ISimpleTextureSource { public: /** * default constructor * @param driver the video driver to load textures from */ MenuTextureSource(video::IVideoDriver *driver); /** * destructor, removes all loaded textures */ virtual ~MenuTextureSource(); /** * get a texture, loading it if required * @param name path to the texture * @param id receives the texture ID, always 0 in this implementation */ video::ITexture* getTexture(const std::string &name, u32 *id = NULL); private: /** driver to get textures from */ video::IVideoDriver *m_driver; /** set of texture names to delete */ std::set<std::string> m_to_delete; }; /** GUIEngine specific implementation of OnDemandSoundFetcher */ class MenuMusicFetcher: public OnDemandSoundFetcher { public: /** * get sound file paths according to sound name * @param name sound name * @param dst_paths receives possible paths to sound files * @param dst_datas receives binary sound data (not used here) */ void fetchSounds(const std::string &name, std::set<std::string> &dst_paths, std::set<std::string> &dst_datas); private: /** set of fetched sound names */ std::set<std::string> m_fetched; }; /** implementation of main menu based uppon formspecs */ class GUIEngine { /** grant ModApiMainMenu access to private members */ friend class ModApiMainMenu; public: /** * default constructor * @param dev device to draw at * @param parent parent gui element * @param menumgr manager to add menus to * @param smgr scene manager to add scene elements to * @param data struct to transfer data to main game handling */ GUIEngine( irr::IrrlichtDevice* dev, gui::IGUIElement* parent, IMenuManager *menumgr, scene::ISceneManager* smgr, MainMenuData* data, bool& kill); /** default destructor */ virtual ~GUIEngine(); /** * return MainMenuScripting interface */ MainMenuScripting* getScriptIface() { return m_script; } /** * return dir of current menuscript */ std::string getScriptDir() { return m_scriptdir; } /** pass async callback to scriptengine **/ unsigned int queueAsync(std::string serialized_fct,std::string serialized_params); private: /** find and run the main menu script */ bool loadMainMenuScript(); /** run main menu loop */ void run(); /** handler to limit frame rate within main menu */ void limitFrameRate(); /** update size of topleftext element */ void updateTopLeftTextSize(); /** device to draw at */ irr::IrrlichtDevice* m_device; /** parent gui element */ gui::IGUIElement* m_parent; /** manager to add menus to */ IMenuManager* m_menumanager; /** scene manager to add scene elements to */ scene::ISceneManager* m_smgr; /** pointer to data beeing transfered back to main game handling */ MainMenuData* m_data; /** pointer to texture source */ ISimpleTextureSource* m_texture_source; /** pointer to soundmanager*/ ISoundManager* m_sound_manager; /** representation of form source to be used in mainmenu formspec */ FormspecFormSource* m_formspecgui; /** formspec input receiver */ TextDestGuiEngine* m_buttonhandler; /** the formspec menu */ GUIFormSpecMenu* m_menu; /** reference to kill variable managed by SIGINT handler */ bool& m_kill; /** variable used to abort menu and return back to main game handling */ bool m_startgame; /** scripting interface */ MainMenuScripting* m_script; /** script basefolder */ std::string m_scriptdir; /** * draw background layer * @param driver to use for drawing */ void drawBackground(video::IVideoDriver* driver); /** * draw overlay layer * @param driver to use for drawing */ void drawOverlay(video::IVideoDriver* driver); /** * draw header layer * @param driver to use for drawing */ void drawHeader(video::IVideoDriver* driver); /** * draw footer layer * @param driver to use for drawing */ void drawFooter(video::IVideoDriver* driver); /** * load a texture for a specified layer * @param layer draw layer to specify texture * @param texturepath full path of texture to load */ bool setTexture(texture_layer layer, std::string texturepath, bool tile_image, unsigned int minsize); /** * download a file using curl * @param url url to download * @param target file to store to */ static bool downloadFile(std::string url,std::string target); /** array containing pointers to current specified texture layers */ image_definition m_textures[TEX_LAYER_MAX]; /** draw version string in topleft corner */ void drawVersion(); /** * specify text to be appended to version string * @param text to set */ void setTopleftText(std::string append); /** pointer to gui element shown at topleft corner */ irr::gui::IGUIStaticText* m_irr_toplefttext; /** initialize cloud subsystem */ void cloudInit(); /** do preprocessing for cloud subsystem */ void cloudPreProcess(); /** do postprocessing for cloud subsystem */ void cloudPostProcess(); /** internam data required for drawing clouds */ struct clouddata { /** delta time since last cloud processing */ f32 dtime; /** absolute time of last cloud processing */ u32 lasttime; /** pointer to cloud class */ Clouds* clouds; /** camera required for drawing clouds */ scene::ICameraSceneNode* camera; }; /** is drawing of clouds enabled atm */ bool m_clouds_enabled; /** data used to draw clouds */ clouddata m_cloud; /** start playing a sound and return handle */ s32 playSound(SimpleSoundSpec spec, bool looped); /** stop playing a sound started with playSound() */ void stopSound(s32 handle); }; #endif /* GUI_ENGINE_H_ */