public Fade(int Color, float From, float To, float Duration) { this.m_Color = Color; this.m_From = From; this.m_Delta = To - From; this.m_Sync = new TimeSync((double)Duration); }
public void Start(bool update) { if (this.m_Sync == null) { if (m_SyncPool.Count > 0) { this.m_Sync = (TimeSync)m_SyncPool.Dequeue(); this.m_Sync.Initialize((double)this.m_Duration); } else { this.m_Sync = new TimeSync((double)this.m_Duration); } this.m_Advance = ((this.m_NewDir & 7) >= 1) && ((this.m_NewDir & 7) <= 4); if (this.m_Advance) { this.m_Mobile.SetLocation((short)this.m_NewX, (short)this.m_NewY, (short)this.m_NewZ); if (update) { this.m_Mobile.Update(); } if (this.m_Mobile.Player) { Renderer.eOffsetX += this.m_X; Renderer.eOffsetY += this.m_Y; } } } }
public GDamageLabel(int damage, Mobile m) : base(damage.ToString(), Engine.DefaultFont, Hues.Load(m.Flags[MobileFlag.Poisoned] ? 0x3f : 0x26), m.ScreenX, m.ScreenY - 30) { this.m_Mobile = m; this.m_Sync = new TimeSync(0.75); this.UpdatePosition(); }
protected void Fade_OnTick(Timer t) { if (this.m_Sync != null) { double normalized = this.m_Sync.Normalized; base.Alpha = this.m_FadeFrom + ((float)((this.m_FadeTo - this.m_FadeFrom) * normalized)); if (normalized >= 1.0) { this.m_Sync = null; if (this.State == FadeState.F2O) { this.State = FadeState.Opaque; } else if (this.State == FadeState.O2F) { this.State = FadeState.Faded; } } } else { t.Delete(); this.m_Timer = null; } }
public Fade(int Color, float From, float To, float Duration) { this.m_Color = Color; this.m_From = From; this.m_Delta = To - From; this.m_Sync = new TimeSync((double) Duration); }
private GDynamicMessage(bool unremovable, IMessageOwner owner, string text, IFont font, IHue hue, float duration) : base(text, font, hue, Hues.Load(0x35), 0, 0, null) { this.m_Unremovable = unremovable; base.m_OverridesCursor = false; this.m_Owner = owner; this.m_SolidDuration = duration; this.m_Dispose = new TimeSync((double)(this.m_SolidDuration + 1f)); }
public void WriteSignature() { if (this.m_Signature != null) { this.m_Signature.Visible = true; this.m_SignatureAnimation = new TimeSync(0.5); } }
public Rain(Random rnd) { switch ((m_Index % 8)) { case 0: this.m_xStart = rnd.Next(Engine.ScreenWidth) - Engine.ScreenWidth; this.m_yStart = rnd.Next(Engine.ScreenHeight) - Engine.ScreenHeight; break; case 1: this.m_xStart = rnd.Next(Engine.ScreenWidth); this.m_yStart = rnd.Next(Engine.ScreenHeight) - Engine.ScreenHeight; break; case 2: this.m_xStart = rnd.Next(Engine.ScreenWidth) - Engine.ScreenWidth; this.m_yStart = rnd.Next(Engine.ScreenHeight); break; case 3: this.m_xStart = rnd.Next(Engine.ScreenWidth) + Engine.ScreenWidth; this.m_yStart = rnd.Next(Engine.ScreenHeight) - Engine.ScreenHeight; break; case 4: this.m_xStart = rnd.Next(Engine.ScreenWidth) + Engine.ScreenWidth; this.m_yStart = rnd.Next(Engine.ScreenHeight); break; case 5: this.m_xStart = rnd.Next(Engine.ScreenWidth) + Engine.ScreenWidth; this.m_yStart = rnd.Next(Engine.ScreenHeight) + Engine.ScreenHeight; break; case 6: this.m_xStart = rnd.Next(Engine.ScreenWidth); this.m_yStart = rnd.Next(Engine.ScreenHeight) + Engine.ScreenHeight; break; case 7: this.m_xStart = rnd.Next(Engine.ScreenWidth) - Engine.ScreenWidth; this.m_yStart = rnd.Next(Engine.ScreenHeight) + Engine.ScreenHeight; break; } m_Index++; double d = 3.1415926535897931 * (0.45 + (rnd.NextDouble() * 0.1)); this.m_Angle = d; this.m_xEnd = this.m_xStart + ((Engine.ScreenWidth * 1.25) * Math.Cos(d)); this.m_yEnd = this.m_yStart + ((Engine.ScreenHeight * 1.25) * Math.Sin(d)); this.m_OnScreen = this.CheckOnScreen(); this.m_Random = rnd; this.m_Image = Engine.m_Rain; float num2 = 0.5f + ((float)(rnd.NextDouble() * 0.5)); this.m_Sync = new TimeSync((double)num2); this.m_SliceCheck = (int)(20f * num2); }
public GSystemMessage(string text, IFont font, IHue hue, float duration) : base(text, font, hue, 0, 0) { base.m_OverridesCursor = false; this.m_SolidDuration = duration; this.m_Dispose = new TimeSync((double)(this.m_SolidDuration + 1f)); this.m_UpdateTime = DateTime.Now; this.m_DupeCount = 1; this.m_OrigText = text; }
private GDynamicMessage(bool unremovable, IMessageOwner owner, string text, IFont font, IHue hue, float duration) : base(text, font, hue, Hues.Load(0x35), 0, 0, null) { this.m_Unremovable = unremovable; base.m_OverridesCursor = false; this.m_Owner = owner; this.m_SolidDuration = duration; this.m_Dispose = new TimeSync((double) (this.m_SolidDuration + 1f)); }
public Rain(Random rnd) { switch ((m_Index % 8)) { case 0: this.m_xStart = rnd.Next(Engine.ScreenWidth) - Engine.ScreenWidth; this.m_yStart = rnd.Next(Engine.ScreenHeight) - Engine.ScreenHeight; break; case 1: this.m_xStart = rnd.Next(Engine.ScreenWidth); this.m_yStart = rnd.Next(Engine.ScreenHeight) - Engine.ScreenHeight; break; case 2: this.m_xStart = rnd.Next(Engine.ScreenWidth) - Engine.ScreenWidth; this.m_yStart = rnd.Next(Engine.ScreenHeight); break; case 3: this.m_xStart = rnd.Next(Engine.ScreenWidth) + Engine.ScreenWidth; this.m_yStart = rnd.Next(Engine.ScreenHeight) - Engine.ScreenHeight; break; case 4: this.m_xStart = rnd.Next(Engine.ScreenWidth) + Engine.ScreenWidth; this.m_yStart = rnd.Next(Engine.ScreenHeight); break; case 5: this.m_xStart = rnd.Next(Engine.ScreenWidth) + Engine.ScreenWidth; this.m_yStart = rnd.Next(Engine.ScreenHeight) + Engine.ScreenHeight; break; case 6: this.m_xStart = rnd.Next(Engine.ScreenWidth); this.m_yStart = rnd.Next(Engine.ScreenHeight) + Engine.ScreenHeight; break; case 7: this.m_xStart = rnd.Next(Engine.ScreenWidth) - Engine.ScreenWidth; this.m_yStart = rnd.Next(Engine.ScreenHeight) + Engine.ScreenHeight; break; } m_Index++; double d = 3.1415926535897931 * (0.45 + (rnd.NextDouble() * 0.1)); this.m_Angle = d; this.m_xEnd = this.m_xStart + ((Engine.ScreenWidth * 1.25) * Math.Cos(d)); this.m_yEnd = this.m_yStart + ((Engine.ScreenHeight * 1.25) * Math.Sin(d)); this.m_OnScreen = this.CheckOnScreen(); this.m_Random = rnd; this.m_Image = Engine.m_Rain; float num2 = 0.5f + ((float) (rnd.NextDouble() * 0.5)); this.m_Sync = new TimeSync((double) num2); this.m_SliceCheck = (int) (20f * num2); }
public GSystemMessage(string text, IFont font, IHue hue, float duration) : base(text, font, hue, 0, 0) { base.m_OverridesCursor = false; this.m_SolidDuration = duration; this.m_Dispose = new TimeSync((double) (this.m_SolidDuration + 1f)); this.m_UpdateTime = DateTime.Now; this.m_DupeCount = 1; this.m_OrigText = text; }
protected internal override void Draw(int X, int Y) { this.m_LastX = X; if (Y != this.m_LastY) { this.m_LastY = Y; Clipper clipper = new Clipper(this.m_LastX + 1, this.m_LastY + 1, base.m_Width - 2, base.m_Height - 2); Gump[] gumpArray = base.m_Children.ToArray(); for (int i = 1; i < gumpArray.Length; i++) { ((GTextButton)gumpArray[i]).Scissor(clipper); } } if ((Gumps.LastOver != null) && Gumps.LastOver.IsChildOf(this)) { if (!this.m_Expanded && !this.m_Expanding) { this.m_From = this.Height; this.m_To = this.m_ExpandedHeight; this.m_Sync = new TimeSync(0.10000000149011612); this.m_Timer.Start(false); this.m_Expanded = false; this.m_Expanding = true; this.m_Compacted = false; this.m_Compacting = false; } } else if (!this.m_Compacted && !this.m_Compacting) { this.m_From = this.Height; this.m_To = this.m_CompactHeight; this.m_Sync = new TimeSync(0.10000000149011612); this.m_Timer.Start(false); this.m_Expanded = false; this.m_Expanding = false; this.m_Compacted = false; this.m_Compacting = true; } Renderer.SetTexture(null); Renderer.SetAlphaEnable(true); Renderer.AlphaTestEnable = false; Renderer.SetAlpha(0.5f); Renderer.DrawLine(X + 20, (Y + this.m_CompactHeight) - 1, (X + base.m_Width) - 20, (Y + this.m_CompactHeight) - 1); Renderer.SetAlphaEnable(false); Renderer.AlphaTestEnable = true; base.Draw(X, Y); }
public GObjectProperties(int number, object o, ObjectPropertyList propList) : base(0, 0, 2, 20) { this.m_Object = o; base.m_CanDrag = false; this.m_Timer = new Timer(new OnTick(this.Roll_OnTick), 0); this.m_Timer.Start(false); int length = propList.Properties.Length; if ((length == 0) && (number != -1)) { length = 1; } this.SetList(number, propList); this.m_WidthDuration = this.m_TotalWidth * 0.000625; this.m_HeightDuration = length * 0.0125; this.m_Sync = new TimeSync(this.m_WidthDuration + this.m_HeightDuration); }
protected internal override void Draw(int x, int y) { if ((this.m_xLast != x) || (this.m_yLast != y)) { this.m_xLast = x; this.m_yLast = y; Clipper clipper = new Clipper(x + 0x20, y + 0x42, 0xc4, 0x5c); this.m_ContentClipper = clipper; foreach (Gump gump in base.m_Children.ToArray()) { if (gump is GBuyGump_OfferedItem) { ((GBuyGump_OfferedItem)gump).Clipper = clipper; } } } if ((this.m_Signature != null) && (this.m_SignatureAnimation != null)) { double normalized = this.m_SignatureAnimation.Normalized; if (normalized >= 1.0) { this.m_Signature.Scissor(null); this.m_SignatureAnimation = null; } else { this.m_Signature.Scissor(0, 0, (int)(normalized * this.m_Signature.Width), this.m_Signature.Height); } Engine.Redraw(); } if (this.m_LastHeight >= 0) { this.m_yOffset = 0x43 - ((int)((this.m_Slider.GetValue() / 50.0) * this.m_LastHeight)); } else { this.m_yOffset = 0x43; } this.m_LastOffset = 0x43 - this.m_yOffset; base.Draw(x, y); }
protected internal override void Draw(int x, int y) { if ((this.m_xLast != x) || (this.m_yLast != y)) { this.m_xLast = x; this.m_yLast = y; Clipper clipper = new Clipper(x + 0x20, y + 0x42, 0xc4, 0x5c); this.m_ContentClipper = clipper; foreach (Gump gump in base.m_Children.ToArray()) { if (gump is GBuyGump_OfferedItem) { ((GBuyGump_OfferedItem) gump).Clipper = clipper; } } } if ((this.m_Signature != null) && (this.m_SignatureAnimation != null)) { double normalized = this.m_SignatureAnimation.Normalized; if (normalized >= 1.0) { this.m_Signature.Scissor(null); this.m_SignatureAnimation = null; } else { this.m_Signature.Scissor(0, 0, (int) (normalized * this.m_Signature.Width), this.m_Signature.Height); } Engine.Redraw(); } if (this.m_LastHeight >= 0) { this.m_yOffset = 0x43 - ((int) ((this.m_Slider.GetValue() / 50.0) * this.m_LastHeight)); } else { this.m_yOffset = 0x43; } this.m_LastOffset = 0x43 - this.m_yOffset; base.Draw(x, y); }
public override void OnStart() { this.m_Start = Renderer.m_Frames; this.m_Sync = new TimeSync(0.25); }
private void Initialize(Mobile m, int NewX, int NewY, int NewZ, int NewDir) { this.m_Mobile = m; this.m_NewX = NewX; this.m_NewY = NewY; this.m_NewZ = NewZ; this.m_NewDir = NewDir; int x = 0; int y = 0; int z = 0; if (m.Walking.Count == 0) { x = m.X; y = m.Y; z = m.Z; } else { IEnumerator enumerator = m.Walking.GetEnumerator(); WalkAnimation current = null; while (enumerator.MoveNext()) { current = (WalkAnimation)enumerator.Current; } if (current != null) { x = current.m_NewX; y = current.m_NewY; z = current.m_NewZ; } } if (!m.Player) { Engine.EquipSort(m, NewDir & 0x87); m.Direction = (byte)NewDir; } this.m_Advance = false; this.m_Sync = null; if (((x != NewX) || (y != NewY)) || (z != NewZ)) { int num4 = NewX - x; int num5 = NewY - y; int num6 = NewZ - z; int num7 = (num4 - num5) * 0x16; int num8 = ((num4 + num5) * 0x16) - (num6 * 4); this.m_X = num7; this.m_Y = num8; int idx = (NewDir >> 7) & 1; ArrayList equip = m.Equip; bool mounted = (equip.Count > 0) && (((EquipEntry)equip[0]).m_Layer == Layer.Mount); if ((m.Player && Engine.GMPrivs) && ((Engine.m_WalkSpeed != 0.4f) || (Engine.m_RunSpeed != 0.2f))) { this.m_Duration = (idx == 0) ? Engine.m_WalkSpeed : Engine.m_RunSpeed; } else { this.m_Duration = GetDuration(mounted, idx); } if (m.Player && (m.Body == 0x3db)) { this.m_Duration *= 0.25f; } this.m_Frames = GetFrames(mounted, idx); } else { this.m_X = 0; this.m_Y = 0; this.m_Duration = 0.1f; this.m_Frames = 0f; } }
private void Initialize(Mobile m, int NewX, int NewY, int NewZ, int NewDir) { this.m_Mobile = m; this.m_NewX = NewX; this.m_NewY = NewY; this.m_NewZ = NewZ; this.m_NewDir = NewDir; int x = 0; int y = 0; int z = 0; if (m.Walking.Count == 0) { x = m.X; y = m.Y; z = m.Z; } else { IEnumerator enumerator = m.Walking.GetEnumerator(); WalkAnimation current = null; while (enumerator.MoveNext()) { current = (WalkAnimation) enumerator.Current; } if (current != null) { x = current.m_NewX; y = current.m_NewY; z = current.m_NewZ; } } if (!m.Player) { Engine.EquipSort(m, NewDir & 0x87); m.Direction = (byte) NewDir; } this.m_Advance = false; this.m_Sync = null; if (((x != NewX) || (y != NewY)) || (z != NewZ)) { int num4 = NewX - x; int num5 = NewY - y; int num6 = NewZ - z; int num7 = (num4 - num5) * 0x16; int num8 = ((num4 + num5) * 0x16) - (num6 * 4); this.m_X = num7; this.m_Y = num8; int idx = (NewDir >> 7) & 1; ArrayList equip = m.Equip; bool mounted = (equip.Count > 0) && (((EquipEntry) equip[0]).m_Layer == Layer.Mount); if ((m.Player && Engine.GMPrivs) && ((Engine.m_WalkSpeed != 0.4f) || (Engine.m_RunSpeed != 0.2f))) { this.m_Duration = (idx == 0) ? Engine.m_WalkSpeed : Engine.m_RunSpeed; } else { this.m_Duration = GetDuration(mounted, idx); } if (m.Player && (m.Body == 0x3db)) { this.m_Duration *= 0.25f; } this.m_Frames = GetFrames(mounted, idx); } else { this.m_X = 0; this.m_Y = 0; this.m_Duration = 0.1f; this.m_Frames = 0f; } }
public void Dispose() { this.m_Disposing = true; this.m_Sync = new TimeSync(1.0); }
public void Start(bool update) { if (this.m_Sync == null) { if (m_SyncPool.Count > 0) { this.m_Sync = (TimeSync) m_SyncPool.Dequeue(); this.m_Sync.Initialize((double) this.m_Duration); } else { this.m_Sync = new TimeSync((double) this.m_Duration); } this.m_Advance = ((this.m_NewDir & 7) >= 1) && ((this.m_NewDir & 7) <= 4); if (this.m_Advance) { this.m_Mobile.SetLocation((short) this.m_NewX, (short) this.m_NewY, (short) this.m_NewZ); if (update) { this.m_Mobile.Update(); } if (this.m_Mobile.Player) { Renderer.eOffsetX += this.m_X; Renderer.eOffsetY += this.m_Y; } } } }
protected void Fade_OnTick(Timer t) { if (this.m_Sync != null) { double normalized = this.m_Sync.Normalized; base.Alpha = this.m_FadeFrom + ((float) ((this.m_FadeTo - this.m_FadeFrom) * normalized)); if (normalized >= 1.0) { this.m_Sync = null; if (this.State == FadeState.F2O) { this.State = FadeState.Opaque; } else if (this.State == FadeState.O2F) { this.State = FadeState.Faded; } } } else { t.Delete(); this.m_Timer = null; } }
protected internal override void Draw(int X, int Y) { this.m_LastX = X; if (Y != this.m_LastY) { this.m_LastY = Y; Clipper clipper = new Clipper(this.m_LastX + 1, this.m_LastY + 1, base.m_Width - 2, base.m_Height - 2); Gump[] gumpArray = base.m_Children.ToArray(); for (int i = 1; i < gumpArray.Length; i++) { ((GTextButton) gumpArray[i]).Scissor(clipper); } } if ((Gumps.LastOver != null) && Gumps.LastOver.IsChildOf(this)) { if (!this.m_Expanded && !this.m_Expanding) { this.m_From = this.Height; this.m_To = this.m_ExpandedHeight; this.m_Sync = new TimeSync(0.10000000149011612); this.m_Timer.Start(false); this.m_Expanded = false; this.m_Expanding = true; this.m_Compacted = false; this.m_Compacting = false; } } else if (!this.m_Compacted && !this.m_Compacting) { this.m_From = this.Height; this.m_To = this.m_CompactHeight; this.m_Sync = new TimeSync(0.10000000149011612); this.m_Timer.Start(false); this.m_Expanded = false; this.m_Expanding = false; this.m_Compacted = false; this.m_Compacting = true; } Renderer.SetTexture(null); Renderer.SetAlphaEnable(true); Renderer.AlphaTestEnable = false; Renderer.SetAlpha(0.5f); Renderer.DrawLine(X + 20, (Y + this.m_CompactHeight) - 1, (X + base.m_Width) - 20, (Y + this.m_CompactHeight) - 1); Renderer.SetAlphaEnable(false); Renderer.AlphaTestEnable = true; base.Draw(X, Y); }