mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Initial commit
This commit is contained in:
commit
3c7cc0c973
8391 changed files with 704313 additions and 0 deletions
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Collaboration;
|
||||
using UnityEngine;
|
||||
|
||||
#if UNITY_2019_1_OR_NEWER
|
||||
using UnityEngine.UIElements;
|
||||
#else
|
||||
using UnityEngine.Experimental.UIElements;
|
||||
#endif
|
||||
|
||||
namespace UnityEditor.Collaboration
|
||||
{
|
||||
internal class BuildStatusButton : Button
|
||||
{
|
||||
private readonly string iconPrefix = "Icons/Collab.Build";
|
||||
private readonly string iconSuffix = ".png";
|
||||
Label labelElement = new Label();
|
||||
Image iconElement = new Image() {name = "BuildIcon"};
|
||||
|
||||
public BuildStatusButton(Action clickEvent) : base(clickEvent)
|
||||
{
|
||||
iconElement.image = EditorGUIUtility.Load(iconPrefix + iconSuffix) as Texture;
|
||||
labelElement.text = "Build Now";
|
||||
Add(iconElement);
|
||||
Add(labelElement);
|
||||
}
|
||||
|
||||
public BuildStatusButton(Action clickEvent, BuildState state, int failures) : base(clickEvent)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case BuildState.InProgress:
|
||||
iconElement.image = EditorGUIUtility.Load(iconPrefix + iconSuffix) as Texture;
|
||||
labelElement.text = "In progress";
|
||||
break;
|
||||
|
||||
case BuildState.Failed:
|
||||
iconElement.image = EditorGUIUtility.Load(iconPrefix + "Failed" + iconSuffix) as Texture;
|
||||
labelElement.text = failures + ((failures == 1) ? " failure" : " failures");
|
||||
break;
|
||||
|
||||
case BuildState.Success:
|
||||
iconElement.image = EditorGUIUtility.Load(iconPrefix + "Succeeded" + iconSuffix) as Texture;
|
||||
labelElement.text = "success";
|
||||
break;
|
||||
}
|
||||
|
||||
Add(iconElement);
|
||||
Add(labelElement);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue