Gerold55 / laptop

Introducing the MineTest Laptop Mod
Other
26 stars 14 forks source link

Inventory Page #93

Open Gerold55 opened 6 years ago

Gerold55 commented 6 years ago

I'm wanting to make a page that just shows the items/nodes from the mod itself can I get some help on this?

Grizzly-Adam commented 6 years ago

Tell us more. What items-- just the main mod or the addons as well? All items or just user obtainable ones? To what purpose and in what kind of interface?

Gerold55 commented 6 years ago

So it should include the addons and it would be a separate page from the rest of the inventory and would work sort of like the nodes section of the MT default inventory. It should only have laptop related stuff. I also wanna do something similar for the furniture mod.

Grizzly-Adam commented 6 years ago

How do yoy plan to trigger it? Maybe a PC mag? Or just a boring button on the inventory screen?

Gerold55 commented 6 years ago

I'm not completely sure what do you propose?

Grizzly-Adam commented 6 years ago

It depends on what the purpose of this page is. Im still not on the aame page as you as to what the goal is.

Gerold55 commented 6 years ago

To have a dedicated page for the mod's nodes and items. So it'll be easier to find them instead of scrolling it'll be just one click and you can see the nodes/items from the mod.

Grizzly-Adam commented 6 years ago

The ones you currently have? Or all you coukd get?

Gerold55 commented 6 years ago

What do you mean? It should be just for this mod alone. I want to do something similar for my other mod also. But it needs to be able to include all of the addons too.

Grizzly-Adam commented 6 years ago

Do you want it to show everyrhing in the packs or just what is in the player's inventory?

Gerold55 commented 6 years ago

Everything in the mod & packs/addons. But it would be a creative inventory just for those.

Grizzly-Adam commented 6 years ago

Ok. I will brainstorm on it.

Gerold55 commented 6 years ago

local myitems = {} for _, item in ipairs (minetest.registered_items) do if item.mod_origin == 'mymod' then table.insert(myitems, item) end end creative.register_tab("myitems", "MyItems", myitems)

Code from @Bell07 this is for the inventory page hope this helps @Grizzly-Adam

Grizzly-Adam commented 6 years ago

I will look at it. Can I make a suggestion?

What if in the pc packs you used :laptop mod names like I did in the media pack so everything is in the laptop category?

bell07 commented 6 years ago

Why we need this?

I do not like the idea because "creative" does not filter out the items from other views. So the laptops are still visible as "nodes" and the floppies still as "items". To filter them out is hacky because not provided by any API.

What if in the pc packs you used :laptop mod names like I did in the media pack so everything is in the laptop category?

The item.mod_origin is still the "original" mod name. Then it is better to use a custom group.

Gerold55 commented 6 years ago

I thought that it would be good to also have a separate page for it on the inventory.

Grizzly-Adam commented 6 years ago

If people search "laptop" and the "pc" they will get everything in those two searches. Thats why I was thinking to would be better to have pc pack computers registered as :laptop

Grizzly-Adam commented 6 years ago

Then if theybsearch laptop, they would get everything.

bell07 commented 6 years ago

:laptop is bad practice, but OK if the goal is to add the nodes later to the laptop mod ;-) laptop_pack: can be found by seaching for laptop too ;-) The name should be descriptive. If you add '80ies computers, the mod:computer could be "laptop_80ies:8088 for example.

We have the other issue the node names are not descriptive. Why pentium-3 is called monitor3 for example? My proposal is to cleanup the names at the first

Grizzly-Adam commented 6 years ago

That sounds like a good workaround. Even laptop_pc1 for the pc pack would be a good option.

Grizzly-Adam commented 6 years ago

To get really technical, its "laptop" really the best name for the mod when it seems to be much more than that. Computers would be more appropriate, but not PC because that specifically means IBM /Intel type computers.

bell07 commented 6 years ago

The name "laptop" is the original name as the mod contains the laptop:core only, and before I wrote the OS for them. I like the name because it is unique. They are already some "computer" and "computers" mods so it could be confusing to use the same names too..