Skip to content

Instantly share code, notes, and snippets.

View Spartan322's full-sized avatar

George L. Albany Spartan322

View GitHub Profile
extends Button
onready var normal_press_color = get_stylebox("pressed").bg_color
onready var normal_hover_color = get_stylebox("hover").bg_color
func _ready():
get_stylebox("pressed").bg_color = get_stylebox("hover").bg_color
get_stylebox("hover").bg_color = get_stylebox("normal").bg_color
func _process(_delta):
public static class SL
{
public static readonly Harmony Harmony = new Harmony("com.spartan322.spartanslib");
[HarmonyReversePatch]
public static void ReadyPrefix(Node __instance)
{
__instance.Wire();
}
// in physics process of the camera
// vpSize is the viewport size
// MouseWatcher.MouseOriginLocal is the last local mouse position tracked from one of my global classes
// if statement moves the camera on zoom in and not zoom out (to invert behavior make it more then, or remove the if if you want zoom in and out to move the camera
// and remove both statements if you don't want it to move)
var nzoom = Zoom.LinearInterpolate(Vector2.One * zoomFactor, ZoomSpeed * delta);
if (nzoom < Zoom)
Position = Position + (-0.5f * vpSize + MouseWatcher.MouseOriginLocal) * (Zoom - nzoom);
// in unhandled input of the camera (so a focused control element or other gui input can override it first so you don't accidentally zoom)
var ModName = XmlPeek("./mod.config", "/Mod/@name");
var target = Argument("target", "Build");
var configuration = Argument("configuration", "Release");
var HacknetDirectoryStr = Argument<string>("hacknet-dir", null);
var forceRunPatcherStr = Argument("forcePatch", "false");
var forceRunPatcher = forceRunPatcherStr?.ToLower() == "true";
if(forceRunPatcherStr == "")
forceRunPatcher = true;
var result = args.ReadArgs(
out var lastNamePos,
out var firstBadNamedArg,
new ArgAction(
new[] { "no-create", "c" },
arg => { noCreate = true; }),
new ArgAction(
new[] { "date", "d" },
arg => { if(DateTime.TryParse(arg.NextArgument, out var d)) date = d; }),
new ArgAction(
public static T Create<T>(Type[] types, params object[] args)
{
if (types.Length != args.Length)
throw new TypeLoadException();
var ctor = typeof(T).GetConstructor(types);
if (ctor == null) return default;
return GetActivator<T>(ctor)(args);
}
using System;
using System.Collections.Generic;
using System.Linq;
using Godot;
using SpartansLib;
using SpartansLib.Extensions;
namespace MSG.Source.Script.UI.Base
{
[Tool]
using System;
using System.Reflection;
using Godot;
using MSG.Source.Global.Attribute;
using MSG.Source.Utility;
using SpartansLib;
using SpartansLib.Extensions;
namespace MSG.Source
{

Core Genre: 2D Platformer

Input Types

  • Move Left
  • Move Right
  • Jump
  • Crouch

Mechanical Input

  • Ground Movement: Move player according to Left and Right Inputs if considered on ground
using System;
using System.Reflection;
using Godot;
using MSG.Source.Global.Attribute;
using MSG.Source.Utility;
using MSG.Source.Utility.Extension;
namespace MSG.Source
{
namespace Global