Page 1 of 1

Using LuaConditionWizard in a List

Posted: Fri May 13, 2022 3:12 am
by JoeHooijmaijers
I'm trying to use the [LuaConditionWizard] attribute on a string in a serialized class in a list.
For some reason this causes the wizard to edit the string in ALL classes in that list, as long as they are visible.
The only workaround for now is to edit the string using the conditionwizard, close the element in the list, click off the object, click back on the object, open the next element in the list and repeat.
Did I do something wrong to get this behaviour?
I made a quick gif of what happens, hope that helps
https://i.gyazo.com/c959e5d0601e7359b06 ... 91b0b5.mp4

Re: Using LuaConditionWizard in a List

Posted: Fri May 13, 2022 8:27 am
by Tony Li
Hi,

That looks like a bug. I'll investigate and get back to you here.

Re: Using LuaConditionWizard in a List

Posted: Fri May 13, 2022 2:51 pm
by Tony Li
I'm having trouble reproducing the issue, although I can clearly see it in your gif.

Can you share the class/struct definitions for List Of Check Items?

Are you using any inspector add-ons such as Odin Inspector?

What version of Unity are you using?

Are you using the latest version of the Dialogue System? (2.2.27 as of this message.)

Re: Using LuaConditionWizard in a List

Posted: Tue May 17, 2022 7:00 am
by JoeHooijmaijers
Hey Tony,

Thanks for the quick reply.
I'm not using any inspector addon. I'm working in Unity version 2020.3.30f1.
This is the ScriptableObject holding the serialized class

Code: Select all

public class SO_Checklist : ScriptableObject
{
    [SerializeField] private int CaseId;
    [TextArea(2,3)][SerializeField] private string ProtocolName;
    [TextArea(3, 10)][SerializeField] private string ProtocolDescription;
    [SerializeField] private List<SO_CheckItem> ListOfCheckItems; //This is where the LuaConditionWizard is used
    public List<SO_CheckItem> Checklist => ListOfCheckItems;
    [SerializeField] private float MaxAchievedGrade;
    private bool _isInitialized = false;
    //Some more stuff
    }
And this is the Serialized class

Code: Select all

[Serializable]
public class SO_CheckItem
{
    private int _id;
    [SerializeField] private string _name;
    [TextArea(3, 5)][SerializeField] private string _description;
    [LuaConditionsWizard][SerializeField] private string ConditionalString = ""; //This is where the problem occurs
    [SerializeField][VariablePopup] private string CompletionString;
    private string _completionString;
    public string EventString => _completionString;
    public bool Complete => _grading.Complete;
    public GradeData _grading;
    //Some more stuff
    }
    
I hope this information will help.

Re: Using LuaConditionWizard in a List

Posted: Tue May 17, 2022 7:01 am
by JoeHooijmaijers
Oh, forgot to add, I'm currently using Dialogue System version 2.2.27

Re: Using LuaConditionWizard in a List

Posted: Tue May 17, 2022 10:42 am
by Tony Li
Thanks for the info. I'm not able to reproduce that exact issue, but there's a known issue with the custom editor that is on the roadmap to be fixed in version 2.2.28.

Re: Using LuaConditionWizard in a List

Posted: Tue May 17, 2022 2:15 pm
by JoeHooijmaijers
Thank you again for the lightning fast reply. I hope the 2.2.28 release will fix the issue, and otherwiseI'll fiddle with some of my settings to see if the problem lies there or I'll simply change my class structure a bit to circumvent the problem entirely.
Keep up the good work!