AtilioA / BG3-MCM

🔧 Baldur's Gate 3 Mod Configuration Menu provides an in-game UI that enables players to intuitively manage mod settings.
https://wiki.bg3.community/Tutorials/Mod-Frameworks/mod-configuration-menu
GNU Affero General Public License v3.0
10 stars 1 forks source link

Refacto: rewrite VisibleIf Feat: manage LogicalOperator #11

Open mqueb opened 3 months ago

mqueb commented 3 months ago

here is the new one.

refcto of management of isVisible and more

mqueb commented 3 months ago

damn, u have change things ont it for people not using schema ... will adjust with your modifications

mqueb commented 3 months ago

What i've done.

mqueb commented 3 months ago

add isVisible operator. use case i need it:

settingX (a intSlider) is visible if settingA > 0 or settingB > 0 or setttingC > 0

SettingZ is visible if settingX > 0 (but if it's visible) so it's a (A>0 or B>0 or C>0) and X>0

Other usage is to make 2 setting share same visiblity without rewrite all conditioning

edit: ready to review, just tell if u want to move every visibility things to a dedicated file

AtilioA commented 3 months ago

Thank you for your effort on this PR. However, I feel that it adds too much complexity and opens up for technical debt (worsening maintenance) for an issue that has already been largely addressed. I have several mods already, so maintenance is very important to me.

mqueb commented 3 months ago

control over user input is far more maintainble as i write it. and it's done at one place and only once. Currently, it's validated each time, and in multiple method !!! chance of visibilityTrigger storage make it possible. it's the same with visibilityTrigger storage. it's far more simple than before. Moreover logicalOperator now work

mqueb commented 3 months ago

rebase and move to other class.

Noting to do with PR but: since my rebase, widget description are now next to le the (on le right). was under before: that was WAY better to read. even on my 34 UW, now it's nearly take all.