mirror of
https://github.com/riperiperi/FreeSO
synced 2026-08-13 20:26:13 -04:00
MPL per-file was used in older project files, but should apply to the whole project, so having it there was redundant.
60 lines
1.7 KiB
C#
60 lines
1.7 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
using FSO.SimAntics.Engine;
|
|
using FSO.SimAntics.Engine.Primitives;
|
|
using FSO.IDE.EditorComponent.Primitives;
|
|
|
|
namespace FSO.IDE.EditorComponent.OperandForms
|
|
{
|
|
public partial class OpAnimControl : UserControl, IOpControl
|
|
{
|
|
private BHAVEditor Master;
|
|
private VMAnimateSimOperand Operand;
|
|
private EditorScope Scope;
|
|
|
|
private string IndexProperty;
|
|
private string SourceProperty;
|
|
|
|
public OpAnimControl()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public OpAnimControl(BHAVEditor master, EditorScope scope, VMPrimitiveOperand operand, string title)
|
|
{
|
|
InitializeComponent();
|
|
this.Dock = DockStyle.Fill;
|
|
Master = master;
|
|
Scope = scope;
|
|
Operand = (VMAnimateSimOperand)operand;
|
|
TitleLabel.Text = title;
|
|
|
|
OperandUpdated();
|
|
}
|
|
|
|
public void OperandUpdated()
|
|
{
|
|
var op = Operand;
|
|
if (op.AnimationID == 0)
|
|
ObjectLabel.Text = "Stop Animation";
|
|
else
|
|
ObjectLabel.Text = AnimateSimDescriptor.GetAnimationName(Scope, op.Source, op.AnimationID);
|
|
}
|
|
|
|
private void EditButton_Click(object sender, EventArgs e)
|
|
{
|
|
var popup = new VarAnimSelect(AnimateSimDescriptor.GetAnimTable(Scope, Operand.Source), Operand.AnimationID);
|
|
popup.ShowDialog();
|
|
if (popup.DialogResult == DialogResult.OK)
|
|
{
|
|
Operand.AnimationID = (ushort)popup.SelectedAnim;
|
|
}
|
|
Master.SignalOperandUpdate();
|
|
}
|
|
|
|
private void TitleLabel_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|