public void SetExpedition(ColorsConfig colorsConfig, PlayerExpedition expedition)
 {
     this.expedition        = expedition;
     image.color            = colorsConfig.missionSuccess;
     rectTransform.rotation = Quaternion.Euler(0, 0, 0);
     UpdateExpedition();
 }
Ejemplo n.º 2
0
        private static Color GetBackgroundColor(Gear gear, ColorsConfig colorsConfig)
        {
            switch (gear.gearQuality)
            {
            case GearQuality.SHABBY:
                return(colorsConfig.gearSHABBY);

            case GearQuality.RUSTY:
                return(colorsConfig.gearRUSTY);

            case GearQuality.ORDINARY:
                return(colorsConfig.gearORDINARY);

            case GearQuality.USEFUL:
                return(colorsConfig.gearUSEFUL);

            case GearQuality.GOOD:
                return(colorsConfig.gearGOOD);

            case GearQuality.AWESOME:
                return(colorsConfig.gearAWESOME);

            case GearQuality.FLAWLESS:
                return(colorsConfig.gearFLAWLESS);

            case GearQuality.PERFECT:
                return(colorsConfig.gearPERFECT);

            case GearQuality.GODLIKE:
                return(colorsConfig.gearGOOD);

            default:
                return(Color.black);
            }
        }
Ejemplo n.º 3
0
 public void SetActive(ColorsConfig colorsConfig, UnityAction SaveEvent, UnityAction CancelEvent)
 {
     // remove possible previous listeners attached to this button
     saveButton.OnClick.RemoveAllListeners();
     // setup our listener
     saveButton.OnClick.AddListener(SaveEvent);
     saveButton.OnClick.AddListener(Close);
     // same for Cancel button
     cancelButton.OnClick.RemoveAllListeners();
     cancelButton.OnClick.AddListener(CancelEvent);
     cancelButton.OnClick.AddListener(Close);
     // loop through all colors in config
     foreach (Color color in colorsConfig.colors)
     {
         // create color toggle
         TextToggle colorToggle = Instantiate(colorToggleTemplate.gameObject, colorsToggleGroup.transform).GetComponent <TextToggle>();
         // set color toggle group
         colorToggle.toggleGroup = colorsToggleGroup;
         // activate toggle
         colorToggle.gameObject.SetActive(true);
         // set color
         colorToggle.GetComponentInChildren <RawImage>().color = color;
     }
     // preselect first toggle by simulating mouse click on it
     colorsToggleGroup.GetComponentsInChildren <TextToggle>()[0].ActOnLeftMouseClick();
     // activate this menu
     gameObject.SetActive(true);
 }
Ejemplo n.º 4
0
        private void DrawButton(int buttonIndex, ButtonTypeEnum buttonType)
        {
            ColorsConfig buttonColors = GetButtonColors(buttonIndex);

            var button = CreateDesktopButton(buttonColors, buttonIndex, buttonType);

            PlaceButton(button);
            _Buttons[buttonIndex] = button;
        }
Ejemplo n.º 5
0
        internal ProfileConfig(string profilesFolder)
        {
            profileChanged = new DefaultPublicEvent();

            loader = new SettingsLoader(profilesFolder);
            profileName = null;
            settings = new SynchronizedSettings("Profile");
            userSettings = new SettingsFragment(settings, "UserSettings");

            maxJournalLen = new SettingInt32Entry(settings, 500, "MaxJournalLen", "Config");
            overrideSpeechColor = new SettingBoolEntry(settings, false, "OverrideSpeechColor", "Config");

            colors = new ColorsConfig(settings);
            window = new WindowConfig(settings);

            fpsLimit = new SettingInt32Entry(settings, 0, "fps", "Config", "FpsLimiter");
        }
Ejemplo n.º 6
0
        internal ProfileConfig(string profilesFolder)
        {
            profileChanged = new DefaultPublicEvent();

            loader       = new SettingsLoader(profilesFolder);
            profileName  = null;
            settings     = new SynchronizedSettings("Profile");
            userSettings = new SettingsFragment(settings, "UserSettings");

            maxJournalLen       = new SettingInt32Entry(settings, 500, "MaxJournalLen", "Config");
            overrideSpeechColor = new SettingBoolEntry(settings, false, "OverrideSpeechColor", "Config");

            colors = new ColorsConfig(settings);
            window = new WindowConfig(settings);

            fpsLimit = new SettingInt32Entry(settings, 0, "fps", "Config", "FpsLimiter");
        }
Ejemplo n.º 7
0
        private Button CreateDesktopButton(ColorsConfig colors, int index, ButtonTypeEnum buttonType)
        {
            ButtonConfig btnConf = _config.GetButtonConfigByIndex(index);

            Button button = new Button();

            button.FlatStyle = FlatStyle.Flat;


            button.ForeColor = ColorTranslator.FromHtml(colors.Foreground);
            button.BackColor = ColorTranslator.FromHtml(colors.Background);

            button.Click += (s, e) => ButtonCallback(index);

            button.Height = _config.Application.ApplicationHeight;
            button.Width  = _config.Buttons.MinimumButtonWidth;
            button.Margin = new Padding(_config.Buttons.ButtonMarginSize);


            if (buttonType == ButtonTypeEnum.DisplayGraphic)
            {
                //button.TextAlign = ContentAlignment.TopLeft;
                //button.Text = index.ToString();
                button.Font = new Font(button.Font.FontFamily, (float)(button.Font.SizeInPoints * 0.75));
                button.BackgroundImageLayout = ImageLayout.Center;
            }
            else
            {
                button.FlatAppearance.BorderSize  = _config.Buttons.BorderWidth;
                button.FlatAppearance.BorderColor = ColorTranslator.FromHtml(colors.Border);

                button.Text = btnConf.Name;

                var textwidth = TextRenderer.MeasureText(btnConf.Name, button.Font);
                if (button.Width < (textwidth.Width + (2 * _config.Buttons.ButtonMarginSize)))
                {
                    button.Width = textwidth.Width + (2 * _config.Buttons.ButtonMarginSize);
                }
            }

            return(button);
        }
Ejemplo n.º 8
0
        private static Color GetBorderColor(Gear gear, ColorsConfig colorsConfig)
        {
            if (gear.jewelSlot1 == null)
            {
                return(colorsConfig.gearJewel0);
            }
            if (gear.jewelSlot2 == null)
            {
                return(colorsConfig.gearJewel1);
            }
            if (gear.jewelSlot3 == null)
            {
                return(colorsConfig.gearJewel2);
            }
            if (gear.jewelSlot4 == null)
            {
                return(colorsConfig.gearJewel3);
            }

            return(colorsConfig.gearJewel4);
        }