158 Commits

Author SHA1 Message Date
Loic Blot
045cc40d91 [CSM] Client side modding
* rename GameScripting to ServerScripting
* Make getBuiltinLuaPath static serverside
* Add on_shutdown callback
* Add on_receiving_chat_message & on_sending_chat_message callbacks
* ScriptApiBase: use IGameDef instead of Server
  This permits to share common attribute between client & server
* Enable mod security in client side modding without conditions
2017-03-13 23:56:05 +01:00
adelcoding1
31a34c66b3 FormSpec: Add position and anchor elements (#5284) 2017-03-04 10:46:55 +01:00
rubenwardy
87920c8635 Add per-stack descriptions using ItemStack Metadata 2017-02-04 22:07:55 +00:00
Ner'zhul
14a094c1a2 Environment & IGameDef code refactoring (#4985)
* Environment code refactoring
* Cleanup includes & class declarations in client & server environment to improve build speed
* ServerEnvironment::m_gamedef is now a pointer to Server instead of IGameDef, permitting to cleanup many casts.
* Cleanup IGameDef
  * Move ITextureSource* IGameDef::getTextureSource() to Client only.
  * Also move ITextureSource *IGameDef::tsrc() helper
  * drop getShaderSource, getSceneManager, getSoundManager & getCamera abstract call
  * drop unused emerge() call
  * cleanup server unused functions (mentionned before)
* Drop one unused parameter from ContentFeatures::updateTextures
* move checkLocalPrivilege to Client
* Remove some unnecessary casts
* create_formspec_menu: remove IWritableTextureSource pointer, as client already knows it
* Fix some comments
* Change required IGameDef to Server/Client pointers
* Previous change that game.cpp sometimes calls functions with Client + InventoryManager + IGameDef in same functions but it's the same objects
* Remove duplicate Client pointer in GUIFormSpecMenu::GUIFormSpecMenu
* drop ClientMap::sectorWasDrawn which is unused
2017-01-09 20:39:22 +01:00
sfan5
5d6a716bd0 Limit drawing rect of selected item to viewport size (fixes #4341) 2016-12-20 14:29:12 +01:00
lisacvuk
331608ce3f Fixed tooltips not resizing with \n (#4766)
* Fixed tooltips not resizing with \n

* Fixed it for 1.8.4 too.

* Fixed not working with Freetype disabled.

* Modified it to use Zeno-'s solution.
2016-11-11 21:16:34 +10:00
rubenwardy
8c1271f645 Fix backwards compatibility issue introduced by close_on_enter 2016-10-08 18:58:28 +02:00
rubenwardy
ade3a24e75 Formspec: Add container[] and container_end[] elements 2016-10-03 01:53:13 +01:00
rubenwardy
23aafd2903 Fix background formspec elements from interfering with each other
Fixes #4397
2016-08-29 01:15:31 +01:00
rubenwardy
71f9f4ce26 Allow fields to choose whether they close on enter press 2016-08-27 13:05:01 +01:00
rubenwardy
f0d651e85e Submit name of field on enter key press 2016-08-27 13:02:45 +01:00
est31
b7d656581d Initial Gamepad support
Adds initial ingame gamepad support to minetest.

Full Formspec support is not implemented yet and
can be added by a later change.
2016-06-03 19:42:57 +02:00
Ekdohibs
e7b84d7db6 Add colored text (not only colored chat).
Add documentation, move files to a proper place and avoid memory leaks.
Make it work with most kind of texts, and allow backgrounds too.
2016-05-31 17:34:29 +02:00
Craig Robbins
a06b3d8cb2 Fix irrlicht version checking macro for tooltip_height calculation 2016-05-24 00:27:11 +10:00
Craig Robbins
aa2cd7e196 Fix tooltip height for versions of irrlicht < 1.8.2
Version 1.8.2 of irrlicht changed the way that IGUIStaticText::getTextHeight() works and since that release properly deals with newlines.

From irrlicht changes.txt for 1.8.2, "IGUIStaticText::getTextHeight returns now the correct height for texts with newlines even WordWrap is not set."
2016-05-21 00:26:04 +10:00
Ekdohibs
cbcf1d03f1 Run unescape_enriched *after* unescape_string.
Doing it the other way round was a mistake, since it breaks
minetest.formspec_escape with escape sequences that contain
special characters.
2016-05-07 08:33:21 +02:00
Ekdohibs
5d56cb58a1 Make dropdowns show the string that was their argument.
This makes it work even if it contains escape sequences,
which didn't work before.
2016-05-07 08:33:21 +02:00
Ekdohibs
ce488ea7f4 Escape more strings: formspecs, item descriptions, infotexts...
Also, change the escape character to the more standard \x1b
Thus, it can be used in the future for translation or colored text,
for example.
2016-04-24 03:54:11 +10:00
Xunto
f3f23ad0de Fix bug that was leading to oversized tooltips containing multiline text when it have multiple lines 2016-04-23 21:12:53 +10:00
ShadowNinja
3592feb875 Clean up Strfnd
Changes:
  * Fix indentation.
  * Pass strings by const reference.
  * Merge Strfnd and WStrfnd into one class instead of copying them.
  * Remove trailing spaces.
  * Fix variable names.
  * Move to util.
  * Other miscellaneous style fixes.
2016-03-19 21:27:57 -04:00
RealBadAngel
c2cb6bc900 Formspec: fix broken irrlicht 1.7 build
Fixes #3701.
2016-02-13 22:19:01 +01:00
RealBadAngel
7ffa4bfd79 Formspec: recreate item_image_button pressed state for its image and label 2016-02-13 02:35:52 +01:00
RealBadAngel
15ccf9b85c FormSpec: Add StaticTextSpec and superimpose over item image buttons 2016-02-09 03:03:55 -05:00
est31
3bb1d941ad small drawItemStack cleanup
-> Replace the three bool params with an enum
-> Add struct for the static content, leads to less repetition
-> cache enable_animations setting
2016-02-08 00:35:24 +01:00
RealBadAngel
013ef76173 Use meshes to display inventory items 2016-02-07 19:51:55 +01:00
BlockMen
ea60bb8769 Fix scrollbars 2015-11-12 17:38:15 +01:00
ShadowNinja
29e8adeadc Use warningstream for log messages with WARNING
Remove DTIME macro and its uses, too
2015-10-14 01:36:48 -04:00
est31
65cbaaa53f Clear list rings when loading a new formspec
Fixes a bug where the old list ring remained when a new formspec
was displayed over the old one. This created the list-ring of the new formspec
to be partly ignored.

Thanks to @VanessaE to report the bug, and @DonBatman to produce the code that
exposed it.
2015-10-10 17:10:52 +02:00
David Jones
9d1284b324 Change i++ to ++i 2015-08-25 18:33:52 -04:00
Kahrl
4b745550c6 Fix intlGUIEditBox leak and uninitialized value in Mapper (reported by valgrind) 2015-08-10 08:41:45 +02:00
est31
f4cc4ddc30 Add MoveSomewhere inventory action
Improve shift+click experience
2015-06-23 20:18:41 +02:00
est31
f753728327 Don't print an error for valid listring[] formspec 2015-06-18 04:25:11 +02:00
est31
9d1496789b GUIFormSpecMenu::OnEvent code style update and small refactor
* Make method (more) consistent with current code stlye
* Move index into loop constructor after @rubenwardy's suggestion
* Cache inv_s->getList(s.listname), which removes a possibly bad scenario
of inv_s being null.
* Properly check for validity
2015-06-16 20:33:07 +02:00
est31
571e159a1a Add list-rings
Adds list-rings, a method to implement item sending between inventories via shift-click.
Nice insider feature: a ring consisting of a single inventory list serves as nice clean-up method.
Also adds them to minimal game, and the standard inventory.
Craft output slots are not supported.
2015-06-16 14:51:26 +02:00
Ilya Zhuravlev
415372ca13 Use utf-8 in formspecs 2015-06-13 19:49:55 +02:00
est31
fe36c20cad Make split method static 2015-06-01 17:04:21 +02:00
kwolekr
4df33b90e5 Replace instances of std::map<std::string, std::string> with StringMap
Also, clean up surrounding code style
Replace by-value parameter passing with const refs when possible
Fix post-increment of iterators
2015-05-19 16:10:49 -04:00
Craig Robbins
0731f9ed2a Move globals from main.cpp to more sane locations
Move debug streams to log.cpp|h

Move GUI-related globals to clientlauncher

Move g_settings and g_settings_path to settings.cpp|h

Move g_menuclouds to clouds.cpp|h

Move g_profiler to profiler.cpp|h
2015-04-01 23:04:25 +10:00
kwolekr
86e79b3a50 Fix some minor details from 6d61375 2015-04-01 00:19:10 -04:00
Aaron Suen
e8d51554ae Clean scaling pre-filter for formspec/HUD. 2015-04-01 00:01:05 -04:00
Craig Robbins
364c62fa2e Disable double-click -> ESC translation for main menu 2015-03-14 23:41:42 +10:00
est31
b5c9ea9e29 Unescape tooltip texts
Previously, tooltips didn't unescape escaped formspec texts.
Item descriptions that trigger tooltips like inside inventories or for item_image_button
don't need to get unescaped, as they don't get set using formspec, but from lua.
2015-03-11 14:33:07 +01:00
Craig Robbins
af0501043d Stop formspecs closing with double-click in empty area
Behaviour on Android remains the same until other alternatives can be devised (if possible)

See #2425 (and the many other -- now closed -- issues reporting this feature as a bug)
2015-03-09 12:42:25 +10:00
Craig Robbins
27791ee1aa For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives 2015-03-07 22:41:47 +10:00
Loic Blot
188c15c3d8 Replace std::list to std::vector into tile.cpp (m_texture_trash) and move tile.hpp to src/client/ 2015-03-05 11:59:40 +01:00
Loic Blot
2fd9ac5fe9 Move hex.h to util/ 2015-02-21 14:32:35 +01:00
ngosang
68a1a15972 Fix Exit to OS button focus in Pause Menu 2015-02-10 21:23:16 +10:00
ShadowNinja
0a2e53077b Reduce gettext wide/narrow and string/char* conversions 2015-02-05 03:24:22 -05:00
onkrot
c91dbf8ad2 Performance fixes. 2015-01-13 23:48:56 +10:00
sapier
0e9c28d32b Remove automatic consistent formspec size <-> font size (now has to be done manually)
Set builtin formspecs to autoscale in order to get consistent formspec look and feel
Uncouple label positioning from font size (May break some formspecs but is required to allow manual font adjustment)
2015-01-09 18:46:24 +01:00