Exemplo n.º 1
0
 public override void Update()
 {
     base.Update();
     if (_updateNeeded && Input.GetMouseButtonUp(0))
     {
         ColorChanged();
         _updateNeeded = false;
     }
     if (_savedSwatches.Count == MaxSavedSwatches || _savedSwatches.Find(s => s.Color == Controller.GetCurrentColor(ColorID)) != null)
     {
         if (_saveButton.isEnabled)
         {
             _saveButton.Disable();
         }
         if (_savedSwatches.Count == MaxSavedSwatches)
         {
             _saveButton.tooltip = Translation.Instance.GetTranslation(TranslationID.TOOLTIP_BUTTON_SAVE_MAXREACHED);
         }
         else if (_savedSwatches.Find(s => s.Color == Controller.GetCurrentColor(ColorID)) != null)
         {
             _saveButton.tooltip = Translation.Instance.GetTranslation(TranslationID.TOOLTIP_BUTTON_SAVE_COLOREXISTS);
         }
     }
     else if (_savedSwatches.Count < MaxSavedSwatches)
     {
         if (!_saveButton.isEnabled)
         {
             _saveButton.Enable();
         }
         _saveButton.tooltip = Translation.Instance.GetTranslation(TranslationID.TOOLTIP_BUTTON_SAVE);
     }
 }
Exemplo n.º 2
0
 public override void Update()
 {
     base.Update();
     if (updateNeeded && Input.GetMouseButtonUp(0))
     {
         ColorChanged();
         updateNeeded = false;
     }
     if (savedSwatches.Count == MAX_SAVED_SWATCHES || savedSwatches.Find(s => s.Color == NetworkSkinPanelController.Color.SelectedColor) != null)
     {
         if (saveButton.isEnabled)
         {
             saveButton.Disable();
         }
         if (savedSwatches.Count == MAX_SAVED_SWATCHES)
         {
             saveButton.tooltip = Translation.Instance.GetTranslation(TranslationID.TOOLTIP_BUTTON_SAVE_MAXREACHED);
         }
         else if (savedSwatches.Find(s => s.Color == NetworkSkinPanelController.Color.SelectedColor) != null)
         {
             saveButton.tooltip = Translation.Instance.GetTranslation(TranslationID.TOOLTIP_BUTTON_SAVE_COLOREXISTS);
         }
     }
     else if (savedSwatches.Count < MAX_SAVED_SWATCHES)
     {
         if (!saveButton.isEnabled)
         {
             saveButton.Enable();
         }
         saveButton.tooltip = Translation.Instance.GetTranslation(TranslationID.TOOLTIP_BUTTON_SAVE);
     }
 }
Exemplo n.º 3
0
 private void CreateSaveButton()
 {
     saveButton = buttonsPanel.AddUIComponent <ButtonPanel>();
     saveButton.Build(PanelType.None, new Layout(new Vector2(0.0f, 40.0f), true, LayoutDirection.Horizontal, LayoutStart.TopLeft, 0));
     saveButton.SetAnchor(UIAnchorStyle.Left | UIAnchorStyle.CenterVertical);
     saveButton.SetText(Translation.Instance.GetTranslation(TranslationID.BUTTON_SAVE));
     saveButton.EventButtonClicked += OnSaveClicked;
     if (savedSwatches.Count == MAX_SAVED_SWATCHES)
     {
         saveButton.Disable();
     }
 }