Replace sfinv mod from minetest_game with rubenwardy's version...

ContentDB: https://content.minetest.net/packages/rubenwardy/sfinv/
Commit: https://github.com/rubenwardy/sfinv/tree/556f70e
master
Jordan Irwin 2021-07-14 09:22:46 -07:00
parent 8884163443
commit 1116622490
26 changed files with 129 additions and 83 deletions

View File

@ -49,6 +49,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
* [farming][] ([MIT][lic.farming]) -- version: [dedc33c Git][ver.farming] *2021-05-07*
* inventory/
* [bags][] ([BSD 3-Clause][lic.bags]) -- version: [bc87b45 Git][ver.bags] *2018-04-11*
* [sfinv][] ([MIT][lic.sfinv] -- version: [556f70e Git][ver.sfinv] *2021-02-17*
* [sfinv_buttons][] ([MIT][lic.mit]) -- version [1.1.0 (ebb1f7c Git)][ver.sfinv_buttons] *2021-01-14*
* libs/
* [biome_lib][] ([LGPL][lic.lgpl3.0] / [CC BY-SA][lic.ccbysa4.0]) -- version: [2021-04-16-2][ver.biome_lib]
@ -357,6 +358,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[quartz]: https://forum.minetest.net/viewtopic.php?t=5682
[rainbow_ore]: https://forum.minetest.net/viewtopic.php?id=13519
[server_shop]: https://forum.minetest.net/viewtopic.php?t=26645
[sfinv]: https://content.minetest.net/packages/rubenwardy/sfinv/
[sfinv_buttons]: https://forum.minetest.net/viewtopic.php?t=16079
[shark]: https://github.com/AntumMT/mod-shark
[signs_lib]: https://forum.minetest.net/viewtopic.php?f=11&t=13762
@ -451,6 +453,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[lic.rainbow_ore]: mods/materials/rainbow_ore/README.md
[lic.sand_monster]: mods/mobiles/sand_monster/license.txt
[lic.server_shop]: mods/admin/server_shop/LICENSE.txt
[lic.sfinv]: mods/inventory/sfinv/LICENSE.txt
[lic.signs_lib]: mods/signs/signs_lib/copyright.txt
[lic.slingshot]: mods/equipment/slingshot/LICENSE.txt
[lic.sneeker]: mods/mobiles/sneeker/LICENSE.txt
@ -611,6 +614,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[ver.rainbow_ore]: https://github.com/FsxShader2012/rainbow_ore/tree/6e77693
[ver.sand_monster]: https://github.com/AntumMT/mod-mob_sand_monster/tree/3dd5954
[ver.server_shop]: https://github.com/AntumMT/mod-server_shop/releases/tag/v1.4
[ver.sfinv]: https://github.com/rubenwardy/sfinv/tree/556f70e
[ver.sfinv_buttons]: http://repo.or.cz/minetest_sfinv_buttons.git/tree/ebb1f7c
[ver.signs_lib]: https://gitlab.com/VanessaE/signs_lib/tree/2021-03-04-2
[ver.simple_protection]: https://github.com/SmallJoker/simple_protection/tree/3630fe9

View File

@ -1,18 +0,0 @@
Minetest Game mod: sfinv
========================
See license.txt for license information.
Simple Fast Inventory.
A cleaner, simpler, solution to having an advanced inventory in Minetest.
See game_api.txt for this mod's API.
Available for use outside of MTG here:
https://forum.minetest.net/viewtopic.php?t=19765
Authors of source code
----------------------
rubenwardy (MIT)
Authors of media
----------------
paramat (CC BY-SA 3.0):
sfinv_crafting_arrow.png - derived from a texture by BlockMen (CC BY-SA 3.0)

View File

@ -1,59 +0,0 @@
License of source code
----------------------
The MIT License (MIT)
Copyright (C) 2016-2018 rubenwardy <rubenwardy@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
For more details:
https://opensource.org/licenses/MIT
License of media
----------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2019 paramat
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/3.0/

View File

@ -1,2 +0,0 @@
# textdomain: sfinv
Crafting=nu zbasu

View File

@ -1,2 +0,0 @@
# textdomain: sfinv
Crafting=Construir

View File

@ -1,2 +0,0 @@
name = sfinv
description = Minetest Game mod: sfinv

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

View File

@ -0,0 +1,7 @@
Copyright (C) 2016 rubenwardy <rw@rubenwardy.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,116 @@
# Simple Fast Inventory
![SFINV Screeny](screenshot.png)
A cleaner, simpler solution to having an advanced inventory in Minetest.
Written by rubenwardy.\\
License: MIT
* sfinv_crafting_arrow.png - by paramat, derived from a texture by BlockMen (CC BY-SA 3.0).
## API
It is recommended that you read this link for a good introduction to the sfinv API
by its author: https://rubenwardy.com/minetest_modding_book/en/chapters/sfinv.html
### sfinv Methods
**Pages**
* sfinv.set_page(player, pagename) - changes the page
* sfinv.get_homepage_name(player) - get the page name of the first page to show to a player
* sfinv.register_page(name, def) - register a page, see section below
* sfinv.override_page(name, def) - overrides fields of an page registered with register_page.
* Note: Page must already be defined, (opt)depend on the mod defining it.
* sfinv.set_player_inventory_formspec(player) - (re)builds page formspec
and calls set_inventory_formspec().
* sfinv.get_formspec(player, context) - builds current page's formspec
**Contexts**
* sfinv.get_or_create_context(player) - gets the player's context
* sfinv.set_context(player, context)
**Theming**
* sfinv.make_formspec(player, context, content, show_inv, size) - adds a theme to a formspec
* show_inv, defaults to false. Whether to show the player's main inventory
* size, defaults to `size[8,8.6]` if not specified
* sfinv.get_nav_fs(player, context, nav, current_idx) - creates tabheader or ""
### sfinv Members
* pages - table of pages[pagename] = def
* pages_unordered - array table of pages in order of addition (used to build navigation tabs).
* contexts - contexts[playername] = player_context
* enabled - set to false to disable. Good for inventory rehaul mods like unified inventory
### Context
A table with these keys:
* page - current page name
* nav - a list of page names
* nav_titles - a list of page titles
* nav_idx - current nav index (in nav and nav_titles)
* any thing you want to store
* sfinv will clear the stored data on log out / log in
### sfinv.register_page
sfinv.register_page(name, def)
def is a table containing:
* `title` - human readable page name (required)
* `get(self, player, context)` - returns a formspec string. See formspec variables. (required)
* `is_in_nav(self, player, context)` - return true to show in the navigation (the tab header, by default)
* `on_player_receive_fields(self, player, context, fields)` - on formspec submit.
* `on_enter(self, player, context)` - called when the player changes pages, usually using the tabs.
* `on_leave(self, player, context)` - when leaving this page to go to another, called before other's on_enter
### get formspec
Use sfinv.make_formspec to apply a layout:
return sfinv.make_formspec(player, context, [[
list[current_player;craft;1.75,0.5;3,3;]
list[current_player;craftpreview;5.75,1.5;1,1;]
image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]
listring[current_player;main]
listring[current_player;craft]
image[0,4.25;1,1;gui_hb_bg.png]
image[1,4.25;1,1;gui_hb_bg.png]
image[2,4.25;1,1;gui_hb_bg.png]
image[3,4.25;1,1;gui_hb_bg.png]
image[4,4.25;1,1;gui_hb_bg.png]
image[5,4.25;1,1;gui_hb_bg.png]
image[6,4.25;1,1;gui_hb_bg.png]
image[7,4.25;1,1;gui_hb_bg.png]
]], true)
See above (methods section) for more options.
### Customising themes
Simply override this function to change the navigation:
function sfinv.get_nav_fs(player, context, nav, current_idx)
return "navformspec"
end
And override this function to change the layout:
function sfinv.make_formspec(player, context, content, show_inv, size)
local tmp = {
size or "size[8,8.6]",
theme_main,
sfinv.get_nav_fs(player, context, context.nav_titles, context.nav_idx),
content
}
if show_inv then
tmp[4] = theme_inv
end
return table.concat(tmp, "")
end

View File

@ -0,0 +1,2 @@
name = sfinv
description = A cleaner, simpler solution to having an advanced inventory in Minetest.

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B