Repository navigation
Procedural Tools | Slots can have Tags now - #3005
Crepestrom wants to merge 33 commits into
Conversation
Wunka
left a comment
There was a problem hiding this comment.
As you have not linked it: https://discord.com/channels/443805812390100992/1103565202093506620/1499921286820921495
(where the idea came from)
this is an intersting change, but could not be the only way to do it...
Please create a corresponding issue with an explanation what the use case is.
|
Heh we are coming back to where we came from. |
Co-authored-by: Wunka <56411012+Wunka@users.noreply.github.com>
…strom/Cubyz into procedural-tools-slot-tags
|
Is there no better way to specify these? A boolean matrix seems kind of clunky and error prone. |
|
sure i transitioned it into the format the optional/disabled has |
|
Now that I think about it, optional and disable are also kind of tags, maybe it should all be defined in the same way? Could you also go with the more compact |
|
i will see if i can do that |
|
though optional and disable being seperate can be fine since those define how the workbench is layed out while the tags only interact with properties |
|
Oh I absolutely want materials that can only be placed on fields with specific tags, which is pretty similar to what optional does. |
|
i wont implement materials only being placed on certain tags yet but i see what you mean |
|
i was not able to compress the form of the ZonObjects as you specified |
|
if i were to modify disabled and optinal i would have to make the pr much bigger touching the workbench and inventory |
It should be easy to do, you just need to iterate over the internal hashmap |
| return result; | ||
| } | ||
|
|
||
| pub fn printTooltip(self: *const OnTopOf, outString: *main.List(u8)) void { |
There was a problem hiding this comment.
There was a problem hiding this comment.
was changed i just didnt send a message about it a while ago
| } | ||
|
|
||
| pub fn printTooltip(self: *const OnTopOf, outString: *main.ListManaged(u8)) void { | ||
| outString.print("on top of .{s}", .{self.tag.getName()}); |
There was a problem hiding this comment.
on tops of? I didn't know you can put multiple items into one slot.
Please chooses a more descriptive name here.
There was a problem hiding this comment.
im not sure what else to name it
if it is on top of a slot that has the tag its online
| @@ -634,6 +642,7 @@ pub const ProceduralItemType = struct { // MARK: ProceduralItemType | |||
| tags: []main.Tag, | |||
| properties: []PropertyMatrix, | |||
| slotInfos: [25]SlotInfo, | |||
There was a problem hiding this comment.
Please remove this, they should now be accessed through tags
There was a problem hiding this comment.
swapped over to tags
There was a problem hiding this comment.
This wasn't changed, maybe you forgot to push your changes?
There was a problem hiding this comment.
slot info no longer exists
| var it = zon.object.iterator(); | ||
| while (it.next()) |entry| { | ||
| if (std.mem.eql(u8, entry.key_ptr.*, "optional")) continue; | ||
| if (std.mem.eql(u8, entry.key_ptr.*, "disabled")) continue; |
There was a problem hiding this comment.
I think there is no reason not to make this information accessible to addons.
There was a problem hiding this comment.
could you provide more information
im not sure why it wouldnt be accessible by addons
There was a problem hiding this comment.
I mean you should treat these like normal slot tags, so they can be accessed by addons (e.g. to add effects if you are in an optional slot, or next to x disabled slots)
There was a problem hiding this comment.
sure i dont mind that then
There was a problem hiding this comment.
they have been changed to that
|
tagFeilds have been renamed to slotTags |
| } | ||
| pub fn slotInfos(self: ProceduralItemTypeIndex) *const [25]SlotInfo { | ||
| return &proceduralItemTypeList.items[@backingInt(self)].slotInfos; | ||
| pub fn slotTags(self: ProceduralItemTypeIndex) SlotTagContainer { |
There was a problem hiding this comment.
Why not just add a hasSlotTag function analogous to the other one you added? I don't see a benefit from having a seperate struct that is copied around for this.
There was a problem hiding this comment.
it has been removed
Defined along with a procedural tool you can define which tags a slot has
you can define a tool to have multiple tags in one slot
you define which slots each tag has in it
also adds a new modifier restriction (currently only used for branches)
on_top_of
if the thing is on top of a slot with a tag .head branches will have decreased durability
new modifier

modifier being applied