static void Update(Maid maid, string PluginName)
    {
        if (!maid.Visible)
        {
            return;
        }
        string         fname          = ExSaveData.Get(maid, PluginName, "SLIDER_TEMPLATE", null);
        SliderTemplate sliderTemplate = sliderTemplates.Get(fname);

        if (sliderTemplate != null && !sliderTemplate.IsLoaded)
        {
            sliderTemplate.WriteProps(maid);
            sliderTemplate.IsLoaded = true;
        }
    }
Beispiel #2
0
    static void Update(Maid maid, string PluginName)
    {
        if (!maid.Visible)
        {
            return;
        }
        string         fname          = ExSaveData.Get(maid, PluginName, "SLIDER_TEMPLATE", "UnityInjector/Config/MaidVoicePitchSlider.xml");
        SliderTemplate sliderTemplate = sliderTemplates.Get(fname);
        string         guid           = maid.Param.status.guid;

        if (sliderTemplate != null && !sliderTemplate.LoadedMaidGuids.Contains(guid))
        {
            sliderTemplate.WriteProps(maid);
            sliderTemplate.LoadedMaidGuids.Add(guid);
        }
    }
Beispiel #3
0
        protected override void OnSettingUp()
        {
            base.OnSettingUp();

            var nameTemplate = new TextEntryTemplate
            {
                Label             = "Name: ",
                MaximumCharacters = 20,
//                                  HasFrameBorder = false,
                TopLeftPos           = new Point(2, 2),
                Tooltip              = "Enter your character's name",
                StartingField        = "player",
                CanHaveKeyboardFocus = true,
                Pigments             = new PigmentAlternatives()
                {
                    { PigmentType.FrameNormal, new Pigment(ColorPresets.White, ColorPresets.Black) },
                    { PigmentType.ViewNormal, new Pigment(ColorPresets.White, ColorPresets.Black) },
                    { PigmentType.ViewSelected, new Pigment(ColorPresets.Green, ColorPresets.Black) }
                }
            };

            _nameEntry = new TextEntry(nameTemplate);

            AddControl(_nameEntry);

            var jobs = new List <ListItemData>();

            for (int i = 0; i < 2; i++)
            {
                jobs.Add(new ListItemData("jobs" + i));
            }

            var occupationTemplate = new ListBoxTemplate()
            {
                Title               = "Occupation",
                TitleAlignment      = HorizontalAlignment.Center,
                MinimumListBoxWidth = 15,
                FrameTitle          = true,
                AutoSizeOverride    = new Size(15, 10),
                Items               = jobs
            };

            occupationTemplate.AlignTo(LayoutDirection.South, nameTemplate);
            _occupationListBox = new ListBox(occupationTemplate);
            AddControl(_occupationListBox);
            jobs.Add(new ListItemData("test"));

            var sexTemplate = new MenuButtonTemplate()
            {
                Label = "Sex",
                //                                  MinimumWidth = 15,
                TopLeftPos = nameTemplate.CalculateRect().TopRight.Shift(2, 0),
                //                                  Tooltip = "Click to switch sex, right click to choose from a menu",
                Items = new List <string>()
                {
                    "Male",
                    "Female"
                },
            };

            _sexButton = new MenuButton(sexTemplate);
            AddControl(_sexButton);

            var nodes = new List <TreeNode>();
            int index = 0;

            for (int i = 0; i < 5; i++)
            {
                var treeNode = new TreeNode("category" + i);
                nodes.Add(treeNode);

                for (int j = 0; j < 10; j++)
                {
                    treeNode.AddChild(new TreeNode("jobs" + index));
                    index++;
                }
            }

            var treeTemplate = new TreeViewTemplate()
            {
                Title               = "Occupation",
                TitleAlignment      = HorizontalAlignment.Center,
                MinimumListBoxWidth = 15,
                FrameTitle          = true,
                AutoSizeOverride    = new Size(15, 10),
                Items               = nodes
            };

            treeTemplate.AlignTo(LayoutDirection.South, sexTemplate, 1);
            AddControl(new TreeView(treeTemplate));

            var treeTemplate1 = new TreeViewTemplate
            {
                Title               = "Occupation",
                TitleAlignment      = HorizontalAlignment.Center,
                MinimumListBoxWidth = 15,
                FrameTitle          = true,
                AutoSizeOverride    = new Size(15, 10),
                Items               = nodes.Where((n, i) => i % 10 == 0).ToList(),
            };

            treeTemplate1.AlignTo(LayoutDirection.South, treeTemplate, 1);
            AddControl(new TreeView(treeTemplate1));

            var sliderTestTemplate = new SliderTemplate()
            {
                Label          = "Slider",
                ShowLabel      = true,
                HasFrameBorder = false,
                MinimumWidth   = 22,
                MaximumValue   = 100,
                StartingValue  = 50,
            };

            sliderTestTemplate.AlignTo(LayoutDirection.South, occupationTemplate);
            var sliderTest = new Slider(sliderTestTemplate);

            AddControl(sliderTest);

            var doneTemplate = new ButtonTemplate()
            {
                Label = "Press [Enter] Finish",
            };

            doneTemplate.SetBottomRight(ScreenRect.BottomRight.Shift(-1, -1));
            var doneButton = new Button(doneTemplate);

            doneButton.ButtonPushed += StartNewGame;

            AddControl(doneButton);

            KeyPressed += CharGen_KeyPressed;
        }