Commit Graph

74 Commits

Author SHA1 Message Date
bri cassa cb6e602497 Merge remote-tracking branch 'github/master' 2023-11-25 15:40:23 +01:00
SmallJoker 693ca112b8 Add setting to disable waypoints 2023-11-20 17:54:44 +01:00
fmmaks 43c9b50800
Add `unified_inventory_enable_item_names` setting (#235)
Show only names settings: in case of multi-line descriptions, only the first line is shown
Shorten long descriptions: Removes all characters after x index, and add `[...]`
Max length before truncation: x for Shorten long descriptions
Notes: If Max length == 0, then item names won't be displayed
2023-10-15 21:02:35 +02:00
bri cassa aa04d4539f Merge remote-tracking branch 'github/master' 2023-06-07 22:58:05 +02:00
fluxionary 826d5f4683
Add setting to hide disabled buttons (#217) 2022-10-26 10:05:03 +02:00
bri cassa 8c56e27c94 Merge remote-tracking branch 'github/master' 2022-05-27 18:54:23 +02:00
SmallJoker 477acd2f89
Change background to rounded corners (#200)
This change is supposed to match the rounded inventory slot design.
2022-04-03 22:30:21 +02:00
bri cassa 6da71e1819 Merge remote-tracking branch 'upstream/master' 2022-03-05 11:37:32 +01:00
SmallJoker dbe06be68b
Add scroll bar for overflowing tab buttons (#195) 2022-02-26 11:41:15 +01:00
SmallJoker 3074d625e2 Version 4: Feature checks and deprecate internal functions 2022-02-26 11:38:45 +01:00
bri cassa 4c4fb3ba88 Merge remote-tracking branch 'github/master' 2021-11-01 10:43:50 +01:00
Oversword 8c84751ff8
Add u_i initialization and craft registration callbacks (#184)
Main purpose: custom recipe sorting provided by cuszom mods.
2021-10-14 18:38:07 +02:00
bri cassa 9d66a21271 Merge remote-tracking branch 'upstream/master' 2021-08-31 20:12:45 +02:00
SmallJoker 3fffa41eaf Remove unused internal functions 2021-08-24 19:44:36 +02:00
bri cassa 15a84bdbf4 Merge remote-tracking branch 'upstream/master' 2021-07-24 13:14:48 +02:00
SmallJoker d39dd78cb5 Use player meta for waypoints 2021-07-20 20:41:23 +02:00
bri cassa 838c67ae86 Merge remote-tracking branch 'upstream/master' 2021-07-17 20:48:14 +02:00
SmallJoker aeb9841e3a Remove default hard dependency for use in devtest 2021-07-17 10:35:39 +02:00
bri cassa 03b077cd1b Merge remote-tracking branch 'upstream/master' 2021-04-08 13:39:49 +02:00
Oversword 6e6383f082
Add filter-by-category functionality (#171)
- Added API for configuring categories
- Added display for categories above page
- Reduced height of page by 1 row to make room for categories
- Added L/R scroll through when there are more categories than columns
- Added pre-filter methods for categories and uncategorised items
- Added categories for (most) items in the default game


Co-authored-by: Oversword <bionc:oversword.co.uk>
2021-04-05 20:07:14 +02:00
bri cassa 829b38c6fc Merge remote-tracking branch 'upstream/master' 2021-04-04 21:05:40 +02:00
Vanessa Dannenberg 860371ecf8 more consistent formspec size decision 2021-03-31 00:52:30 -04:00
bri cassa 70fdb8556b Merge remote-tracking branch 'upstream/master' 2021-03-12 12:01:23 +01:00
Vanessa Dannenberg a84ce24067 use the ui.list_img_offset variable for offsetting the std inv list[]
so that it'll match every other list that uses it.
2021-03-09 18:31:16 -05:00
Vanessa Dannenberg 97b882ad23 add a version number variable to the main table 2021-03-09 15:04:11 -05:00
Vanessa Dannenberg 40d862298b replace excessive spaces with tabs 2021-03-09 15:04:11 -05:00
Vanessa Dannenberg dc61d2980a Move craft guide a little to the right to make some room. 2021-03-09 15:04:11 -05:00
Vanessa Dannenberg 76c9bb9517 Use 9-slicing to build inventory-type backgrounds
This way the slots are all nice and crisp regardless of GUI scale or
image size, and we only need the single slot and its bright version.

This also makes the standard crafting grid into a style table entry that
can be referenced to insert the crafting grid at its proper
style-specific position in any formspec.

And it also makes the craft grid arrow, its X position, and the crafting
grid's result slot X position into style table entries.

Includes a few public helper functions to do most of the work:

`ui.single_slot(xpos, ypos, bright)`

    Does just what it sounds like: it returns a single slot image.
    `xpos` and `ypos` are normal coordinates in slots, as you'd use in
    `image[]` element.  `bright` is a flag that switches to the brighter
    version of the slot image.

`ui.make_trash_slot(xpos, ypos)`

    Creates a single slot, with a one-item `list[]` and a trash can icon
    overlay.

`ui.make_inv_img_grid(xpos, ypos, width, height, bright)`

    Generates a `width` by `height` grid of slot images, using the
    single_slot function above, starting at (`xpos`,`ypos`) for the
    top-left.  Position is as in any `image[]` element, and dimensions
    are in integer numbers of slots (so 8,4 would be a standard inventory).
    `bright` is as above.

All three return a string that can be directly inserted into a formspec.
2021-03-09 15:04:11 -05:00
Vanessa Dannenberg 60d7a6d213 Draw the trash slot by overlaying the bare trash can icon
over the single slot image instead of baking it in.
2021-03-09 15:04:11 -05:00
Vanessa Dannenberg 6d892dda5b use local ui=unified_inventory shorthand in init.lua as elsewhere 2021-03-09 15:04:11 -05:00
Vanessa Dannenberg 37546289bc 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-09 15:04:11 -05:00
Vanessa Dannenberg 5a8a75f43b put style-specific settings in their own tables
and switch between them directly, instead of copy-and-modify.
2021-03-09 15:04:11 -05:00
Vanessa Dannenberg 82bc2d3f95 use string.format() to create the standard_inv variables
do it just once, after the lite mode settings are applied
(if applicable)
2021-03-09 15:04:11 -05:00
Vanessa Dannenberg 603b5d1d4e get rid of `uninv` global
make all uses of it back into `unified_inventory.`
2021-03-09 15:04:11 -05:00
Vanessa Dannenberg eb4cf5bf47 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-09 15:04:11 -05:00
Vanessa Dannenberg 97960c552b increase size and tweak position of "give/to grid" buttons
and make them vary in pos with lite vs full mode
2021-03-09 15:04:11 -05:00
Vanessa Dannenberg 81d6a1e796 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-09 15:04:11 -05:00
Vanessa Dannenberg de575a6513 9-slice the background image 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
Sys Quatre 8e6a3740ae Merge branch 'master' of yunohost.local:minetest-mods/unified_inventory into nalc-1.2-dev 2019-12-22 15:57:28 +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
sys4-fr 4f666f93d0 Ajoute message de chargement du mod dans le journal "action" 2019-01-19 19:43:04 +01: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