Commit Graph

67 Commits

Author SHA1 Message Date
Loic Blot
430d3b28e4 Cleanup some header inclusions to improve compilation times 2017-01-11 15:53:56 +01:00
Ner'zhul
8e7449e092 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
rubenwardy
067766eec2 Fix backwards compatibility issue introduced by close_on_enter 2016-10-08 18:58:28 +02:00
Loic Blot
155288ee98 use unordered containers where possible (patch 4 on X)
Also remove some unused parameters/functions
2016-10-06 22:37:26 +02:00
rubenwardy
077b6cfa21 Formspec: Add container[] and container_end[] elements 2016-10-03 01:53:13 +01:00
rubenwardy
78ff5c1936 Fix background formspec elements from interfering with each other
Fixes #4397
2016-08-29 01:15:31 +01:00
rubenwardy
e10fee0001 Allow fields to choose whether they close on enter press 2016-08-27 13:05:01 +01:00
rubenwardy
4330c63ea4 Submit name of field on enter key press 2016-08-27 13:02:45 +01:00
est31
2060fd9cbe 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
14ef2b445a 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
Ekdohibs
4d9dbceb39 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
d5c3db9c41 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
48939df9a5 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
RealBadAngel
5ca48a35a6 Formspec: recreate item_image_button pressed state for its image and label 2016-02-13 02:35:52 +01:00
est31
bd43933828 Remove unused 'm_selection_active' field
Thanks @ExcaliburZero for noticing. Fixes #3698.
2016-02-13 01:46:12 +01:00
RealBadAngel
baa7c8f8ad FormSpec: Add StaticTextSpec and superimpose over item image buttons 2016-02-09 03:03:55 -05:00
RealBadAngel
6cd2b3b445 Use meshes to display inventory items 2016-02-07 19:51:55 +01:00
est31
c977fbd928 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
b6387b4e0f Use utf-8 in formspecs 2015-06-13 19:49:55 +02:00
kwolekr
da34a2b33e 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
de6d5ce2cd Disable double-click -> ESC translation for main menu 2015-03-14 23:41:42 +10:00
ngosang
dd2bb950be Fix Exit to OS button focus in Pause Menu 2015-02-10 21:23:16 +10:00
Loic Blot
a704c04f00 Network Layer 7 rework (Packet handling)
* Move networkcode to a dedicated directory
* Rename clientserver.h to network/networkprotocol.h (Better name) and sanitize some includes
* Create object NetworkPacket
  * It stores command (opcode) and data separated
  * It also stores peer_id
  * Data reading can be done by using a streaming interface
* Change packet routing analysis
  * Remove old conditional analysis
  * Now uses function pointed analysis and add connection state ({Client,Server}::handlers)
  * Connection state permit to categorize condition to handle before analyze packets
  * Create a handler for depreciated messages, instead of duplicating code
2015-02-10 20:04:08 +10:00
Craig Robbins
f6912f4241 Right mouse button behaviour for craft/inventory If right mousebutton clicked once then don't drop single items into slots. If right mouse button has been clicked and held a second time, drop items as the mouse is moved. In the second case (automatically drop/place items as mouse is moved) only auto-drop into blank slots, or slots that contain the same item. 2014-12-04 23:30:53 +10:00
Zefram
d1d6a97b1c Scale form elements consistently
The ratios between the sizes of form elements, including text, is now
fixed, aside from variations caused by rounding.  This makes form layout
almost fully predictable, and particularly independent of player's
screen size.  The proportions of non-text elements are the traditional
proportions.

For compatibility, the way in which element positions and sizes are
specified remains unchanged, in all its baroqueness, with one exception.
The exception is that the position of a label[] element is now defined
in terms of the vertically center of the first line of the label,
rather than the bottom of the first line of the label.  This change
allows a label to be precisely aligned with button text or an edit box,
which are positioned in a centering manner.  Label positioning remains
consistent with the previous system, just more precisely defined.

Make multi-line label[] elements work properly.  Previously the code set
a bounding rectangle assuming that there would be only a single line,
and as a result a multi-line label would be cut somewhere in the middle
of the second line.  Now multi-line labels not only work, but have
guaranteed line spacing relative to inventory slots, to aid alignment.

Incidentally fix tabheader[] elements which were being constrained to
the wrong width.

Given an unusually large form, in variable-size mode, the form rendering
system now chooses a scale that will fit the entire form on the screen,
if that doesn't make elements too small.  Fixed-size forms, including the
main menu, are have their sizes fixed in inch terms.  The fixed size for
fixed-size forms and the preferred and minimum sizes for variable-size
forms all scale according to the gui_scaling parameter.
2014-11-30 17:50:09 +01:00
sapier
dceb9f7d60 Implement proper font handling 2014-11-30 17:50:09 +01:00
kwolekr
f0ae2da89e Fix uninitialized variable warning 2014-10-30 02:53:20 -04:00
Kahrl
b49e5cfc70 Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism 2014-10-24 21:14:48 +02:00
BlockMen
28438bba27 Add [colorize modifier 2014-10-05 16:49:52 +02:00
sruz25
f6321e277b Add inventory right click drag and drop 2014-09-21 15:23:27 -04:00
BlockMen
a020d1b653 Allow taking screenshots of formspecs and move message to chat 2014-09-21 19:15:48 +02:00
sapier
65b8b524c0 Add srollbar formspec element 2014-07-16 15:02:56 +02:00
sapier
1cc40c0a7c Add support for Android 2.3+
There have been plenty of ppl involved in creating this version.
I don't wanna mention names as I'm sure I'd forget someone so I
just tell where help has been done:
- The partial android versions done by various ppl
- Testing on different android devices
- reviewing code (especially the in core changes)
- testing controls
- reviewing texts

A big thank you to everyone helping this to be completed!
2014-06-29 18:17:56 +02:00
sapier
ebf7ea5019 Add formspec api versioning 2014-06-29 12:13:55 +02:00
RealBadAngel
09ba047c01 Add setting for tooltips show delay. 2014-06-25 16:23:05 +02:00
RealBadAngel
27538ecef5 Tooltips rework.
Separate element for tooltips. Delayed showing,
use global color or given ones.
2014-06-24 22:11:47 +02:00
sapier
d4245e6cac Support for scalable font and gui elements
Fix positioning of tabheader in order to be usable for scaling GUIs
WARNING: this changes position of current tabheaders, mods have to adjust!
2014-06-22 00:08:55 +02:00
sapier
65a4630f31 Fix bounding rect for formspec elements label vertlabel and checkboxes 2014-06-18 22:38:29 +02:00
sapier
003634e049 Add support for exiting formspecs by doubleclicking outside 2014-06-12 23:15:05 +02:00
sapier
127f354e7a Fix formspec replacement handling for in game formspecs 2014-04-22 20:59:01 +02:00
BlockMen
e4d1970abf Fix game pause in singleplayer 2014-03-13 14:06:18 +01:00
Selat
7cac34c807 Pass arguments by reference 2014-03-12 17:34:48 -04:00
sapier
a4e2198e41 Replace pause and message menu by formspec ones 2014-03-05 18:44:14 +01:00
Kahrl
8966c16ad2 Add formspec table 2014-01-13 18:11:08 -05:00
BlockMen
25edae00ea Reworked formspecs and kahrl's hexcolor parser 2013-11-03 22:14:37 +01:00
Novatux
0b78889289 Send a on_receive_fields event when formspec is closed, with fields.quit = "true" 2013-11-03 11:53:59 +01:00
Kahrl
3c4734d69a Change mainmenu texture handling + small misc changes
Texture names must now be escaped in formspec elements image[],
background[], image_button[], image_button_exit[].

Instead of special-case handling of texture loading (and unloading
which was missing) in guiFormSpecMenu.cpp, use the newly created
ISimpleTextureSource interface which is a minimal subset of
ITextureSource. There is an implementation of this interface
used by GUIEngine (MenuTextureSource).

Fix an off-by-one bug in unescape_string; it caused requests for a
texture called "\0".
2013-09-11 00:08:56 +02:00
Kahrl
8548bb75b6 GUIFormSpecMenu focus fixes 2013-08-19 15:49:36 +02:00
sapier
09a50d0458 Add translation for main menu
Add engine.gettext() and remove gettext() calls in guiFormspecMenu.cpp
2013-08-17 16:01:43 +02:00
Kahrl
5e312dc40d Don't automatically scroll listbox when selecting an item in the middle 2013-08-16 00:58:03 +02:00