Commit Graph

44 Commits

Author SHA1 Message Date
Vanessa Dannenberg
d063af1d27 Draw the trash slot by overlaying the bare trash can icon
over the single slot image instead of baking it in.
2021-03-08 09:53:25 -05:00
Vanessa Dannenberg
8a7d8268ad use local ui=unified_inventory shorthand in init.lua as elsewhere 2021-03-08 05:10:16 -05:00
Vanessa Dannenberg
51de368949 using a table.copy() to pass the style tables around requires
setting-up items_per_page, standard_inv, and standard_inv_bg
for both tables at init time.
2021-03-08 05:10:16 -05:00
Vanessa Dannenberg
4d52ebe774 put style-specific settings in their own tables
and switch between them directly, instead of copy-and-modify.
2021-03-08 05:10:00 -05:00
Vanessa Dannenberg
8056bdf966 use string.format() to create the standard_inv variables
do it just once, after the lite mode settings are applied
(if applicable)
2021-03-08 05:10:00 -05:00
Vanessa Dannenberg
7e27f584eb get rid of uninv global
make all uses of it back into `unified_inventory.`
2021-03-08 05:09:54 -05:00
Vanessa Dannenberg
5140853a3a increase spacing around the text above the items page
("Filter:" and its search key, and the page or "No matches)
Adjust main and page flipping buttons' positions to compensate
2021-03-07 04:26:11 -05:00
Vanessa Dannenberg
a0c06516f4 increase size and tweak position of "give/to grid" buttons
and make them vary in pos with lite vs full mode
2021-03-07 04:13:36 -05:00
Vanessa Dannenberg
5ec4b986bb shift the craft grid and guide down a bit
to make more room for the result string
(and shift the result string down a hair to follow)
2021-03-07 03:57:39 -05:00
Vanessa Dannenberg
0616d1f76b 9-slice the background image 2021-03-06 19:05:27 -05:00
Vanessa Dannenberg
e8e1d4d705 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-06 13:22:20 -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
Andrey Kozlovskiy
ca6d9a10df Implement new crafting algorithm (#132)
* Implement new crafting algorithm

* Take craft width into account when creating craft index
* Fix moving logic, correctly check for empty stacks
* Return early when there's not enough items for craft
* Bound match_count with smallest stack_max value, take from inventory only if needed
* Continue if item can't be moved to the current position.
* Fix metadata loss and. Improve placement for some corner cases.
* Drop items from oversized stacks on the ground
* Place items exactly as displayed in the guide
* One source list one destination. Try to take from destination list first
2019-10-26 17:22:33 +02:00
Wuzzy
5327261718 Move to MT 5.0.0 translation system 2019-10-17 21:05:08 +02:00
codexp
3988f4c572 Merge origin/master to refactor-translation branch (resolving conflicts) 2018-06-23 15:37:13 +02:00
SmallJoker
edd00f222c Replace deprecated function names, unify creative check 2018-06-23 15:02:23 +02:00
codexp
c1ab7277ab refactor code to use with intllib tool 2018-04-02 13:33:36 +02:00
ForbiddenJ
7ab8825460 Make trash configurable but preserve default functionality 2017-03-01 16:28:40 -06:00
Vanessa Ezekowitz
e6c380d8c5 allow user to disable bags
via minetest.conf --> unified_inventory_bags = false

(default is to enable)
2016-11-28 14:46:42 -05:00
rubenwardy
59f52fd481 Disable sfinv if installed 2016-11-26 21:30:59 +00:00
Diego Martínez
75a0e6a318 Bags: Code cleanup and per-bag trash slot.
* Turn page creation into a loop.
* Add per-bag trash slot.
* Changed i18n to allow replacements.
2016-11-17 19:19:51 -03:00
Wuzzy
c816666945 Ensure formspec escaping for translated strings 2016-08-06 17:23:46 +02:00
RealBadAngel
758b643c4d Check for both old and new default creative mod name 2016-02-12 03:19:03 +01:00
kilbith
f3127e9d7c Fix disabling of default creative inventory (fixes #46)
The function prefix in upstream has changed.
2016-02-08 13:07:23 +01: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
Vanessa Ezekowitz
16e40a2e22 re-arrange a few elements in the crafting guide to eliminate text overlap
Also make sure to chech if lite mode before assuming 4x2 "tab" button layout.
2015-06-28 04:54:48 -04:00
Vanessa Ezekowitz
0a70d8edef Add "lite" mode
Set unified_inventory_lite = true in minetest.conf to enable.

This mode reduces the feature-set of the mod as follows:

* no bags
* no waypoints,
* no home/go-home buttons,
* no set-day/-night buttons,
* smaller creative/craft guide inventory pages (4x6 instead of 8x10)
* fewer paging buttons
* smaller search field
* move "Result: foo" to below the crafting guide grid.
* Move main "tab" buttons to the right, below the search and paging buttons.
* Made "tab" buttons able to use to 2 rows if necessary (max 8 buttons)
2015-06-28 04:15:55 -04:00
Tim
76a9efff71 reduce table lookups during initialization 2015-02-05 10:03:07 +01:00
Tim
1a962542e6 supress intentional creative_inventory check warning, this fixes #18 2015-02-05 09:58:15 +01: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
Zefram
87f502a259 Show item usages in craft guide
When the craft guide is showing a craft, the output slot is now a button,
which causes the craft guide to show ways in which that output can be
used.  This mirrors the way input slots are buttons that show recipes
for the selected ingredient.  Usages of an item can be iterated through
in the same way as recipes for the item.  This incidentally offers some
ability to retrace one's steps through a crafting chain, without storing
actual history.
2014-06-13 11:30:09 -03:00
RealBadAngel
b46f4217ae Item names hud element (based on 4aiman mod) 2014-05-26 05:41:40 +02:00
ShadowNinja
043f608145 Move around some group code and make the craftguide render well without a recipe
This also keeps recipes aligned to the right, close to the arrow.
It also calculates the craft's height.
2014-05-11 22:00:32 -04:00
RealBadAngel
b9b2892f28 Add waypoints support (requires current minetest from git) 2014-05-05 09:39:03 +02:00
Zefram
b492701915 Show group ingredients visually in craft guide
Where a recipe specifies an ingredient by group, show a typical group
item pictorially, with a label flag to indicate that it's a group rather
than the single item.  This is the inverse of the previous arrangement,
which identified the group by label and dipicted groupiness pictorially.
The new arrangement is easier to interpret, and if the labels are ignored
it actually shows a correct input to the crafting grid.
2014-05-02 12:19:17 +02:00
Zefram
580a832fda Use appropriate grid shape for each craft type
New system of registration of craft types, recording for each a display
description and the appropriate grid shape.  Recipes of a registered type
are shown in the correct grid.  Recipes of unregistered craft types are
still displayed as before, using the default 3x3 grid.
2014-04-30 00:11:10 +01:00
Zefram
01297996a6 Preserve player's search string
Keep the current inventory search string when performing inventory
form actions other than searching.  This means the player's input is
not lost if the player breaks off from entering it to switch pages,
or if the player absent-mindedly ends text input with <return>.
2014-04-29 19:36:52 +01:00
ShadowNinja
26473a8346 Remove trailing whitespace 2014-01-19 13:27:52 -05:00
ShadowNinja
f974fd8c2c Update 2013-09-28 18:15:37 -04:00
RealBadAngel
e3d391d63f Update mod 2013-09-21 21:40:20 +02:00
RealBadAngel
43e308a815 New version:
another structure, its a modpack now
searches are not case sensitive
2012-12-11 00:48:23 +01:00
RealBadAngel
5baccadd93 0.91 release 2012-12-03 23:36:15 +01:00
RealBadAngel
35e91348dd quick fix 2012-12-02 21:14:19 +01:00
RealBadAngel
216078a0f8 1st release 2012-12-02 10:08:32 +01:00