mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-25 19:15:16 +00:00
Small Fixes (#609)
* additive angle in rhythm rally * remove old keyboard controller compat * fix control style dropdowns * using mouse on title screen selects keyboard instead default to keyboard for invalid controllers * temporarily ditch discord RPC we need a new API key lol * remove this discord call too * certain editor shortcuts now exit fullscreen fix color hex input not locking editor shortcuts * increase max queued frames turns out this may not be an issue for audio rhythm games
This commit is contained in:
parent
5e74129a82
commit
e08ce8f0b0
10 changed files with 101 additions and 120 deletions
|
@ -26851,7 +26851,7 @@ MonoBehaviour:
|
||||||
m_HandleRect: {fileID: 1589389271}
|
m_HandleRect: {fileID: 1589389271}
|
||||||
m_Direction: 2
|
m_Direction: 2
|
||||||
m_Value: 1
|
m_Value: 1
|
||||||
m_Size: 0.9989085
|
m_Size: 0.9999814
|
||||||
m_NumberOfSteps: 0
|
m_NumberOfSteps: 0
|
||||||
m_OnValueChanged:
|
m_OnValueChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
|
@ -32707,7 +32707,7 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0.5}
|
m_AnchorMin: {x: 0, y: 0.5}
|
||||||
m_AnchorMax: {x: 1, y: 0.5}
|
m_AnchorMax: {x: 1, y: 0.5}
|
||||||
m_AnchoredPosition: {x: 0, y: 173.14249}
|
m_AnchoredPosition: {x: 0, y: 171.91833}
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 1}
|
m_Pivot: {x: 0.5, y: 1}
|
||||||
--- !u!222 &1154875945
|
--- !u!222 &1154875945
|
||||||
|
@ -39097,8 +39097,8 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 459.58514, y: -25}
|
m_AnchoredPosition: {x: 391.79788, y: -25}
|
||||||
m_SizeDelta: {x: 879.1703, y: 30}
|
m_SizeDelta: {x: 743.59576, y: 30}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!114 &1443721748
|
--- !u!114 &1443721748
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -39119,6 +39119,7 @@ MonoBehaviour:
|
||||||
ColorTable: {fileID: 723094753}
|
ColorTable: {fileID: 723094753}
|
||||||
colorTableActive: 0
|
colorTableActive: 0
|
||||||
colorPreview: {fileID: 1535224921}
|
colorPreview: {fileID: 1535224921}
|
||||||
|
hex: {fileID: 426555699}
|
||||||
--- !u!1 &1443971064
|
--- !u!1 &1443971064
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -90,7 +90,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
function = delegate {
|
function = delegate {
|
||||||
var e = eventCaller.currentEntity;
|
var e = eventCaller.currentEntity;
|
||||||
// var rotation = new Vector3(0, e["valA"], 0);
|
// var rotation = new Vector3(0, e["valA"], 0);
|
||||||
RhythmRally.instance.ChangeCameraAngle(e.beat, e["valA"], e["valB"], e.length, (Util.EasingFunction.Ease)e["type"]);
|
RhythmRally.instance.ChangeCameraAngle(e.beat, e["valA"], e["valB"], e.length, (Util.EasingFunction.Ease)e["type"], e["additive"]);
|
||||||
},
|
},
|
||||||
defaultLength = 4,
|
defaultLength = 4,
|
||||||
resizable = true,
|
resizable = true,
|
||||||
|
@ -98,7 +98,7 @@ namespace HeavenStudio.Games.Loaders
|
||||||
new Param("valA", new EntityTypes.Integer(-360, 360, 0), "Angle", "The rotation of the camera around the center of the table"),
|
new Param("valA", new EntityTypes.Integer(-360, 360, 0), "Angle", "The rotation of the camera around the center of the table"),
|
||||||
new Param("valB", new EntityTypes.Float(0.5f, 4f, 1), "Zoom", "The camera's level of zoom (Lower value = Zoomed in)"),
|
new Param("valB", new EntityTypes.Float(0.5f, 4f, 1), "Zoom", "The camera's level of zoom (Lower value = Zoomed in)"),
|
||||||
new Param("type", Util.EasingFunction.Ease.Linear, "Ease", "The easing function to use"),
|
new Param("type", Util.EasingFunction.Ease.Linear, "Ease", "The easing function to use"),
|
||||||
// new Param("type2", RotateMode.Fast, "Rotation Mode", "The rotation mode to use")
|
new Param("additive", true, "Additive Rotation", "Add to current angle instead of setting target angle")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// todo: background recolouring
|
// todo: background recolouring
|
||||||
|
@ -407,7 +407,7 @@ namespace HeavenStudio.Games
|
||||||
|
|
||||||
foreach (var entity in cameraEntities)
|
foreach (var entity in cameraEntities)
|
||||||
{
|
{
|
||||||
ChangeCameraAngle(entity.beat, entity["valA"], entity["valB"], entity.length, (Util.EasingFunction.Ease)entity["type"]);
|
ChangeCameraAngle(entity.beat, entity["valA"], entity["valB"], entity.length, (Util.EasingFunction.Ease)entity["type"], entity["additive"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateCamera(beat);
|
UpdateCamera(beat);
|
||||||
|
@ -419,6 +419,7 @@ namespace HeavenStudio.Games
|
||||||
{
|
{
|
||||||
Util.EasingFunction.Function func = Util.EasingFunction.GetEasingFunction(cameraRotateEase);
|
Util.EasingFunction.Function func = Util.EasingFunction.GetEasingFunction(cameraRotateEase);
|
||||||
float rotProg = Conductor.instance.GetPositionFromBeat(cameraRotateBeat, cameraRotateLength, true);
|
float rotProg = Conductor.instance.GetPositionFromBeat(cameraRotateBeat, cameraRotateLength, true);
|
||||||
|
rotProg = Mathf.Clamp01(rotProg);
|
||||||
float rot = func(cameraRotateLast, cameraRotateNext, rotProg);
|
float rot = func(cameraRotateLast, cameraRotateNext, rotProg);
|
||||||
cameraPivot.rotation = Quaternion.Euler(0, rot, 0);
|
cameraPivot.rotation = Quaternion.Euler(0, rot, 0);
|
||||||
cameraPivot.localScale = Vector3.one * func(cameraScaleLast, cameraScaleNext, rotProg);
|
cameraPivot.localScale = Vector3.one * func(cameraScaleLast, cameraScaleNext, rotProg);
|
||||||
|
@ -558,15 +559,22 @@ namespace HeavenStudio.Games
|
||||||
inPose = true;
|
inPose = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ChangeCameraAngle(double beat, float rotation, float camZoom, double length, Util.EasingFunction.Ease ease)
|
public void ChangeCameraAngle(double beat, float rotation, float camZoom, double length, Util.EasingFunction.Ease ease, bool additive = true)
|
||||||
{
|
{
|
||||||
cameraRotateBeat = beat;
|
cameraRotateBeat = beat;
|
||||||
cameraRotateLength = length;
|
cameraRotateLength = length;
|
||||||
cameraRotateEase = ease;
|
cameraRotateEase = ease;
|
||||||
cameraRotateLast = cameraRotateNext;
|
cameraRotateLast = cameraRotateNext % 360f;
|
||||||
cameraScaleLast = cameraScaleNext;
|
cameraScaleLast = cameraScaleNext;
|
||||||
cameraRotateNext = rotation;
|
|
||||||
cameraScaleNext = camZoom;
|
cameraScaleNext = camZoom;
|
||||||
|
if (additive)
|
||||||
|
{
|
||||||
|
cameraRotateNext = cameraRotateLast + rotation;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cameraRotateNext = rotation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PrepareFastRally(double beat, RallySpeed speedChange, bool muteAudio = false)
|
public void PrepareFastRally(double beat, RallySpeed speedChange, bool muteAudio = false)
|
||||||
|
|
|
@ -115,7 +115,7 @@ namespace HeavenStudio
|
||||||
|
|
||||||
Application.targetFrameRate = -1;
|
Application.targetFrameRate = -1;
|
||||||
QualitySettings.vSyncCount = 0;
|
QualitySettings.vSyncCount = 0;
|
||||||
QualitySettings.maxQueuedFrames = 1;
|
QualitySettings.maxQueuedFrames = 2;
|
||||||
if (PersistentDataManager.gameSettings.isFullscreen)
|
if (PersistentDataManager.gameSettings.isFullscreen)
|
||||||
{
|
{
|
||||||
Screen.SetResolution(Display.main.systemWidth, Display.main.systemHeight, FullScreenMode.ExclusiveFullScreen);
|
Screen.SetResolution(Display.main.systemWidth, Display.main.systemHeight, FullScreenMode.ExclusiveFullScreen);
|
||||||
|
@ -428,21 +428,23 @@ namespace HeavenStudio
|
||||||
|
|
||||||
public static void UpdateDiscordStatus(string details, bool editor = false, bool updateTime = false)
|
public static void UpdateDiscordStatus(string details, bool editor = false, bool updateTime = false)
|
||||||
{
|
{
|
||||||
if (discordDuringTesting || !Application.isEditor)
|
Debug.Log("Discord Rich Presence temporarily disabled");
|
||||||
{
|
return;
|
||||||
if (PersistentDataManager.gameSettings.discordRPCEnable)
|
// if (discordDuringTesting || !Application.isEditor)
|
||||||
{
|
// {
|
||||||
try
|
// if (PersistentDataManager.gameSettings.discordRPCEnable)
|
||||||
{
|
// {
|
||||||
DiscordRPC.DiscordRPC.UpdateActivity(editor ? "In Editor " : "Playing ", details, updateTime);
|
// try
|
||||||
Debug.Log("Discord status updated");
|
// {
|
||||||
}
|
// DiscordRPC.DiscordRPC.UpdateActivity(editor ? "In Editor " : "Playing ", details, updateTime);
|
||||||
catch (System.Exception e)
|
// Debug.Log("Discord status updated");
|
||||||
{
|
// }
|
||||||
Debug.Log("Discord status update failed: " + e.Message);
|
// catch (System.Exception e)
|
||||||
}
|
// {
|
||||||
}
|
// Debug.Log("Discord status update failed: " + e.Message);
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void OnQuitting()
|
private static void OnQuitting()
|
||||||
|
@ -453,8 +455,8 @@ namespace HeavenStudio
|
||||||
PlayerInput.CleanUp();
|
PlayerInput.CleanUp();
|
||||||
Debug.Log("Clearing RIQ Cache...");
|
Debug.Log("Clearing RIQ Cache...");
|
||||||
Jukebox.RiqFileHandler.ClearCache();
|
Jukebox.RiqFileHandler.ClearCache();
|
||||||
Debug.Log("Closing Discord GameSDK...");
|
// Debug.Log("Closing Discord GameSDK...");
|
||||||
DiscordRPC.DiscordController.instance?.Disconnect();
|
// DiscordRPC.DiscordController.instance?.Disconnect();
|
||||||
|
|
||||||
HasShutDown = true;
|
HasShutDown = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,17 +121,6 @@ namespace HeavenStudio
|
||||||
|
|
||||||
public static InputController GetInputController(int player)
|
public static InputController GetInputController(int player)
|
||||||
{
|
{
|
||||||
// Needed so Keyboard works on MacOS and Linux
|
|
||||||
#if UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX
|
|
||||||
inputDevices = new List<InputController>();
|
|
||||||
if(inputDevices.Count < 1)
|
|
||||||
{
|
|
||||||
InputKeyboard keyboard = new InputKeyboard();
|
|
||||||
keyboard.SetPlayer(1);
|
|
||||||
keyboard.InitializeController();
|
|
||||||
inputDevices.Add(keyboard);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
//select input controller that has player field set to player
|
//select input controller that has player field set to player
|
||||||
//this will return the first controller that has that player number in the case of controller pairs (eg. Joy-Cons)
|
//this will return the first controller that has that player number in the case of controller pairs (eg. Joy-Cons)
|
||||||
//so such controllers should have a reference to the other controller in the pair
|
//so such controllers should have a reference to the other controller in the pair
|
||||||
|
@ -151,19 +140,6 @@ namespace HeavenStudio
|
||||||
//this will return the first controller that has that player number in the case of controller pairs (eg. Joy-Cons)
|
//this will return the first controller that has that player number in the case of controller pairs (eg. Joy-Cons)
|
||||||
//so such controllers should have a reference to the other controller in the pair
|
//so such controllers should have a reference to the other controller in the pair
|
||||||
//controller IDs are determined by connection order (the Keyboard is always first)
|
//controller IDs are determined by connection order (the Keyboard is always first)
|
||||||
|
|
||||||
|
|
||||||
// Needed so Keyboard works on MacOS and Linux
|
|
||||||
#if UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX
|
|
||||||
inputDevices = new List<InputController>();
|
|
||||||
if(inputDevices.Count < 1)
|
|
||||||
{
|
|
||||||
InputKeyboard keyboard = new InputKeyboard();
|
|
||||||
keyboard.SetPlayer(1);
|
|
||||||
keyboard.InitializeController();
|
|
||||||
inputDevices.Add(keyboard);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
for (int i = 0; i < inputDevices.Count; i++)
|
for (int i = 0; i < inputDevices.Count; i++)
|
||||||
{
|
{
|
||||||
if (inputDevices[i].GetPlayer() == player)
|
if (inputDevices[i].GetPlayer() == player)
|
||||||
|
@ -176,17 +152,6 @@ namespace HeavenStudio
|
||||||
|
|
||||||
public static void UpdateInputControllers()
|
public static void UpdateInputControllers()
|
||||||
{
|
{
|
||||||
// Needed so Keyboard works on MacOS and Linux
|
|
||||||
#if UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX
|
|
||||||
inputDevices = new List<InputController>();
|
|
||||||
if(inputDevices.Count < 1)
|
|
||||||
{
|
|
||||||
InputKeyboard keyboard = new InputKeyboard();
|
|
||||||
keyboard.SetPlayer(1);
|
|
||||||
keyboard.InitializeController();
|
|
||||||
inputDevices.Add(keyboard);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
foreach (InputController i in inputDevices)
|
foreach (InputController i in inputDevices)
|
||||||
{
|
{
|
||||||
i.UpdateState();
|
i.UpdateState();
|
||||||
|
|
|
@ -131,6 +131,7 @@ namespace HeavenStudio.Editor
|
||||||
|
|
||||||
public void ShowQuitPopUp(bool show)
|
public void ShowQuitPopUp(bool show)
|
||||||
{
|
{
|
||||||
|
if (fullscreen) Fullscreen();
|
||||||
_confirmQuitMain.SetActive(show);
|
_confirmQuitMain.SetActive(show);
|
||||||
SetAuthoritiveMenu(show);
|
SetAuthoritiveMenu(show);
|
||||||
}
|
}
|
||||||
|
@ -167,12 +168,12 @@ namespace HeavenStudio.Editor
|
||||||
Fullscreen();
|
Fullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.Delete) || Input.GetKeyDown(KeyCode.Backspace))
|
if ((Input.GetKeyDown(KeyCode.Delete) || Input.GetKeyDown(KeyCode.Backspace)) && !fullscreen)
|
||||||
{
|
{
|
||||||
CommandManager.Instance.AddCommand(new Commands.Delete(Selections.instance.eventsSelected.Select(c => c.entity.guid).ToList()));
|
CommandManager.Instance.AddCommand(new Commands.Delete(Selections.instance.eventsSelected.Select(c => c.entity.guid).ToList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetKey(KeyCode.LeftControl))
|
if (Input.GetKey(KeyCode.LeftControl) && !fullscreen)
|
||||||
{
|
{
|
||||||
if (Input.GetKeyDown(KeyCode.Z))
|
if (Input.GetKeyDown(KeyCode.Z))
|
||||||
{
|
{
|
||||||
|
@ -193,20 +194,13 @@ namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
Timeline.instance.Paste();
|
Timeline.instance.Paste();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetKey(KeyCode.LeftShift))
|
|
||||||
{
|
|
||||||
if (Input.GetKeyDown(KeyCode.D))
|
|
||||||
{
|
|
||||||
ToggleDebugCam();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetKey(KeyCode.LeftControl))
|
if (Input.GetKey(KeyCode.LeftControl))
|
||||||
{
|
{
|
||||||
if (Input.GetKeyDown(KeyCode.N))
|
if (Input.GetKeyDown(KeyCode.N))
|
||||||
{
|
{
|
||||||
|
if (fullscreen) Fullscreen();
|
||||||
NewBTN.onClick.Invoke();
|
NewBTN.onClick.Invoke();
|
||||||
}
|
}
|
||||||
else if (Input.GetKeyDown(KeyCode.O))
|
else if (Input.GetKeyDown(KeyCode.O))
|
||||||
|
@ -224,6 +218,14 @@ namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
SaveRemix(false);
|
SaveRemix(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Input.GetKey(KeyCode.LeftShift))
|
||||||
|
{
|
||||||
|
if (Input.GetKeyDown(KeyCode.D))
|
||||||
|
{
|
||||||
|
ToggleDebugCam();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -247,33 +249,6 @@ namespace HeavenStudio.Editor
|
||||||
PasteBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
|
PasteBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
|
||||||
else
|
else
|
||||||
PasteBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
|
PasteBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
|
||||||
|
|
||||||
|
|
||||||
if (Timeline.instance.timelineState.selected && Editor.instance.canSelect)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
if (Input.GetMouseButtonUp(0))
|
|
||||||
{
|
|
||||||
List<TimelineEventObj> selectedEvents = Timeline.instance.eventObjs.FindAll(c => c.selected == true && c.eligibleToMove == true);
|
|
||||||
|
|
||||||
if (selectedEvents.Count > 0)
|
|
||||||
{
|
|
||||||
List<TimelineEventObj> result = new List<TimelineEventObj>();
|
|
||||||
|
|
||||||
for (int i = 0; i < selectedEvents.Count; i++)
|
|
||||||
{
|
|
||||||
//TODO: this is in LateUpdate, so this will never run! change this to something that works properly
|
|
||||||
if (!(selectedEvents[i].isCreating || selectedEvents[i].wasDuplicated))
|
|
||||||
{
|
|
||||||
result.Add(selectedEvents[i]);
|
|
||||||
}
|
|
||||||
selectedEvents[i].OnUp();
|
|
||||||
}
|
|
||||||
CommandManager.instance.Execute(new Commands.Move(result));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Sprite GameIcon(string name)
|
public static Sprite GameIcon(string name)
|
||||||
|
@ -360,6 +335,7 @@ namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
if (dialog.GetType() == typeof(RemixPropertiesDialog))
|
if (dialog.GetType() == typeof(RemixPropertiesDialog))
|
||||||
{
|
{
|
||||||
|
if (fullscreen) Fullscreen();
|
||||||
GlobalGameManager.ShowErrorMessage("Set Remix Properties", "Set remix properties before saving.");
|
GlobalGameManager.ShowErrorMessage("Set Remix Properties", "Set remix properties before saving.");
|
||||||
(dialog as RemixPropertiesDialog).SwitchPropertiesDialog();
|
(dialog as RemixPropertiesDialog).SwitchPropertiesDialog();
|
||||||
(dialog as RemixPropertiesDialog).SetSaveOnClose(true, saveAs);
|
(dialog as RemixPropertiesDialog).SetSaveOnClose(true, saveAs);
|
||||||
|
@ -431,6 +407,7 @@ namespace HeavenStudio.Editor
|
||||||
|
|
||||||
public void LoadRemix(bool create = false)
|
public void LoadRemix(bool create = false)
|
||||||
{
|
{
|
||||||
|
if (fullscreen) Fullscreen();
|
||||||
if (create)
|
if (create)
|
||||||
{
|
{
|
||||||
GameManager.instance.NewRemix();
|
GameManager.instance.NewRemix();
|
||||||
|
@ -446,6 +423,7 @@ namespace HeavenStudio.Editor
|
||||||
|
|
||||||
public void OpenRemix()
|
public void OpenRemix()
|
||||||
{
|
{
|
||||||
|
if (fullscreen) Fullscreen();
|
||||||
var extensions = new[]
|
var extensions = new[]
|
||||||
{
|
{
|
||||||
new ExtensionFilter("Heaven Studio Remix File ", new string[] { "riq" }),
|
new ExtensionFilter("Heaven Studio Remix File ", new string[] { "riq" }),
|
||||||
|
|
|
@ -20,6 +20,7 @@ namespace HeavenStudio.Editor
|
||||||
public RectTransform ColorTable;
|
public RectTransform ColorTable;
|
||||||
public bool colorTableActive;
|
public bool colorTableActive;
|
||||||
public ColorPreview colorPreview;
|
public ColorPreview colorPreview;
|
||||||
|
public TMP_InputField hex;
|
||||||
|
|
||||||
private Color _defaultColor;
|
private Color _defaultColor;
|
||||||
|
|
||||||
|
@ -27,6 +28,17 @@ namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
InitProperties(propertyName, caption);
|
InitProperties(propertyName, caption);
|
||||||
|
|
||||||
|
hex.onSelect.AddListener(
|
||||||
|
_ =>
|
||||||
|
Editor.instance.editingInputField = true
|
||||||
|
);
|
||||||
|
hex.onEndEdit.AddListener(
|
||||||
|
_ =>
|
||||||
|
{;
|
||||||
|
Editor.instance.editingInputField = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
colorPreview.colorPicker.onColorChanged += _ =>
|
colorPreview.colorPicker.onColorChanged += _ =>
|
||||||
{
|
{
|
||||||
parameterManager.entity[propertyName] = colorPreview.colorPicker.color;
|
parameterManager.entity[propertyName] = colorPreview.colorPicker.color;
|
||||||
|
@ -78,6 +90,7 @@ namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
ColorTable.gameObject.SetActive(false);
|
ColorTable.gameObject.SetActive(false);
|
||||||
colorTableActive = false;
|
colorTableActive = false;
|
||||||
|
Editor.instance.editingInputField = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,9 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.UI;
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using Starpelly;
|
|
||||||
|
|
||||||
using HeavenStudio.Util;
|
|
||||||
using HeavenStudio.Editor;
|
|
||||||
|
|
||||||
namespace HeavenStudio.Editor
|
namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
|
@ -22,9 +17,9 @@ namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
InitProperties(diag, propertyName, caption);
|
InitProperties(diag, propertyName, caption);
|
||||||
|
|
||||||
var enumType = type.GetType();
|
Type enumType = type.GetType();
|
||||||
var enumVals = Enum.GetValues(enumType);
|
Array enumVals = Enum.GetValues(enumType);
|
||||||
var enumNames = Enum.GetNames(enumType).ToList();
|
List<string> enumNames = Enum.GetNames(enumType).ToList();
|
||||||
|
|
||||||
// Can we assume non-holey enum?
|
// Can we assume non-holey enum?
|
||||||
// If we can we can simplify to dropdown.value = (int) parameterManager.chart[propertyName]
|
// If we can we can simplify to dropdown.value = (int) parameterManager.chart[propertyName]
|
||||||
|
@ -38,7 +33,7 @@ namespace HeavenStudio.Editor
|
||||||
dropdown.value = selected;
|
dropdown.value = selected;
|
||||||
|
|
||||||
dropdown.onValueChanged.AddListener(_ =>
|
dropdown.onValueChanged.AddListener(_ =>
|
||||||
parameterManager.chart[propertyName] = (int) enumVals.GetValue(dropdown.value)
|
parameterManager.chart[propertyName] = Enum.ToObject(enumType, (int) enumVals.GetValue(dropdown.value))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,15 @@ namespace HeavenStudio.Editor
|
||||||
|
|
||||||
public void AddParam(RemixPropertiesDialog diag, string propertyName, object type, string caption, bool isReadOnly = false, string tooltip = "")
|
public void AddParam(RemixPropertiesDialog diag, string propertyName, object type, string caption, bool isReadOnly = false, string tooltip = "")
|
||||||
{
|
{
|
||||||
|
if (!Minigames.propertiesModel.ContainsKey(propertyName))
|
||||||
|
{
|
||||||
|
Debug.LogError("Property " + propertyName + " does not exist!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
GameObject prefab = diag.IntegerP;
|
GameObject prefab = diag.IntegerP;
|
||||||
GameObject input;
|
GameObject input;
|
||||||
|
|
||||||
var objType = type.GetType();
|
var objType = Minigames.propertiesModel[propertyName].GetType();
|
||||||
|
|
||||||
if (objType == typeof(EntityTypes.Integer))
|
if (objType == typeof(EntityTypes.Integer))
|
||||||
{
|
{
|
||||||
|
@ -83,13 +88,13 @@ namespace HeavenStudio.Editor
|
||||||
property.SetProperties(diag, propertyName, type, caption);
|
property.SetProperties(diag, propertyName, type, caption);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Debug.LogError("Can't make property interface of type: " + type.GetType());
|
Debug.LogError("Can't make property interface of type: " + objType);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogError("Can't make property interface of type: " + type.GetType());
|
Debug.LogError("Can't make property interface of type: " + objType);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,6 +325,8 @@ namespace HeavenStudio
|
||||||
{
|
{
|
||||||
if (data.properties[prop.Key].GetType() == typeof(string))
|
if (data.properties[prop.Key].GetType() == typeof(string))
|
||||||
data.properties[prop.Key] = Enum.Parse(mType, (string)data.properties[prop.Key]);
|
data.properties[prop.Key] = Enum.Parse(mType, (string)data.properties[prop.Key]);
|
||||||
|
else
|
||||||
|
data.properties[prop.Key] = Enum.ToObject(mType, data.properties[prop.Key]);
|
||||||
}
|
}
|
||||||
// convert all JObjects to their respective types
|
// convert all JObjects to their respective types
|
||||||
else if (data.properties[prop.Key].GetType() == typeof(Newtonsoft.Json.Linq.JObject))
|
else if (data.properties[prop.Key].GetType() == typeof(Newtonsoft.Json.Linq.JObject))
|
||||||
|
|
|
@ -141,14 +141,26 @@ namespace HeavenStudio
|
||||||
pressAnyKeyAnim.Play("PressKeyFadeOut", 0, 0);
|
pressAnyKeyAnim.Play("PressKeyFadeOut", 0, 0);
|
||||||
SoundByte.PlayOneShot("ui/UIEnter");
|
SoundByte.PlayOneShot("ui/UIEnter");
|
||||||
|
|
||||||
|
var nextController = newController;
|
||||||
|
|
||||||
|
if (newController is InputMouse)
|
||||||
|
{
|
||||||
|
Debug.Log("Mouse used, selecting keyboard instead");
|
||||||
|
nextController = controllers[0];
|
||||||
|
}
|
||||||
Debug.Log("Assigning controller: " + newController.GetDeviceName());
|
Debug.Log("Assigning controller: " + newController.GetDeviceName());
|
||||||
|
|
||||||
var lastController = PlayerInput.GetInputController(1);
|
var lastController = PlayerInput.GetInputController(1);
|
||||||
if (lastController != newController)
|
if (lastController != nextController)
|
||||||
{
|
{
|
||||||
|
if (nextController == null)
|
||||||
|
{
|
||||||
|
Debug.Log("invalid controller, using keyboard");
|
||||||
|
nextController = controllers[0];
|
||||||
|
}
|
||||||
lastController.SetPlayer(null);
|
lastController.SetPlayer(null);
|
||||||
newController.SetPlayer(1);
|
nextController.SetPlayer(1);
|
||||||
PlayerInput.CurrentControlStyle = newController.GetDefaultStyle();
|
PlayerInput.CurrentControlStyle = nextController.GetDefaultStyle();
|
||||||
usingMouse = PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch;
|
usingMouse = PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch;
|
||||||
selectedDisplayIcon.SetActive(!usingMouse);
|
selectedDisplayIcon.SetActive(!usingMouse);
|
||||||
|
|
||||||
|
@ -157,10 +169,10 @@ namespace HeavenStudio
|
||||||
(lastController as InputJoyshock)?.UnAssignOtherHalf();
|
(lastController as InputJoyshock)?.UnAssignOtherHalf();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((newController as InputJoyshock) != null)
|
if ((nextController as InputJoyshock) != null)
|
||||||
{
|
{
|
||||||
newController.OnSelected();
|
nextController.OnSelected();
|
||||||
(newController as InputJoyshock)?.UnAssignOtherHalf();
|
(nextController as InputJoyshock)?.UnAssignOtherHalf();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue