예제 #1
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);
     }
 }
예제 #2
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);
     }
 }