UO-Dev Arama


Yazar: Bilinmiyor
Tarih: 01-09-2009 00:01


Paylaş : Paylaş

Kod:
using System;
using Server;
using Server.Network;
using System.Collections;

namespace Server.Gumps
{
public class ImageTileButtonInfo
{
private int m_ItemID;
private int m_Hue;
private int m_LocalizedTooltip;

private TextDefinition m_Label;

public virtual int ItemID
{
get{ return m_ItemID; }
set{ m_ItemID = value; }
}
public virtual int Hue
{
get{ return m_Hue; }
set{ m_Hue = value; }
}
public virtual int LocalizedTooltip
{
get{ return m_LocalizedTooltip; }
set{ m_LocalizedTooltip = value; }
}

public virtual TextDefinition Label
{
get{ return m_Label; }
set{ m_Label = value; }
}

public ImageTileButtonInfo( int itemID, int hue, TextDefinition label, int localizedTooltip )
{
m_Hue = hue;
m_ItemID = itemID;
m_Label = label;
m_LocalizedTooltip = localizedTooltip;
}
public ImageTileButtonInfo( int itemID, int hue, TextDefinition label ) : this( itemID, hue, label, -1 )
{
}
}

public class BaseImageTileButtonsGump : Gump
{
private ImageTileButtonInfo[] m_Buttons;

protected ImageTileButtonInfo[] Buttons { get { return m_Buttons; } }

protected virtual int XItems{ get{ return 2; } }
protected virtual int YItems{ get { return 5; } }

public BaseImageTileButtonsGump( TextDefinition header, ArrayList buttons ) : this( header, (ImageTileButtonInfo[])buttons.ToArray( typeof( ImageTileButtonInfo ) ) )
{
}
public BaseImageTileButtonsGump( TextDefinition header, ImageTileButtonInfo[] buttons ) : base( 10, 10 ) //Coords are 0, o on OSI, intentional difference
{
m_Buttons = buttons;
AddPage( 0 );

int x = XItems * 250;
int y = YItems * 64;

AddBackground( 0, 0, x+20, y+84, 0x13BE );
AddImageTiled( 10, 10, x, 20, 0xA40 );
AddImageTiled( 10, 40, x, y+4, 0xA40 );
AddImageTiled( 10, y+54, x, 20, 0xA40 );
AddAlphaRegion( 10, 10, x, y+64 );

AddButton( 10, y+54, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0 ); //Cancel Button
AddHtmlLocalized( 45, y+56, x-50, 20, 1060051, 0x7FFF, false, false ); // CANCEL
TextDefinition.AddHtmlText( this, 14, 12, x, 20, header, false, false, 0x7FFF, 0xFFFFFF );

AddPage( 1 );

int itemsPerPage = XItems * YItems;

for( int i = 0; i < buttons.Length; i++ )
{
int position = i % itemsPerPage;

int innerX = (position % XItems) * 250 + 14;
int innerY = (position / XItems) * 64 + 44;

int pageNum = i / itemsPerPage + 1;

if( position == 0 && i != 0 )
{
AddButton( x-100, y+54, 0xFA5, 0xFA7, 0, GumpButtonType.Page, pageNum );
AddHtmlLocalized( x-60, y+56, 60, 20, 1043353, 0x7FFF, false, false ); // Next

AddPage( pageNum );

AddButton( x-200, y+54, 0xFAE, 0xFB0, 0, GumpButtonType.Page, pageNum - 1 );
AddHtmlLocalized( x-160, y+56, 60, 20, 1011393, 0x7FFF, false, false ); // Back

}

ImageTileButtonInfo b = buttons[i];

AddImageTiledButton( innerX, innerY, 0x918, 0x919, 100 + i, GumpButtonType.Reply, 0, b.ItemID, b.Hue, 15, 10, b.LocalizedTooltip );
TextDefinition.AddHtmlText( this, innerX + 84, innerY, 250, 60, b.Label, false, false, 0x7FFF, 0xFFFFFF );
}
}

public override void OnResponse( NetState sender, RelayInfo info )
{
int adjustedID = info.ButtonID - 100;

if( adjustedID >= 0 && adjustedID < Buttons.Length )
HandleButtonResponse( sender, adjustedID, Buttons[adjustedID] );
else
HandleCancel( sender );

}

public virtual void HandleButtonResponse( NetState sender, int adjustedButton, ImageTileButtonInfo buttonInfo )
{
}

public virtual void HandleCancel( NetState sender )
{
}
}
}



Yorumlar

Henüz yorum yapılmamıştır.

Oylamalar

Oylama :
Üyelerin oylama ortalaması (10 dışında) : Henüz Oylanmamış   
Oylar: 0

Benzer Sayfalar

SayfalarYorumlarGönderenTarih
Gump Studio 1.80basic27-01-2010
Gump tooltip art is wrong size0MagLor31-10-2009
Who Gump0Rowall01-09-2009
Warning Gump0Rowall01-09-2009
View Houses Gump0Rowall01-09-2009


Keywords:

ultima online, RunUO, ultima online download, sphere scripting, role play, uo grafik, second age ultima, uo loop, macroman, pvp server, server kurulumu, sphere, multool, ml mulls, 56b 55r 55i, htmlgumps, client 4x, client edit, sphere release, osi, rp server, sunucular, ghost mouse, inside uo, kingdom reborn, stygian abyss, uo nasıl oynanır, mondain's legacy, age of shadows, world build, grandmaster, ultima online pvp, player dosyaları, ultima online indir, frp game, RunUO 1.0.0, razor, uo rice, hue editör, skill tools, ultima online patch, axis, world build, verdata, verdata patcher, map editör, gump editör, mul patcher, aos mulls, scriptler, anim edit, anim publish, hues mul, hosting vps, event dialog, account sistemi, skill gain, static yapımı,