Primitive 0x006B - Animate Overlay


Use

There is a SimPe wizard for this instruction.


See Also


SimPe Code

// Decompiled with JetBrains decompiler
// Type: pjse.BhavNameWizards.WizPrim0x006b
// Assembly: pjse.coder.plugin, Version=4.0.3349.37576, Culture=neutral, PublicKeyToken=null

using pjse.BhavOperandWizards;
using SimPe;
using SimPe.PackedFiles.Wrapper;
using System;

namespace pjse.BhavNameWizards
{
  public class WizPrim0x006b : BhavWizPrim
  {
    public WizPrim0x006b(Instruction i)
      : base(i)
    {
    }

    public override ABhavOperandWiz Wizard() => (ABhavOperandWiz) new BhavOperandWizAnimate(this.instruction, "bwp_Overlay");

    protected override string Operands(bool lng)
    {
      byte[] numArray = new byte[16];
      ((byte[]) this.instruction.Operands).CopyTo((Array) numArray, 0);
      ((byte[]) this.instruction.Reserved1).CopyTo((Array) numArray, 8);
      string str1 = "" + (lng ? pjse.Localization.GetString("Object") + ": " : "") + this.dataOwner(lng, numArray[6], numArray[7], numArray[8]);
      Scope scope1 = Scope.Private;
      GS.GlobalStr instance;
      if (numArray[9] == (byte) 128)
      {
        instance = GS.GlobalStr.AdultAnims;
        scope1 = Scope.Global;
      }
      else
      {
        try
        {
          instance = (GS.GlobalStr) numArray[9];
          if (!instance.ToString().EndsWith("Anims"))
            instance = GS.GlobalStr.ObjectAnims;
        }
        catch
        {
          instance = GS.GlobalStr.ObjectAnims;
        }
      }
      string str2 = str1;
      string str3 = lng ? pjse.Localization.GetString("bwp_animation") + ": " : "";
      string str4;
      if (((int) numArray[2] & 4) == 0)
        str4 = this.readStr(scope1, instance, BhavWiz.ToShort(numArray[0], numArray[1]), lng ? -1 : 60, lng ? Detail.Full : Detail.ErrorNames);
      else
        str4 = instance.ToString() + ":[" + this.dataOwner(lng, (byte) 9, numArray[0], numArray[1]) + "]" + (lng ? " (" + pjse.Localization.GetString(scope1.ToString()) + ")" : "");
      string str5 = str2 + ", " + str3 + str4;
      if (lng)
      {
        bool found = false;
        string str6 = str5 + ", " + pjse.Localization.GetString("bwp_eventTree") + ": " + this.bhavName((uint) BhavWiz.ToShort(numArray[4], numArray[5]), ref found);
        Scope scope2 = Scope.Global;
        if (numArray[14] == (byte) 0)
          scope2 = Scope.Private;
        else if (numArray[14] == (byte) 1)
          scope2 = Scope.SemiGlobal;
        string str7 = str6 + " (" + pjse.Localization.GetString(scope2.ToString()) + ")" + ", " + pjse.Localization.GetString("bwp_animSpeed") + ": " + (((int) numArray[2] & 2) != 0 ? this.dataOwner((byte) 8, (ushort) 2) : "---") + ", " + pjse.Localization.GetString("bwp_interruptible") + ": " + (((int) numArray[2] & 8) != 0).ToString() + ", " + pjse.Localization.GetString("bwp_startTag") + ": " + (((int) numArray[2] & 16) != 0 ? this.dataOwner((byte) 8, (ushort) 0) : "---") + ", " + pjse.Localization.GetString("bwp_loopCount") + ": " + (((int) numArray[2] & 32) != 0 ? this.dataOwner((byte) 8, (ushort) 1) : "---") + ", " + pjse.Localization.GetString("bwp_blendOut") + ": " + (((int) numArray[2] & 64) == 0).ToString() + ", " + pjse.Localization.GetString("bwp_blendIn") + ": " + (((int) numArray[2] & 128) == 0).ToString() + ", " + pjse.Localization.GetString("bwp_flipFlag") + ": " + (((int) numArray[15] & 1) != 0 ? this.dataOwner((byte) 8, (ushort) 3) : (((int) numArray[2] & 1) != 0).ToString()) + ", " + pjse.Localization.GetString("bwp_sync") + ": " + (((int) numArray[15] & 16) != 0).ToString() + ", " + pjse.Localization.GetString("bwp_alignBlend") + ": " + (((int) numArray[15] & 32) != 0).ToString();
        byte input;
        if (this.instruction.NodeVersion != (byte) 0)
        {
          str7 = str7 + ", " + pjse.Localization.GetString("bwp_notHurryable") + ": " + (((int) numArray[12] & 1) != 0).ToString();
          input = numArray[11];
        }
        else
          input = numArray[12];
        string str8 = str7 + ", " + pjse.Localization.GetString("bwp_priority") + ": 0x" + Helper.HexString(input) + " (";
        string str9;
        switch (input)
        {
          case 0:
            str9 = str8 + pjse.Localization.GetString("bwp_low");
            break;
          case 1:
            str9 = str8 + pjse.Localization.GetString("bwp_medium");
            break;
          case 2:
            str9 = str8 + pjse.Localization.GetString("bwp_high");
            break;
          default:
            str9 = str8 + pjse.Localization.GetString("unk");
            break;
        }
        str5 = str9 + ")";
      }
      return str5;
    }
  }
}