Skip to content

Commit

Permalink
style: run code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
purifetchi committed Dec 13, 2022
1 parent 7cef54e commit 024c82e
Show file tree
Hide file tree
Showing 21 changed files with 49 additions and 51 deletions.
4 changes: 2 additions & 2 deletions VTTiny/Base/Texture.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using Raylib_cs;
using Raylib_cs;
using System;

namespace VTTiny
{
Expand Down
6 changes: 3 additions & 3 deletions VTTiny/Base/VTubeTiny.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json;
using Raylib_cs;
using System;
using System.IO;
using VTTiny.Data;
using VTTiny.Editor;
using VTTiny.Scenery;
Expand Down
6 changes: 3 additions & 3 deletions VTTiny/Base/Vector2Int.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static implicit operator Vector2(Vector2Int vec)
return new Vector2(vec.X, vec.Y);
}

public static Vector2Int operator-(Vector2Int left, Vector2Int right)
public static Vector2Int operator -(Vector2Int left, Vector2Int right)
{
return new Vector2Int(left.X - right.X, left.Y - right.Y);
}
Expand All @@ -36,7 +36,7 @@ public static implicit operator Vector2(Vector2Int vec)

public static bool operator ==(Vector2Int left, Vector2Int right)
{
return left.X == right.X &&
return left.X == right.X &&
left.Y == right.Y;
}

Expand All @@ -53,7 +53,7 @@ public Vector2Int(int x, int y)

public override bool Equals(object obj)
{
return obj is Vector2Int vec &&
return obj is Vector2Int vec &&
this == vec;
}

Expand Down
8 changes: 4 additions & 4 deletions VTTiny/Components/AudioResponsiveMovementComponent.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Linq;
using NAudio.CoreAudioApi;
using NAudio.CoreAudioApi;
using Newtonsoft.Json.Linq;
using System;
using System.Linq;
using VTTiny.Components.Data;
using VTTiny.Editor;
using VTTiny.Scenery;
Expand Down Expand Up @@ -154,7 +154,7 @@ public override void Destroy()
internal override void InheritParametersFromConfig(JObject parameters)
{
var config = JsonObjectToConfig<AudioResponsiveMovementConfig>(parameters);

if (string.IsNullOrEmpty(config.Microphone))
SetMicrophoneByName(GetDefaultMicrophone());

Expand Down
2 changes: 1 addition & 1 deletion VTTiny/Components/Component.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public T GetComponent<T>() where T : Component
/// <typeparam name="T">The type of the config.</typeparam>
/// <param name="parameters">The parameters JObject (supplied inside of InheritParametersFromConfig)</param>
/// <returns>Either a blank default config if parameters was null, or the decoded config.</returns>
internal T JsonObjectToConfig<T>(JObject parameters) where T: new()
internal T JsonObjectToConfig<T>(JObject parameters) where T : new()
{
if (parameters != null)
return parameters.ToObject<T>();
Expand Down
1 change: 0 additions & 1 deletion VTTiny/Components/SimpleCharacterAnimatorComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Newtonsoft.Json.Linq;
using Raylib_cs;
using VTTiny.Components.Data;
using VTTiny.Editor;
using VTTiny.Scenery;
Expand Down
4 changes: 2 additions & 2 deletions VTTiny/Data/Config.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Collections.Generic;
using Raylib_cs;
using Raylib_cs;
using System.Collections.Generic;

namespace VTTiny.Data
{
Expand Down
6 changes: 3 additions & 3 deletions VTTiny/Editor/EditorGUI.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using ImGuiNET;
using Raylib_cs;
using System;
using System.Linq;
using System.Numerics;
using System.Reflection;
using ImGuiNET;
using Raylib_cs;
using VTTiny.Components;

namespace VTTiny.Editor
Expand Down
4 changes: 2 additions & 2 deletions VTTiny/Editor/Native/ImGuiDockBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Runtime.InteropServices;
using ImGuiNET;
using ImGuiNET;
using System.Runtime.InteropServices;

namespace VTTiny.Editor.Native
{
Expand Down
4 changes: 2 additions & 2 deletions VTTiny/Editor/UI/Menu/MenuBar.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Collections.Generic;
using ImGuiNET;
using ImGuiNET;
using System.Collections.Generic;

namespace VTTiny.Editor.UI
{
Expand Down
4 changes: 2 additions & 2 deletions VTTiny/Editor/UI/Menu/MenuCategory.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using ImGuiNET;
using System;
using System.Collections.Generic;
using ImGuiNET;

namespace VTTiny.Editor.UI
{
Expand Down
2 changes: 1 addition & 1 deletion VTTiny/Editor/UI/Menu/ViewMenuCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public ViewMenuCategory(MenuBar menuBar)
{

}

protected override void InitializeBaseActions()
{
AddAction("Reset UI", editor =>
Expand Down
2 changes: 1 addition & 1 deletion VTTiny/Editor/UI/Windows/StagePropertiesWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class StagePropertiesWindow : EditorWindow, IStageAwareWindow
/// Creates a new stage properties window with a given stage.
/// </summary>
/// <param name="stage">The stage to set.</param>
public StagePropertiesWindow(Stage stage)
public StagePropertiesWindow(Stage stage)
: base("Stage Properties")
{
Stage = stage;
Expand Down
2 changes: 1 addition & 1 deletion VTTiny/Editor/UI/Windows/StageViewWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal class StageViewWindow : EditorWindow, IStageAwareWindow
/// Creates a new stage view for a given stage.
/// </summary>
/// <param name="stage">The stage to show.</param>
public StageViewWindow(Stage stage)
public StageViewWindow(Stage stage)
: base("Stage View", ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoResize)
{
SetStage(stage);
Expand Down
12 changes: 6 additions & 6 deletions VTTiny/Editor/VTubeTinyEditor.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using ImGuiNET;
using ImGuiNET;
using Raylib_cs;
using rlImGui_cs;
using System;
using System.Collections.Generic;
using VTTiny.Editor.Native;
using VTTiny.Editor.UI;
using VTTiny.Rendering;
Expand Down Expand Up @@ -64,7 +64,7 @@ internal void AddWindow(EditorWindow window)
/// </summary>
/// <typeparam name="T">The type of the window (must derive from `VTTiny.Editor.UI.EditorWindow`.</typeparam>
/// <returns>Either the window or null.</returns>
internal T GetWindow<T>() where T: EditorWindow
internal T GetWindow<T>() where T : EditorWindow
{
foreach (var window in _windows)
{
Expand Down Expand Up @@ -101,7 +101,7 @@ internal void ForEachWindowOfType<T>(Action<T> callback)
if (window is T type)
callback(type);
}
}
}

/// <summary>
/// Initializes the editor and all of the systems it needs.
Expand Down Expand Up @@ -147,7 +147,7 @@ public void Render()
foreach (var window in _windows)
{
window.Render();

if (_wasEditorListModified)
{
_wasEditorListModified = false;
Expand Down
9 changes: 4 additions & 5 deletions VTTiny/External/rlImGui-cs/rlImGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
*
********************************************************************************************/

using ImGuiNET;
using Raylib_cs;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Runtime.InteropServices;

using Raylib_cs;
using ImGuiNET;

namespace rlImGui_cs
{
public static class rlImGui
Expand Down Expand Up @@ -135,7 +134,7 @@ private static void NewFrame()
{
io.DisplaySize = new Vector2(Raylib.GetScreenWidth(), Raylib.GetScreenHeight());
}

io.DisplayFramebufferScale = new Vector2(1, 1);
io.DeltaTime = Raylib.GetFrameTime();

Expand Down Expand Up @@ -225,7 +224,7 @@ private static void EnableScissor(float x, float y, float width, float height)
private static void TriangleVert(ImDrawVertPtr idx_vert)
{
Vector4 color = ImGui.ColorConvertU32ToFloat4(idx_vert.col);

Rlgl.rlColor4f(color.X, color.Y, color.Z, color.W);
Rlgl.rlTexCoord2f(idx_vert.uv.X, idx_vert.uv.Y);
Rlgl.rlVertex2f(idx_vert.pos.X, idx_vert.pos.Y);
Expand Down
4 changes: 2 additions & 2 deletions VTTiny/Rendering/FramebufferRenderingContext.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using Raylib_cs;
using Raylib_cs;
using System;

namespace VTTiny.Rendering
{
Expand Down
4 changes: 2 additions & 2 deletions VTTiny/Scenery/Stage.Serialization.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
using VTTiny.Data;

namespace VTTiny.Scenery
Expand Down
4 changes: 2 additions & 2 deletions VTTiny/Scenery/Stage.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using Raylib_cs;
using System.Collections.Generic;
using System.Diagnostics;
using Raylib_cs;
using VTTiny.Data;
using VTTiny.Rendering;

Expand Down
4 changes: 2 additions & 2 deletions VTTiny/Scenery/StageActor.Editor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using ImGuiNET;
using ImGuiNET;
using System;
using VTTiny.Editor;

namespace VTTiny.Scenery
Expand Down
8 changes: 4 additions & 4 deletions VTTiny/Scenery/StageActor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using Raylib_cs;
using System;
using System.Collections.Generic;
using Raylib_cs;
using VTTiny.Components;

namespace VTTiny.Scenery
Expand Down Expand Up @@ -115,7 +115,7 @@ private Component ConstructComponentFromType(Type type)
/// </summary>
/// <typeparam name="T">The type of the component (Must derive from VTTiny.Components.Component).</typeparam>
/// <returns>The new component.</returns>
public T AddComponent<T>() where T: Component, new()
public T AddComponent<T>() where T : Component, new()
{
var component = new T();
InitializeComponent(component);
Expand All @@ -142,7 +142,7 @@ internal void InitializeComponent(Component component)
/// </summary>
/// <typeparam name="T">The type of the component (Must derive from VTTiny.Components.Component).</typeparam>
/// <returns>Either null if not found, or the component.</returns>
public T GetComponent<T>() where T: Component
public T GetComponent<T>() where T : Component
{
foreach (var component in _components)
{
Expand Down

0 comments on commit 024c82e

Please sign in to comment.