string Decompile(EventSetId id, EventSet set) { var sb = new StringBuilder(); var assets = Resolve <IAssetManager>(); var eventFormatter = new EventFormatter(assets.LoadString, id.ToEventText()); eventFormatter.FormatEventSetDecompiled(sb, set.Events, set.Chains, null, 0); return(sb.ToString()); }
public static VisitedEvent Serdes(int n, VisitedEvent u, AssetMapping mapping, ISerializer s) { if (s == null) { throw new ArgumentNullException(nameof(s)); } u ??= new VisitedEvent(); s.Begin(); u.Unk0 = s.UInt8(nameof(Unk0), u.Unk0); u.EventSetId = EventSetId.SerdesU16(nameof(EventSetId), u.EventSetId, mapping, s); u.Type = s.EnumU8(nameof(Type), u.Type); switch (u.Type) { case ActionType.AskAboutItem: case ActionType.UseItem: case ActionType.EquipItem: case ActionType.UnequipItem: case ActionType.PickupItem: u._value = ItemId.SerdesU16("Value", ItemId.FromUInt32(u._value), AssetType.Item, mapping, s).ToUInt32(); break; case ActionType.Word: u._value = WordId.SerdesU16("Value", WordId.FromUInt32(u._value), mapping, s).ToUInt32(); break; default: u._value = s.UInt16("Value", (ushort)u._value); break; } if (s.IsCommenting()) { s.Comment(u.ToString()); } s.End(); return(u); }
public EventTextEvent(EventSetId eventSetId, byte textId, TextLocation?location, SmallPortraitId?portrait) : base(textId, location, portrait) => EventSetId = eventSetId;
public EventSet(EventSetId id) => EventSetId = id;
public TriggerChainEvent(EventChain chain, IEventNode node, EventSetId eventSetId) : this(chain, node, new EventSource.EventSet(eventSetId)) { }