public void SetExpedition(ColorsConfig colorsConfig, PlayerExpedition expedition) { this.expedition = expedition; image.color = colorsConfig.missionSuccess; rectTransform.rotation = Quaternion.Euler(0, 0, 0); UpdateExpedition(); }
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); } }
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); }
private void DrawButton(int buttonIndex, ButtonTypeEnum buttonType) { ColorsConfig buttonColors = GetButtonColors(buttonIndex); var button = CreateDesktopButton(buttonColors, buttonIndex, buttonType); PlaceButton(button); _Buttons[buttonIndex] = button; }
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"); }
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); }
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); }