mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
v 1.0.1
- 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:
parent
757cdd7f39
commit
279823a390
95 changed files with 2815 additions and 734 deletions
|
@ -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
|
@ -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";
|
||||
|
||||
|
|
|
@ -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; }
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
26
Source/Assets/Scripts/GUI/UIAutoAdjust.cs
Normal file
26
Source/Assets/Scripts/GUI/UIAutoAdjust.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
11
Source/Assets/Scripts/GUI/UIAutoAdjust.cs.meta
Normal file
11
Source/Assets/Scripts/GUI/UIAutoAdjust.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ba0288438d7c0f746b62452e8d9d701a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
36
Source/Assets/Scripts/GUI/UIScaler.cs
Normal file
36
Source/Assets/Scripts/GUI/UIScaler.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
11
Source/Assets/Scripts/GUI/UIScaler.cs.meta
Normal file
11
Source/Assets/Scripts/GUI/UIScaler.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7afdc8339f195f946ab53e259172bf8b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
16
Source/Assets/Scripts/GUI/VersionText.cs
Normal file
16
Source/Assets/Scripts/GUI/VersionText.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
11
Source/Assets/Scripts/GUI/VersionText.cs.meta
Normal file
11
Source/Assets/Scripts/GUI/VersionText.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9a4c5d831743ea646836ce1913152544
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue