terrarium-earth / Heracles

A tree style questing mod allowing creators to set completable quests for their users
MIT License
35 stars 19 forks source link

Granular quest hidden per status #103

Closed sisby-folk closed 1 year ago

sisby-folk commented 1 year ago

Closes #102

Changes hidden to be a QuestStatus representing the first state at which the quest should be visible. Renamed to hiddenUntil in code to better reflect this.

This means that hidden: "COMPLETED" matches FTB's old invisible property. current true becomes IN_PROGRESS, and false and undefined are now equivalent to LOCKED.

sisby-folk commented 1 year ago

Hmm, I've given this a try and I think old hidden:true stuff isn't correctly becoming hidden:QuestStatus.IN_PROGRESS - seems like a legacy codec issue - if you can see why let me know.

sisby-folk commented 1 year ago

Yeah so I think EnumCodecs intCodec is parsing false and true before the legacy boolean codec can.

Due to what I can only assume is parsing false as an int and then consuming it as an ordinal, false becomes COMPLETED, and true becomes IN_PROGRESS

A horrible workaround for this is to just flip the order of the enum as in 3f3681c, ditching the legacy codec entirely and using the int codec deliberately. This sucks, but it does work - Seeing as EnumCodec always encodes as const, this is potentially a non-issue in practice.