[Mod] Inventory Icon [1.1.0] [inventory_icon]

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

[Mod] Inventory Icon [1.1.0] [inventory_icon]

by Wuzzy » Sat May 30, 2015 23:56

This mod shows a backpack icon at the bottom right of the HUD. It shows the number of free and maximum slots in your main inventory. The backback icon turns red when all slots are occupied.

Image

There is also optional support for the bags from the mods “Unified Inventory” and “Bags”. If one of these mods are used, additional bag icons (if bags are present) are displayed.

Image

Dependencies: None!
Optional dependencies:
Code license: MIT License
License of graphics: Overall: CC-BY-SA 3.0 Unported.
+ Detailed license of graphics

Download: See attachment
Project page (with Git repository links): http://repo.or.cz/w/minetest_inventory_icon.git
Current version: 1.1.0
Attachments
screenshot.png
Mod in action together with Unified Inventory's bags.
screenshot.png (7.11 KiB) Viewed 928 times
inventory_icon1.1.0.zip
(12.64 KiB) Downloaded 97 times
Unbenannt2.png
Preview of inventory icons
Unbenannt2.png (4.12 KiB) Viewed 928 times
Last edited by Wuzzy on Sat Nov 12, 2016 21:07, edited 8 times in total.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Inventory Icon [0.1.0] [inventory_icon]

by Krock » Sun May 31, 2015 06:32

Interesting idea.
What if the inventory is filled with dirt nodes (1 dirt per stack)?
My idea is to count each type in the inventory and then divide by its stack size then use math.ceil to get a more realistic number.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun

Re: [Mod] Inventory Icon [0.1.0] [inventory_icon]

by Minetestforfun » Sun May 31, 2015 09:29

I like the idea, it will be tested in my server soon :)

Thank you for your work Wuzzy
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: [Mod] Inventory Icon [0.1.0] [inventory_icon]

by Sokomine » Sun May 31, 2015 11:35

This might be of special intrest in combination with the bags mod. A quick glance as to which bag still has free space might be very helpful.
A list of my mods can be found here.
 

User avatar
addi
Member
 
Posts: 605
Joined: Thu Sep 20, 2012 03:16

Re: [Mod] Inventory Icon [0.1.0] [inventory_icon]

by addi » Sun May 31, 2015 14:00

really interesting.

maybe you can use [colorize to create smooth colour gradients into red.
 

User avatar
srifqi
Member
 
Posts: 508
Joined: Sat Jun 28, 2014 04:31
GitHub: srifqi
IRC: srifqi
In-game: srifqi

Re: [Mod] Inventory Icon [0.1.0] [inventory_icon]

by srifqi » Sun May 31, 2015 16:51

Nice idea!
Sometimes, while mining, the mined items are dropped. Checked the inventory and it's full!
I'm from Indonesia! Saya dari Indonesia!
Terjemahkan Minetest!
Mods by me. Modifikasi oleh saya.

Pronounce my nick as in: es-rifqi (IPA: /es rifˈki/)
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 0.2.0

by Wuzzy » Tue Jun 23, 2015 19:49

Following Sokomine's request, I have added support for showing the free space of the bags if you use the Unified Inventory mod. Here is a screenshot:

Image

You can download the new version 0.2.0 from the first post.
If anyone of you knows more mods which add additional inventory-related stuff and you think these deserve support by this mod, please write here.

Also report any bugs and weirdnesses you encounter when using this mod.

Have fun!


Further notes: I have decided to not use a gradient into red. I guess the difference of color of “full” vs “almost full” would not be really distinguishable.
I also decided to keep the way the numbers are displayed as of now. Even if all slots are filled with only 1 dirt, you can't collect new items anymore (except dirt), so I want solely count occupied slots. And yes, 1 dirt on a slot makes the slot be counted as “occupied”.
Also, Krock, I don't see a viable alternative here. Remember that each item type may have a different maximum stack size, so this would not allow to display any exact numbers. And you also didn't say how to treat the empty slots with your method.
I stick with the raw inventory slots for now, because its simple and straight-forward. It is easy to implement and easy to understand.
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: [Mod] Inventory Icon [0.2.0] [inventory_icon]

by Sokomine » Wed Jun 24, 2015 15:23

Wuzzy wrote:Following Sokomine's request, I have added support for showing the free space of the bags if you use the Unified Inventory mod. Here is a screenshot:

Looks very nice! I hope it gets added to many servers soon.
A list of my mods can be found here.
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Inventory Icon [1.0.0] [inventory_icon]

by Wuzzy » Wed Jul 01, 2015 19:56

Version 1.0.0 released!

The mod now provides its own bag icons, so the bags are displayed correctly even if a texture pack overwrites the original bag icons and changes their size. If I would not do that, the bag icons could be displayed incorrectly when using a texture pack.


Note to modders / texture pack makers: If you provide your own bags for Unified Inventory, please notify me. Or you may just add your inventory_icon-optimized icon to your mod. It must have a size of 32×32 and follow this naming convention:
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
"inventory_icon_" .. ORIGINAL_FILE_NAME


For “bags_small.png", add the icon “inventory_icon_bags_small.png".

Edit: I uploaded a very minor update, I have messed up the credits in the README, version 1.0.1 should fix this.
 

User avatar
mahmutelmas06
Member
 
Posts: 355
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: [Mod] Inventory Icon [1.0.1] [inventory_icon]

by mahmutelmas06 » Sun Jul 05, 2015 14:40

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
2015-07-05 17:35:57: ERROR[main]: ServerError: ...Minetest\bin\..\mods\Hud_Modpack\inventory_icon\init.lua:53: attempt to index local 'bags_inv' (a nil value)
2015-07-05 17:35:57: ERROR[main]: stack traceback:
2015-07-05 17:35:57: ERROR[main]:    ...Minetest\bin\..\mods\Hud_Modpack\inventory_icon\init.lua:53: in function <...Minetest\bin\..\mods\Hud_Modpack\inventory_icon\init.lua:22>
2015-07-05 17:35:57: ERROR[main]:    D:\Oyun\Kurulan\Minetest\bin\..\builtin\game\register.lua:341: in function <D:\Oyun\Kurulan\Minetest\bin\..\builtin\game\register.lua:329>
My Mods:

Beverage
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Inventory Icon [1.0.1] [inventory_icon]

by Wuzzy » Mon Jul 06, 2015 06:01

You can't just paste random debug log snippets into a thread and hope a bug gets fixed.

Okay, so apparently something is nil, but I still need the following information to be sure:
  • So what exactly happened?
  • What did you do before this happened?
  • When/Under which circumstances did this happen?
  • Does this bug happen reliably?
  • How do you reproduce this bug? (If you know it.)
  • Did you use Unified Inventory?
  • Which bags were in your bag slots when this happened?
  • Did you have items in the main inventory, in the bags?
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Inventory Icon [1.0.1] [inventory_icon]

by TenPlus1 » Mon Jul 06, 2015 07:19

It seems that the soft dependency for unified_inventory is causing the error, since UI was loading after the inventory_icon mod so that the detached name.."_bags" inventories are not loaded before your mod is trying to display them when a player joins...

To fix this you can either make unified_inventory a proper depencency (remove the ? in depends.txt) or editing on_joinplayer for your own mod, have it wait a second or two using minetest.after() before displaying bags...
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Inventory Icon [1.0.1] [inventory_icon]

by Wuzzy » Mon Jul 06, 2015 11:40

If Unified Inventory really loads *after* Inventory Icon, even if I added it as optional dependency, then what are optional dependencies good for? I think they would be completely useless. But I doubt that this is actually the case.

And how do you know that Unified Inventory was loaded after Inventory Icon, anyways? I have tested it for myselves: I have added minetest.log lines at the end of init.lua of both mods. According to my log, Inventory Icon was the mod which was loaded later.
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Inventory Icon [1.0.1] [inventory_icon]

by TenPlus1 » Mon Jul 06, 2015 12:26

While the mod works fine on my own system it *could* load both mods so quick that the name.."bags" inventory isn't set before the on_joinplayer routine of this mod tries to display it's numbered contents in the corner... What I propose is basic error checking to stop this from happening...
 

User avatar
mahmutelmas06
Member
 
Posts: 355
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: [Mod] Inventory Icon [1.0.1] [inventory_icon]

by mahmutelmas06 » Tue Jul 07, 2015 01:01

i use unified inventory lite version. it happens on even new created world if unified inventory lite enabled.
My Mods:

Beverage
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 1.1.0 released!

by Wuzzy » Sat Nov 12, 2016 20:31

Version 1.1.0 released!

Updates:
- Mod is now compatible with the original Bags [bags] mod as well.
- Intllib support
- German translation
- Code is now under MIT License
- Update metadata files (mod.conf, screenshot)
- Use the original bags icons from the mods which supply them instead of distributing them as additional (and redundant) files. This will make life easier for texture pack authors
- Refactor code

Sorry, mahmutelmas06, I haven't gotten around in fixing your reported bug yet. :-( I am also still not sure if this bug is really the fault of this mod.

Edit: Sorry, I can not reproduce the bug you reported, even in lite mode. But for some reason, something seems to be wrong with Unified Inventory as well. In lite mode, the bags button is hidden. WTF?! But honestly, I would personally prefer if Unified Inventory removes the bags and instead the bags are released as seperate mod (maybe optionally) depending on Unified Inventory. It would be less pain for all of us.

Still, if you really want to help in fixing this bug, more information is important. Can you please answer the other questions I asked? Also, can you please test if the bug still applies to you after upgrading Unified Inventory and Inventory Icon to the newest versions?



EDIT 2: mahmutelmas06: Can you please download the following test version?:
http://repo.or.cz/minetest_inventory_ic ... aa4a22.zip
And tell me if the bug still applies to you?
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
mahmutelmas06
Member
 
Posts: 355
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: [Mod] Inventory Icon [1.1.0] [inventory_icon]

by mahmutelmas06 » Sun Nov 13, 2016 11:33

Thank you for considering the bug.
But it seems everything works fine on both versions. ( Test and stable )
My Mods:

Beverage
 


Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 9 guests

cron