- Added option to scale the size of the UI (available under the View menu)
- Vertical scrolling has been added to left and right animation panels, so all the controls are accessible when using a lower resolution monitors
- The toggles for designating allowed races for actors now enforces the requirement that actor can either be a 'Human' (also includes all alien humanoids), or one or more types of animal
This commit is contained in:
AbstractConcept 2022-12-18 00:08:37 -06:00
parent 757cdd7f39
commit 279823a390
95 changed files with 2815 additions and 734 deletions

View file

@ -411,7 +411,7 @@ MonoBehaviour:
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_FadeDuration: 0
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@ namespace RimWorldAnimationStudio
public static class Constants
{
// Project data
public static string currentVersion = "1.0.0";
public static string currentVersion = "1.0.1";
public static string projectHome = "https://gitgud.io/AbstractConcept/rimworld-animation-studio";
public static string projectWiki = "https://gitgud.io/AbstractConcept/rimworld-animation-studio/-/wikis/home";

View file

@ -19,6 +19,8 @@ namespace RimWorldAnimationStudio
Transform contentWindow = transform.FindDeepChild("Content");
Reset();
bool actorIsHuman = actor.DefNames.Contains("Human");
for (int i = 0; i < allTags.Count(); i++)
{
string tag = allTags.ElementAt(i);
@ -37,6 +39,7 @@ namespace RimWorldAnimationStudio
{ actor.DefNames.Remove(tag); }
Workspace.RecordEvent("Actor def name");
Initialize();
});
if (CustomTags.defNames.Contains(tag))
@ -49,7 +52,9 @@ namespace RimWorldAnimationStudio
});
}
if (addedNewTag && i == allTags.Count() - 1)
toggleComp.interactable = actorIsHuman == (tag == "Human") || actor.DefNames.NullOrEmpty();
if (addedNewTag && i == allTags.Count() - 1 && toggleComp.interactable)
{ toggleComp.isOn = true; }
}

View file

@ -24,10 +24,10 @@ namespace RimWorldAnimationStudio
if (EventSystem.current.currentSelectedGameObject != null)
{
Transform child = transform.FindDeepChild(EventSystem.current.currentSelectedGameObject.name);
if (child != null)
{
EventSystem.current.SetSelectedGameObject(this.gameObject);
//EventSystem.current.SetSelectedGameObject(this.gameObject);
return;
}
}

View file

@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace RimWorldAnimationStudio
{
public class UIAutoAdjust : MonoBehaviour
{
public RectTransform driverTransform;
private RectTransform rectTransform;
private RectTransform parentTransform;
private void Start()
{
rectTransform = GetComponent<RectTransform>();
parentTransform = transform.parent.GetComponent<RectTransform>();
}
private void Update()
{
float targetHeight = parentTransform.rect.height - driverTransform.rect.height;
rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, targetHeight);
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ba0288438d7c0f746b62452e8d9d701a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,36 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace RimWorldAnimationStudio
{
public class UIScaler : MonoBehaviour
{
public float defaultScale = 1f;
public CanvasScaler canvasScaler;
public InputField uiScaler;
public void Start()
{
if (canvasScaler && uiScaler)
{
float scale = PlayerPrefs.GetFloat("uiScale");
canvasScaler.scaleFactor = scale > 0f ? scale : defaultScale;
uiScaler.SetTextWithoutNotify(scale.ToString());
}
}
public void OnScaleChanged()
{
float scale = Mathf.Clamp(float.Parse(uiScaler.text), 0.25f, 4f);
uiScaler.SetTextWithoutNotify(scale.ToString());
canvasScaler.scaleFactor = scale;
PlayerPrefs.SetFloat("uiScale", scale);
EventSystem.current.SetSelectedGameObject(gameObject);
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7afdc8339f195f946ab53e259172bf8b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,16 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace RimWorldAnimationStudio
{
public class VersionText : MonoBehaviour
{
private void Start()
{
Text text = GetComponent<Text>();
text.text = Constants.currentVersion;
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9a4c5d831743ea646836ce1913152544
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: