Skip to content
This repository has been archived by the owner on Jun 20, 2021. It is now read-only.

Commit

Permalink
Format cleanup...
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianSchoenbaechler committed Jul 27, 2018
1 parent 9e150bc commit ca3a788
Show file tree
Hide file tree
Showing 13 changed files with 158 additions and 159 deletions.
@@ -1,19 +1,19 @@
/*
* Copyright - Julian Schoenbaechler
* https://github.com/JulianSchoenbaechler/Volplane
*
*
* This file is part of the Volplane project.
*
*
* The Volplane project is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
*
* The Volplane project is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with the Volplane project.
* If not, see http://www.gnu.org/licenses/.
Expand Down
8 changes: 4 additions & 4 deletions Assets/Volplane/Code/Core/ElementProperties.cs
Expand Up @@ -100,7 +100,7 @@ public bool Hidden
data["hidden"] = value;
else
data.Add("hidden", value);

hidden = value;
}
}
Expand All @@ -119,7 +119,7 @@ public string Image
data["image"] = String.Format("img/{0:G}", value);
else
data.Add("image", String.Format("img/{0:G}", value));

images[0] = value;
}
}
Expand All @@ -139,7 +139,7 @@ public string HighlightImage
data["highlightImage"] = String.Format("img/{0:G}", value);
else
data.Add("highlightImage", String.Format("img/{0:G}", value));

images[1] = value;
}
}
Expand All @@ -159,7 +159,7 @@ public string HandlerImage
data["handlerImage"] = String.Format("img/{0:G}", value);
else
data.Add("handlerImage", String.Format("img/{0:G}", value));

images[1] = value;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Volplane/Code/Core/JSONArrayPool.cs
Expand Up @@ -47,4 +47,4 @@ public void Return(char[] array)
ArrayPool<char>.Shared.Return(array);
}
}
}
}
18 changes: 9 additions & 9 deletions Assets/Volplane/Code/Core/VInput.ElementInput.cs
Expand Up @@ -23,7 +23,7 @@ namespace Volplane
{
using Newtonsoft.Json;
using System.IO;
using UnityEngine;
using UnityEngine;

public sealed partial class VInput
{
Expand Down Expand Up @@ -93,20 +93,20 @@ public enum InputType
public bool Move { get; set; } // Moved input indicator
public bool HadDirections { get; set; } // Triggered directions input indicator

public float X { get; set; } // Coordinates
public float Y { get; set; }
public float X { get; set; } // Coordinates
public float Y { get; set; }

public float Distance { get; set; } // Swipe distance
public float Angle { get; set; } // Swipe angle in radians
public float Degree { get; set; } // Swipe angle in degree
public float Speed { get; set; } // Swipe speed

public float AX { get; set; } // Accelerometer (x, y, z)
public float AY { get; set; }
public float AZ { get; set; }
public float Alpha { get; set; } // Gyroscope (alpha, beta, gamma)
public float Beta { get; set; }
public float Gamma { get; set; }
public float AX { get; set; } // Accelerometer (x, y, z)
public float AY { get; set; }
public float AZ { get; set; }
public float Alpha { get; set; } // Gyroscope (alpha, beta, gamma)
public float Beta { get; set; }
public float Gamma { get; set; }

public int Delay { get; set; } // Connection delay
public bool Dirty { get; set; } // Changed input indicator
Expand Down
2 changes: 1 addition & 1 deletion Assets/Volplane/Code/Core/VolplaneAgent.cs
Expand Up @@ -631,7 +631,7 @@ protected int AddPlayer(int acDeviceId)
// Create new player and subscribe state change event for updating custom device state
VPlayer newPlayer = new VPlayer(acDeviceId);

Action<bool> updateState = delegate(bool active) {
Action<bool> updateState = (active) => {
VolplaneAgent.CustomState.Active[acDeviceId] = active;
VolplaneController.AirConsole.SetCustomDeviceState(VolplaneAgent.CustomState.ToJSON());
};
Expand Down
4 changes: 2 additions & 2 deletions Assets/Volplane/Code/Editor/Build/PostProcessor.cs
Expand Up @@ -41,7 +41,7 @@ public static void OnPostprocessBuild(BuildTarget target, string path)
// Rename 'index.html' to 'screen.hmtl'
File.Move(path + "/index.html", path + "/screen.html");

#if UNITY_5_6_OR_NEWER
#if UNITY_5_6_OR_NEWER

// Delete existing 'game.json' (previous build)
if(File.Exists(path + "/Build/game.json"))
Expand All @@ -53,7 +53,7 @@ public static void OnPostprocessBuild(BuildTarget target, string path)
path + "/Build/game.json"
);

#endif
#endif

// Save build path in preferences
EditorPrefs.SetString("BuildPath", path);
Expand Down
84 changes: 42 additions & 42 deletions Assets/Volplane/Code/Editor/UI/NewControllerWindow.cs
Expand Up @@ -36,14 +36,14 @@ public class NewControllerWindow : EditorWindow
public static NewControllerWindow window;

private string tempName;
private string errorString;
private string errorString;
private Regex namingConventions;
private GUIStyle labelFormat, errorFormat, buttonFormat, inputFormat;

/// <summary>
/// Occurs when a new controller was created.
/// </summary>
public event Action<string> ControllerCreated;
/// <summary>
/// Occurs when a new controller was created.
/// </summary>
public event Action<string> ControllerCreated;

/// <summary>
/// Init this instance.
Expand All @@ -60,8 +60,8 @@ public static void Init()
protected virtual void OnEnable()
{
namingConventions = new Regex(@"([^a-zA-Z0-9_-]+)");
tempName = "";
errorString = "";
tempName = "";
errorString = "";
}

/// <summary>
Expand All @@ -74,9 +74,9 @@ protected virtual void OnGUI()
labelFormat.alignment = TextAnchor.MiddleCenter;
labelFormat.fontSize = 12;

// Label error style
errorFormat = new GUIStyle(labelFormat);
errorFormat.normal.textColor = Color.red;
// Label error style
errorFormat = new GUIStyle(labelFormat);
errorFormat.normal.textColor = Color.red;

// Input style
inputFormat = new GUIStyle(GUI.skin.textField);
Expand All @@ -90,61 +90,61 @@ protected virtual void OnGUI()
buttonFormat.fixedWidth = 100;


// Name
// Name
GUILayout.Space(10f);
EditorGUILayout.LabelField("Enter a name for this controller:", labelFormat);
GUILayout.Space(10f);

// Input
tempName = EditorGUILayout.TextField(tempName, inputFormat);
// Input
tempName = EditorGUILayout.TextField(tempName, inputFormat);
GUILayout.Space(14f);

// Error
EditorGUILayout.LabelField(errorString, errorFormat);
GUILayout.Space(20f);
// Error
EditorGUILayout.LabelField(errorString, errorFormat);
GUILayout.Space(20f);

// Buttons
// Buttons
EditorGUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();

// Cancel button
// Cancel button
if(GUILayout.Button("Cancel", buttonFormat))
{
NewControllerWindow.window.Close();
}

GUILayout.FlexibleSpace();

// Create new controller
// Create new controller
if(GUILayout.Button("OK", buttonFormat))
{
// Check length
{
// Check length
if(tempName.Length >= 3)
{
// Check for special chars
if(!namingConventions.Match(tempName).Success)
{
{
// Check for special chars
if(!namingConventions.Match(tempName).Success)
{
JObject controller = new JObject();
controller.Add("name", tempName);
controller.Add("views", new JObject());

FileManager.WriteJSON(controller, String.Format("{0:G}{1:G}/data/controller/{2:G}.json", Application.dataPath, Config.WebServerPath, tempName));

// Fire controller created event
if(ControllerCreated != null)
ControllerCreated(tempName);

NewControllerWindow.window.Close();
}
else
{
errorString = "The controller name must not have any special characters\nwith the exception of '-' and '_'.";
}
}
else
{
errorString = "The controller name must be at least three characters long.";
}
FileManager.WriteJSON(controller, String.Format("{0:G}{1:G}/data/controller/{2:G}.json", Application.dataPath, Config.WebServerPath, tempName));

// Fire controller created event
if(ControllerCreated != null)
ControllerCreated(tempName);

NewControllerWindow.window.Close();
}
else
{
errorString = "The controller name must not have any special characters\nwith the exception of '-' and '_'.";
}
}
else
{
errorString = "The controller name must be at least three characters long.";
}
}

GUILayout.FlexibleSpace();
Expand Down

0 comments on commit ca3a788

Please sign in to comment.