Add quick interactions locally

This commit is contained in:
2025-03-31 04:02:39 +02:00
parent 5bb7a207f2
commit b7d4531ec8
134 changed files with 15494 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.IO;
using Barotrauma;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;
using System.Xml;
using System.Xml.Linq;
using HarmonyLib;
namespace QICrabUI
{
public partial class CUIComponent : IDisposable
{
private void SetupAnimations()
{
Animations = new Indexer<string, CUIAnimation>(
(key) => animations.GetValueOrDefault(key),
(key, value) => AddAnimation(key, value)
);
}
private Dictionary<string, CUIAnimation> animations = new();
public Indexer<string, CUIAnimation> Animations;
public void AddAnimation(string name, CUIAnimation animation)
{
animation.Target = this;
animations[name] = animation;
}
public void BlockChildrenAnimations()
{
foreach (CUIComponent child in Children)
{
foreach (CUIAnimation animation in child.animations.Values)
{
animation.Stop();
animation.Blocked = true;
}
child.BlockChildrenAnimations();
}
}
}
}