public DoGetHue( CyclingDyetub cd ) : base( 4, false, TargetFlags.None ) { m_CD = cd; }
public static bool TakePayment( Mobile from, CyclingDyetub cd ) { if ( cd.m_HasCost ) { Container bp = from.Backpack; if ( from.AccessLevel < AccessLevel.GameMaster && bp != null ) { if ( bp.ConsumeTotal( PayType(), HueCost() ) ) { from.PlaySound( 0x32 ); return true; } else { from.SendMessage( "Begging thy pardon, but thou can not afford that." ); return false; } } else return true; } else return true; }
public DoPreview( CyclingDyetub cd ) : base( 4, false, TargetFlags.None ) { m_CD = cd; }
public void DoStopStartHueCycle( Mobile from, CyclingDyetub cd ) { if ( !CheckRange( from, cd ) ) return; if ( !cd.m_IsCycling ) { cd.m_IsCycling = true; cd.DoHueTimer(); } else { cd.m_IsCycling = false; from.EndAction( typeof( CyclingDyetub ) ); } from.CloseGump( typeof( CyclingDyetubGump ) ); from.SendGump( new CyclingDyetubGump( from, m_CD ) ); }
public void DoCurHuePlus( Mobile from, CyclingDyetub cd ) { if ( !CheckRange( from, cd ) ) return; if ( cd.Hue > 2998 ) { from.SendMessage( "There are no hues above 2999." ); } else if ( !cd.m_IsCycling ) { cd.Hue++; } else { cd.m_IsCycling = false; from.EndAction( typeof( CyclingDyetub ) ); cd.Hue++; } cd.Name = "Dyetub Hue # " + cd.Hue; from.CloseGump( typeof( CyclingDyetubGump ) ); from.SendGump( new CyclingDyetubGump( from, cd ) ); }
public void DoCurHueMinus( Mobile from, CyclingDyetub cd ) { if ( !CheckRange( from, m_CD ) ) return; if ( !cd.m_IsCycling ) { if ( cd.Hue >= 1 ) cd.Hue--; } else { cd.m_IsCycling = false; from.EndAction( typeof( CyclingDyetub ) ); if ( cd.Hue >= 1 ) cd.Hue--; } cd.Name = "Dyetub Hue # " + cd.Hue; from.CloseGump( typeof( CyclingDyetubGump ) ); from.SendGump( new CyclingDyetubGump( from, cd ) ); }
public static void DoExit( Mobile from, CyclingDyetub cd ) { if ( cd.m_IsCycling ) { cd.m_IsCycling = false; from.EndAction( typeof( CyclingDyetub ) ); } if ( cd.Hue != 0 ) { cd.Hue = 0; cd.Name = "Dyetub Hue # " + cd.Hue; } if ( cd.ItemID != 0xFAB ) cd.ItemID = 0xFAB; from.CloseGump( typeof( CyclingDyetubGump ) ); }
public CyclingDyetubGump( Mobile from, CyclingDyetub cd ) : base( 0, 0 ) { m_CD = cd; this.Closable=false; this.Disposable=true; this.Dragable=true; this.Resizable=false; this.AddPage(0); this.AddBackground( 71, 78, 180, 92, 2620 ); this.AddBackground( 71, 162, 144, 84, 2620 ); this.AddBackground( 139, 238, 76, 35, 2620 ); this.AddLabel( 80, 90, 2416, @"Curent Hue:" ); this.AddButton(226, 90, 250, 251, (int)Buttons.CurHuePlus, GumpButtonType.Reply, 0); this.AddButton(166, 90, 252, 253, (int)Buttons.CurHueMinus, GumpButtonType.Reply, 0); this.AddTextEntry( 187, 90, 31, 20, 2416, 1, @"" + m_CD.Hue ); this.AddButton( 77, 116, 2124, 248, ( int )Buttons.ApplyHue, GumpButtonType.Reply, 0 ); this.AddLabel( 135, 116, 2416, @"to Target" ); this.AddLabel( 80, 138, 2416, @"Preview Item" ); this.AddButton( 162, 138, 2515, 2515, ( int )Buttons.Preview, GumpButtonType.Reply, 0 ); this.AddButton( 77, 173, ButtonID( m_CD ), ButtonID( m_CD ), ( int )Buttons.StopStartHueCycle, GumpButtonType.Reply, 0 ); this.AddLabel( 137, 174, 2416, @"Cycle Hues" ); this.AddLabel( 80, 195, 2416, @"Start Hue" ); this.AddTextEntry( 155, 195, 33, 20, 2416, 2, @"" + m_CD.m_HueStart );//Start hue this.AddLabel( 80, 215, 2416, @"Stop Hue" ); this.AddTextEntry( 155, 215, 33, 20, 2416, 3, @"" + m_CD.m_HueStop );//End hue this.AddButton( 73, 237, 1028, 1026, ( int )Buttons.Exit, GumpButtonType.Reply, 0 ); this.AddLabel( 145, 245, 2416, @"Get Hue" ); this.AddButton( 191, 249, 5300, 5300, ( int )Buttons.GetHue, GumpButtonType.Reply, 0 ); }
public static bool CheckRange( Mobile from, CyclingDyetub cd ) { if ( !from.InRange( cd.GetWorldLocation(), 2 ) ) { from.SendMessage( "The dyetub is too far away..." ); DoExit( from, cd ); return false; } else return true; }
public static int ButtonID( CyclingDyetub cd ) { if ( cd.m_IsCycling ) return 2116; else return 2113; }
public InternalTimer( CyclingDyetub item, TimeSpan next ) : base( next ) { m_item = item; //This section of assigning timer priority came from the RunUO Distro script: if ( next >= TwoMinutes ) Priority = TimerPriority.OneMinute; else if ( next >= ThirtySeconds ) Priority = TimerPriority.FiveSeconds; else if ( next >= TenSeconds ) Priority = TimerPriority.OneSecond; else if ( next >= OneSecond ) Priority = TimerPriority.TwoFiftyMS; else Priority = TimerPriority.TwentyFiveMS; }