93 Commits

Author SHA1 Message Date
Zefram
dfee893fae 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
794909cbe8 Implement proper font handling 2014-11-30 17:50:09 +01:00
kwolekr
4002201c79 Fix uninitialized variable warning 2014-10-30 02:53:20 -04:00
Kahrl
deeaa9687e Remove m_ext_ptr in GUIFormSpecMenu, replaced by refcount mechanism 2014-10-24 21:14:48 +02:00
BlockMen
efa7ad44fa Add [colorize modifier 2014-10-05 16:49:52 +02:00
sruz25
5688b3b53d Add inventory right click drag and drop 2014-09-21 15:23:27 -04:00
BlockMen
f77a8a9408 Allow taking screenshots of formspecs and move message to chat 2014-09-21 19:15:48 +02:00
sapier
73907a2c7e Add srollbar formspec element 2014-07-16 15:02:56 +02:00
sapier
268ff61168 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
1f88af3b7a Add formspec api versioning 2014-06-29 12:13:55 +02:00
RealBadAngel
d57e75ed2a Add setting for tooltips show delay. 2014-06-25 16:23:05 +02:00
RealBadAngel
1328c078f5 Tooltips rework.
Separate element for tooltips. Delayed showing,
use global color or given ones.
2014-06-24 22:11:47 +02:00
sapier
d23ac22ad9 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
2dfd8961bb Fix bounding rect for formspec elements label vertlabel and checkboxes 2014-06-18 22:38:29 +02:00
sapier
6558fc90e3 Add support for exiting formspecs by doubleclicking outside 2014-06-12 23:15:05 +02:00
sapier
b444ffd39a Fix formspec replacement handling for in game formspecs 2014-04-22 20:59:01 +02:00
BlockMen
5dab81cca6 Fix game pause in singleplayer 2014-03-13 14:06:18 +01:00
Selat
a83693c5c3 Pass arguments by reference 2014-03-12 17:34:48 -04:00
sapier
89c5163c02 Replace pause and message menu by formspec ones 2014-03-05 18:44:14 +01:00
Kahrl
d58f5a0878 Add formspec table 2014-01-13 18:11:08 -05:00
BlockMen
18314f400f Reworked formspecs and kahrl's hexcolor parser 2013-11-03 22:14:37 +01:00
Novatux
5db8c1b5d9 Send a on_receive_fields event when formspec is closed, with fields.quit = "true" 2013-11-03 11:53:59 +01:00
Kahrl
fb1f510c3f 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
bfa1eb913f GUIFormSpecMenu focus fixes 2013-08-19 15:49:36 +02:00
sapier
281dc6a502 Add translation for main menu
Add engine.gettext() and remove gettext() calls in guiFormspecMenu.cpp
2013-08-17 16:01:43 +02:00
Kahrl
4f886514a7 Don't automatically scroll listbox when selecting an item in the middle 2013-08-16 00:58:03 +02:00
Kahrl
b7be31b051 Formspec textlist: Black Irrlicht magic to detect fake doubleclicks 2013-08-16 00:08:19 +02:00
Kahrl
ee90d438b8 Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu 2013-08-14 21:03:33 +02:00
sapier
4f7abcbafa Fix many formspec menu bugs 2013-07-07 19:49:52 -04:00
Sfan5
67b58fa494 Use hexadecimal RRGGBB instead of colorkeys, rename getColor to parseColor 2013-07-06 10:32:58 +02:00
sapier
62794622d6 Replace C++ mainmenu by formspec powered one 2013-07-02 19:58:20 -04:00
Kahrl
e671961d03 Formspec: Don't perform black magic if selected item fits the guess 2013-06-18 01:32:11 +02:00
Ilya Zhuravlev
a12df55f29 Migrate to STL containers/algorithms. 2013-03-11 19:08:39 -04:00
Sfan5
3fab3825aa Update Copyright Years 2013-02-24 20:15:24 +01:00
PilzAdam
269f01224b Change Minetest-c55 to Minetest 2013-02-24 18:49:03 +01:00
RealBadAngel
983b4a6797 New elements in formspec, item_image and item_image_button.
Fixed also game bug drawing dragged item behind fields, buttons etc.
2012-12-01 20:39:41 +02:00
Jürgen Doser
0cc67f2b05 Make dragged itemstack following the mouse cursor much smoother
by using the cursor coordinates directly, instead of updating them only when a mouse event is seen.
2012-11-30 22:07:30 +02:00
RealBadAngel
4bafba37ac Adding background to Formspec 2012-11-08 19:22:37 +01:00
Perttu Ahola
c10d6f12a9 Make inventory GUI do sane things when server-side inventory acts unusually 2012-09-02 22:51:38 +03:00
Perttu Ahola
c2cb98c1a6 Detached inventories 2012-07-24 20:57:17 +03:00
Perttu Ahola
f1e67f44ca Formspec button_exit[] and image_button_exit[] 2012-07-22 17:40:48 +03:00
Perttu Ahola
243d9fb7d6 minetest.register_on_player_receive_fields() 2012-07-22 17:40:48 +03:00
darkrose
a3ba145339 Implement formspec 2012-07-22 17:40:41 +03:00