Commit Graph

27 Commits

Author SHA1 Message Date
SmallJoker
b1c85a2cb8 Fix waypoint initialization order 2021-08-29 07:47:32 +02:00
SmallJoker
d39dd78cb5 Use player meta for waypoints 2021-07-20 20:41:23 +02:00
Vanessa Dannenberg
b8a568d7eb remove unused var, excess whitespace 2021-03-09 15:04:11 -05:00
Vanessa Dannenberg
9ddea6eced fix missing "XYZ" and "no" icon on waypoints show coordinates button 2021-03-09 15:04:11 -05:00
Vanessa Dannenberg
382219c466 move S() calls into waypoints' button table
instead of inside the loop
2021-03-09 15:04:11 -05:00
Vanessa Dannenberg
5ea0208ffe Multiple related changes to string handling
1) Convert most formspec elements to use string.format(), when the
result would be more readable, or less messy, or at least makes the line
shorter, assuming it looked like it really needed it to begin with.

2) Convert all long `foo..","..bar..";"..baz..bleh..` types of excessive
string concatenation into tables that then get concated only once, when
their containing functions return the final formspec string.

3) In some places in the code, such tables were already being used, and
were named "formspec", while others were named "fs".  I settled on just
one name, "formspec", as it's more readable, if longer.

4) There was a mix of styles of adding items to those tables:

* Some places used line after line of `t[#t + 1] = foo/bar/baz`.
* Others places used the form `t[1] = foo, t[2] = bar, ...`.
* Still others used the form `t[n] = foo, t[n+1] = bar...`,
  with `n` being increased or reset every so often.

Most of them should now be of the third form, with a few of the second.
2021-03-09 15:04:11 -05:00
Vanessa Dannenberg
694553e68b use local "ui" to reference "unified_inventory", where practical
(makes code shorter, easier to read and write)
2021-03-09 15:04:11 -05:00
Vanessa Dannenberg
b3077898a7 make waypoints explicitly reference full-style vars
(since it does not support lite mode)
2021-03-09 15:04:11 -05:00
Vanessa Dannenberg
167dddaa84 Convert over to formspec version 4
I recreated the original layout as best as practical, but by necessity
there are a few minor positioning changes, since the underlying
hard-wired inventory slots are square now and image positioning is now
scaled by exactly 1.250 in both dimensions (as opposed to roughly 1.25
by 1.16).

Backstage, I also needed to fix the aspect ratios of the various
inventory slot elements.  That meant redesigning the single-slot image
from scratch.  It was already blurry/grainy and a little ugly, and
trying to alter it would have only made it worse.

The slot image is now exactly 56x56 pixels square, set on a 64x64
canvas, so there's a 4 pixel empty space around the edges. The full
256px .xcf workfile is included in the UI folder.

I've re-tiled all slot/inv images from the new single slot.

I also re-rendered the trash can icon from it since it was blurry and
oddly-sized. I couldn't find the original upstream image, so since
they're free, I used one of my Linux system's icons which happens to
resemble it.

I also removed a couple more improper uses of `background[]` where
`image[]` is more appropriate.

There are tons of minor tweaks throughout the code to re-align
everything, and I had to rewrite a few sections to avoid code
duplication and to allow for a little more flexibility (mainly to make
"lite" mode look right).
2021-03-09 15:04:11 -05:00
Vanessa Dannenberg
ebd1d1f245 Improve consistency of inventory (and alike) imagery
In a number of places, background[] is misused to place the
inventory backdrop images.  Where appropriate, image[] is used
instead, so that "ui_form_bg.png" actually serves as the one
and only true background image.

In so doing, I was able to remake the bag inventory images,
making them only big as is actually needed to hold 1, 2, or 3
rows of inventory slots.

This, in turn, allows a standardized main inventory image to
occupy the lower part of the window, which allows for
consistent inventory image positioning and sizing from one
page to another.

I also removed ui_misc_form.png.  Nothing in UI uses it, and
any external mods that used it can just use the standard
inventory and its background.

Lastly, I reduced the background image to 512x384 px.  It was
unnecessarily large before, considering it has no real detail.

The larger inventory images are all 512px wide, and multiples
of 64px in height.  Before, they were oddly sized.
2021-03-01 18:57:50 +01:00
Wuzzy
8e74a80e91 Translation: Fix parameter symbols 2019-10-17 21:05:08 +02:00
Wuzzy
5327261718 Move to MT 5.0.0 translation system 2019-10-17 21:05:08 +02:00
Panquesito7
4403b696be Replace deprecated functions with newer ones (#131)
These commits makes more compatibility with MT/MTG 5.0.0+ versions.
However, these commits breaks compatibility with the 0.4-series.
2019-06-16 10:26:40 +02:00
codexp
c1ab7277ab refactor code to use with intllib tool 2018-04-02 13:33:36 +02:00
Wuzzy
c816666945 Ensure formspec escaping for translated strings 2016-08-06 17:23:46 +02:00
Wuzzy
2a18e7357d Make default waypoint names translatable 2016-08-06 16:43:27 +02:00
Vanessa Ezekowitz
5df353c299 stop crash if HUD is returned nil (server too slow to emerge player) 2015-10-08 05:56:04 -04:00
Vanessa Ezekowitz
9fe84789ba Allow per-user "full" mode when "lite" mode is set as global
default (give the user "ui_full" priv to turn it on).

Also, a few whitespace fixes.
2015-10-05 04:24:01 -04:00
Tim
76a9efff71 reduce table lookups during initialization 2015-02-05 10:03:07 +01:00
Tim
1a1bfc3839 supress intllib check warning, this fixes #19 2015-02-05 10:00:10 +01:00
ShadowNinja
4fce317e2e Fix crash when changing waypoint name 2014-09-07 15:08:52 -04:00
ShadowNinja
527812fa96 Make waypoints optional and use external datastorage mod
This also fixes waypoints not showing up on join.
2014-07-06 17:39:20 -04:00
RealBadAngel
0d777362f3 Update tooltips usage due to core changes. 2014-06-24 12:39:12 +02:00
RealBadAngel
f800f39083 More tooltips and translations. 2014-06-22 00:34:35 +02:00
RealBadAngel
002bcbb6d8 Add intllib support.
Some polish and german translations.
Start adding tooltips.
2014-06-21 12:44:31 +02:00
RealBadAngel
833a255ad4 Some fixes to item_names and waypoints. 2014-05-26 11:43:25 +02:00
RealBadAngel
b9b2892f28 Add waypoints support (requires current minetest from git) 2014-05-05 09:39:03 +02:00