Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Falki-git committed Feb 19, 2024
1 parent c2c5648 commit 7d3fafc
Showing 1 changed file with 10 additions and 44 deletions.
54 changes: 10 additions & 44 deletions src/MicroEngineer/MicroEngineerPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using MicroEngineer.Windows;
using UitkForKsp2.API;
using UnityEngine;
using UnityEngine.UIElements;
using Utility = MicroEngineer.Utilities.Utility;

namespace MicroEngineer;
Expand Down Expand Up @@ -50,49 +49,6 @@ public override void OnInitialized()

MessageManager.Instance.SubscribeToMessages();

/*
// Load the UI from the asset bundle
var myFirstWindowUxml = AssetManager.GetAsset<VisualTreeAsset>(
// The case-insensitive path to the asset in the bundle is composed of:
// - The mod GUID:
$"{ModGuid}/" +
// - The name of the asset bundle:
"MicroEngineer_ui/" +
// - The path to the asset in your Unity project (without the "Assets/" part)
"ui/myfirstwindow/myfirstwindow.uxml"
);
*/

/*
// Create the window options object
var windowOptions = new WindowOptions
{
// The ID of the window. It should be unique to your mod.
WindowId = "MicroEngineer_MyFirstWindow",
// The transform of parent game object of the window.
// If null, it will be created under the main canvas.
Parent = null,
// Whether or not the window can be hidden with F2.
IsHidingEnabled = true,
// Whether to disable game input when typing into text fields.
DisableGameInputForTextFields = true,
MoveOptions = new MoveOptions
{
// Whether or not the window can be moved by dragging.
IsMovingEnabled = true,
// Whether or not the window can only be moved within the screen bounds.
CheckScreenBounds = true
}
};
*/

/*
// Create the window
var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);
// Add a controller for the UI to the window's game object
var myFirstWindowController = myFirstWindow.gameObject.AddComponent<MyFirstWindowController>();
*/

// Register Flight AppBar button
Appbar.RegisterAppButton(
ModName,
Expand Down Expand Up @@ -163,6 +119,16 @@ private System.Collections.IEnumerator DoFlightUpdate()

public void Update()
{
var activeVessel = GameManager.Instance?.Game?.ViewController?.GetActiveVehicle(true)?.GetSimVessel(true);
if (activeVessel != null)
{
var x = activeVessel.CenterOfMass;
var y = activeVessel.LabelPosition;
var z = activeVessel.gravityForPos;
var i = activeVessel.RevealMass();
var j = activeVessel.CurrentCoM;
}

// Keyboard shortcut for opening the UI
if ((Settings.EnableKeybinding?.Value ?? false) &&
(Settings.Keybind1.Value != KeyCode.None ? Input.GetKey(Settings.Keybind1.Value) : true) &&
Expand Down

0 comments on commit 7d3fafc

Please sign in to comment.