Beispiel #1
0
        private MySelectableListItem InsertTriggerIntoTheVisualList(Trigger trig)
        {
            Brush brush = new SolidColorBrush(Colors.Red);
            TriggerDefinitionPartProperties def = new TriggerDefinitionPartProperties();
            FrameworkElement g = trig.getTrigerListItem(def);

            def.g = (RichTextBox)g;
            MySelectableListItem item = new MySelectableListItem(new object[] { g, trig, def }, g);

            lstTriggers.Add(item);
            return(item);
        }
Beispiel #2
0
        private MySelectableListItem addVisualAction(Action act)
        {
            RichTextBox cb = new RichTextBox(); // Callback should change it, but it won't change the already added MySelectableListItem
            TriggerDefinitionPartProperties def = new TriggerDefinitionPartProperties();

            def.g = cb;
            Trigger.regenerateTextboxForTriggerDefinitionParts(def, act.getDefinitionParts, (RichTextBox qcb) => { cb = qcb; });
            MySelectableListItem item = new MySelectableListItem(new Object[] { cb, act, def }, cb);

            lstAct.Add(item);
            return(item);
        }
Beispiel #3
0
        private void updateLists()
        {
            lstPlayers.Clear();
            List <MySelectableListItem> pls = new List <MySelectableListItem>();

            foreach (KeyValuePair <PlayerDef, List <Trigger> > subList in Triggers.TriggerData)
            {
                PlayerDef      key   = subList.Key;
                List <Trigger> value = subList.Value;
                if (value.Count > 0)   // Category not empty
                {
                    Label lbl = new Label();
                    lbl.Content = key.ToString();
                    pls.Add(new MySelectableListItem(new object[] { key, lbl }, lbl));
                }
            }
            pls.Sort((MySelectableListItem item1, MySelectableListItem item2) => String.Compare(item1.ToString(), item2.ToString()));
            foreach (MySelectableListItem item in pls)
            {
                lstPlayers.Add(item);
            }
            //File.WriteAllText("gen.txt", getSaveString());
        }