API Feedback and Testing Required: Simple Fast Inventory

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

API Feedback and Testing Required: Simple Fast Inventory

by rubenwardy » Thu Jul 07, 2016 15:08

Simple Fast Inventory is a new API that may be included in minetest_game that allows mods to register tabs in the inventory (I) formspec like creative does. I would like feedback and testing

Here is the PR: https://github.com/minetest/minetest_game/pull/1179

You can download minetest_game with sfinv here: https://github.com/rubenwardy/minetest_ ... /sfinv.zip

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
sfinv.register_page("mymod:crafting2", {
    title = "Crafting2",
    get = function(self, player, context, vars)
        return sfinv.make_formspec(player, context, vars, [[
                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.75;1,1;gui_hb_bg.png]
                image[1,4.75;1,1;gui_hb_bg.png]
                image[2,4.75;1,1;gui_hb_bg.png]
                image[3,4.75;1,1;gui_hb_bg.png]
                image[4,4.75;1,1;gui_hb_bg.png]
                image[5,4.75;1,1;gui_hb_bg.png]
                image[6,4.75;1,1;gui_hb_bg.png]
                image[7,4.75;1,1;gui_hb_bg.png]
            ]], true)
    end,
    on_player_receive_fields = function(self, player, context, fields)
        print(dump(fields))
    end
})


Image
Last edited by rubenwardy on Sat Aug 06, 2016 11:14, edited 1 time in total.
 

KCoombes
Member
 
Posts: 278
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt or Rudilyn

Re: API Feedback and Testing Required: Simple Fast Inventory

by KCoombes » Thu Jul 07, 2016 18:24

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
2016-07-07 14:21:58: ERROR[Main]: ServerError: Lua: Runtime error from mod 'sfinv' in callback on_playerReceiveFields(): ...2\bin\..\games\minetest_game\mods\creative/inventory.lua:53: attempt to index local 'inv' (a nil value)
2016-07-07 14:21:58: ERROR[Main]: stack traceback:
2016-07-07 14:21:58: ERROR[Main]:    ...2\bin\..\games\minetest_game\mods\creative/inventory.lua:53: in function 'update_creative_inventory'
2016-07-07 14:21:59: ERROR[Main]:    ...2\bin\..\games\minetest_game\mods\creative/inventory.lua:89: in function 'get_formspec'
2016-07-07 14:21:59: ERROR[Main]:    ...4.14-win32\bin\..\games\minetest_game\mods\sfinv/api.lua:93: in function 'set'
2016-07-07 14:21:59: ERROR[Main]:    ...4.14-win32\bin\..\games\minetest_game\mods\sfinv/api.lua:134: in function 'toregister'
2016-07-07 14:21:59: ERROR[Main]:    ...etest-0.4.14-win32\bin\..\builtin\game\mod_profiling.lua:154: in function <...etest-0.4.14-win32\bin\..\builtin\game\mod_profiling.lua:150>
2016-07-07 14:21:59: ERROR[Main]:    ...p\minetest-0.4.14-win32\bin\..\builtin\game\register.lua:369: in function <...p\minetest-0.4.14-win32\bin\..\builtin\game\register.lua:349>


Nope, but I love the idea!
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: API Feedback and Testing Required: Simple Fast Inventory

by rubenwardy » Thu Jul 07, 2016 19:06

That should never happen, as inv is created on join player. What did you do to cause that?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: API Feedback and Testing Required: Simple Fast Inventory

by rubenwardy » Thu Jul 07, 2016 19:09

Found the cause, you were trying to use creative when not actually in creative. Fixed.
 

KCoombes
Member
 
Posts: 278
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt or Rudilyn

Re: API Feedback and Testing Required: Simple Fast Inventory

by KCoombes » Thu Jul 07, 2016 19:22

Ah, no - I created a vanilla world to test it in, not in creative but no damage enabled - and the crash occurred when I clicked on a tab.

I have redownloaded and installed your fork - now I get no tabs at all!

screenshot_20160707_151654.png
screenshot_20160707_151654.png (176.5 KiB) Viewed 2881 times
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: API Feedback and Testing Required: Simple Fast Inventory

by rubenwardy » Thu Jul 07, 2016 19:41

You don't get any tabs because there is only one tab. Enable creative or define more tabs
 

KCoombes
Member
 
Posts: 278
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt or Rudilyn

Re: API Feedback and Testing Required: Simple Fast Inventory

by KCoombes » Thu Jul 07, 2016 19:43

Ah, now I see! Very awesome, sir!
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: API Feedback and Testing Required: Simple Fast Inventory

by azekill_DIABLO » Fri Jul 08, 2016 11:40

yes very nice!!!
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: API Feedback and Testing Required: Simple Fast Inventory

by rubenwardy » Fri Aug 05, 2016 20:48

Bump! I'd like testing
 

KCoombes
Member
 
Posts: 278
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt or Rudilyn

Re: API Feedback and Testing Required: Simple Fast Inventory

by KCoombes » Sat Aug 06, 2016 00:27

I did play with this a bit after my initial d/l - is there a limit to the number of tabs you can set? I was unable to set a 6th tab.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: API Feedback and Testing Required: Simple Fast Inventory

by rubenwardy » Sat Aug 06, 2016 00:35

It's only limited by the engine - there's probably not enough space
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: API Feedback and Testing Required: Simple Fast Inventory

by Byakuren » Sat Aug 06, 2016 02:39

What if you stacked tabs on top of each other vertically when they run out of space? Or have scroll buttons for tabs, or something similar.
Every time a mod API is left undocumented, a koala dies.
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: API Feedback and Testing Required: Simple Fast Inventory

by azekill_DIABLO » Sun Aug 07, 2016 13:48

no i think it's just that takes too much memory after all
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: API Feedback and Testing Required: Simple Fast Inventory

by rubenwardy » Sun Aug 07, 2016 13:50

azekill_DIABLO wrote:no i think it's just that takes too much memory after all


?

Memory won't be a problem, by space I meant screen space
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: API Feedback and Testing Required: Simple Fast Inventory

by azekill_DIABLO » Sun Aug 07, 2016 15:59

Oh. sorry. maybe make buttons with small icons would be better.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron