UO-Dev Arama


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


Paylaş : Paylaş

using System;

namespace Server.Gumps
{
public abstract class BaseGridGump : Gump
{
private int m_CurrentX, m_CurrentY;
private int m_CurrentPage;

protected GumpBackground m_Background;
protected GumpImageTiled m_Offset;

public int CurrentPage
{
get{ return m_CurrentPage; }
}

public int CurrentX
{
get{ return m_CurrentX; }
}

public int CurrentY
{
get{ return m_CurrentY; }
}

public BaseGridGump( int x, int y ) : base( x, y )
{
}

public virtual int BorderSize{ get{ return 10; } }
public virtual int OffsetSize{ get{ return 1; } }

public virtual int EntryHeight{ get{ return 20; } }

public virtual int OffsetGumpID{ get{ return 0x0A40; } }
public virtual int HeaderGumpID{ get{ return 0x0E14; } }
public virtual int EntryGumpID{ get{ return 0x0BBC; } }
public virtual int BackGumpID{ get{ return 0x13BE; } }

public virtual int TextHue{ get{ return 0; } }
public virtual int TextOffsetX{ get{ return 2; } }

public const int ArrowLeftID1 = 0x15E3;
public const int ArrowLeftID2 = 0x15E7;
public const int ArrowLeftWidth = 16;
public const int ArrowLeftHeight = 16;

public const int ArrowRightID1 = 0x15E1;
public const int ArrowRightID2 = 0x15E5;
public const int ArrowRightWidth = 16;
public const int ArrowRightHeight = 16;

public string Center( string text )
{
return String.Format( "<CENTER>{0}</CENTER>", text );
}

public string Color( string text, int color )
{
return String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, text );
}

public int GetButtonID( int typeCount, int type, int index )
{
return 1 + (index * typeCount) + type;
}

public bool SplitButtonID( int buttonID, int typeCount, out int type, out int index )
{
if ( buttonID < 1 )
{
type = 0;
index = 0;
return false;
}

buttonID -= 1;

type = buttonID % typeCount;
index = buttonID / typeCount;

return true;
}

public void FinishPage()
{
if ( m_Background != null )
m_Background.Height = m_CurrentY + EntryHeight + OffsetSize + BorderSize;

if ( m_Offset != null )
m_Offset.Height = m_CurrentY + EntryHeight + OffsetSize - BorderSize;
}

public void AddNewPage()
{
FinishPage();

m_CurrentX = BorderSize + OffsetSize;
m_CurrentY = BorderSize + OffsetSize;

AddPage( ++m_CurrentPage );

m_Background = new GumpBackground( 0, 0, 100, 100, BackGumpID );
Add( m_Background );

m_Offset = new GumpImageTiled( BorderSize, BorderSize, 100, 100, OffsetGumpID );
Add( m_Offset );
}

public void AddNewLine()
{
m_CurrentY += EntryHeight + OffsetSize;
m_CurrentX = BorderSize + OffsetSize;
}

public void IncreaseX( int width )
{
m_CurrentX += width + OffsetSize;

width = m_CurrentX + BorderSize;

if ( m_Background != null && width > m_Background.Width )
m_Background.Width = width;

width = m_CurrentX - BorderSize;

if ( m_Offset != null && width > m_Offset.Width )
m_Offset.Width = width;
}

public void AddEntryLabel( int width, string text )
{
AddImageTiled( m_CurrentX, m_CurrentY, width, EntryHeight, EntryGumpID );
AddLabelCropped( m_CurrentX + TextOffsetX, m_CurrentY, width - TextOffsetX, EntryHeight, TextHue, text );

IncreaseX( width );
}

public void AddEntryHtml( int width, string text )
{
AddImageTiled( m_CurrentX, m_CurrentY, width, EntryHeight, EntryGumpID );
AddHtml( m_CurrentX + TextOffsetX, m_CurrentY, width - TextOffsetX, EntryHeight, text, false, false );

IncreaseX( width );
}

public void AddEntryHeader( int width )
{
AddEntryHeader( width, 1 );
}

public void AddEntryHeader( int width, int spannedEntries )
{
AddImageTiled( m_CurrentX, m_CurrentY, width, (EntryHeight * spannedEntries) + (OffsetSize * (spannedEntries - 1)), HeaderGumpID );
IncreaseX( width );
}

public void AddBlankLine()
{
if ( m_Offset != null )
AddImageTiled( m_Offset.X, m_CurrentY, m_Offset.Width, EntryHeight, BackGumpID + 4 );

AddNewLine();
}

public void AddEntryButton( int width, int normalID, int pressedID, int buttonID, int buttonWidth, int buttonHeight )
{
AddEntryButton( width, normalID, pressedID, buttonID, buttonWidth, buttonHeight, 1 );
}

public void AddEntryButton( int width, int normalID, int pressedID, int buttonID, int buttonWidth, int buttonHeight, int spannedEntries )
{
AddImageTiled( m_CurrentX, m_CurrentY, width, (EntryHeight * spannedEntries) + (OffsetSize * (spannedEntries - 1)), HeaderGumpID );
AddButton( m_CurrentX + ((width - buttonWidth) / 2), m_CurrentY + (((EntryHeight * spannedEntries) + (OffsetSize * (spannedEntries - 1)) - buttonHeight) / 2), normalID, pressedID, buttonID, GumpButtonType.Reply, 0 );

IncreaseX( width );
}

public void AddEntryPageButton( int width, int normalID, int pressedID, int page, int buttonWidth, int buttonHeight )
{
AddImageTiled( m_CurrentX, m_CurrentY, width, EntryHeight, HeaderGumpID );
AddButton( m_CurrentX + ((width - buttonWidth) / 2), m_CurrentY + ((EntryHeight - buttonHeight) / 2), normalID, pressedID, 0, GumpButtonType.Page, page );

IncreaseX( width );
}

public void AddEntryText( int width, int entryID, string initialText )
{
AddImageTiled( m_CurrentX, m_CurrentY, width, EntryHeight, EntryGumpID );
AddTextEntry( m_CurrentX + TextOffsetX, m_CurrentY, width - TextOffsetX, EntryHeight, TextHue, entryID, initialText );

IncreaseX( width );
}
}
}



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ı,