本文整理汇总了C#中Server.Gumps.Gump.Intern方法的典型用法代码示例。如果您正苦于以下问题:C# Gump.Intern方法的具体用法?C# Gump.Intern怎么用?C# Gump.Intern使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Gumps.Gump
的用法示例。
在下文中一共展示了Gump.Intern方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Compile
/// <summary>
/// Honestly...I don't know why this is here.
/// </summary>
/// <param name="page">The gump to reference.</param>
/// <returns>A string of the specially formatted gump entries.</returns>
public string Compile( Gump page)
{
string ret = "";
switch (m_Style)
{
case "details":
if( m_Background )
ret+= String.Format("{{ gumppictiled {0} {1} {2} {3} {4} }}", m_X, m_Y, m_Width, m_Height, m_BackgroundID );
int colWidth = Width/m_ColCount;
int i = 0;
int xbase = m_X;
while (i < columnValues.Count && i < m_ParentList.columns)
{
xbase = m_X + (i * colWidth);
object obj = columnValues[i];
if (obj is string)
{
string caption = (string)obj;
if (caption.Contains("</"))
ret += String.Format("{{ htmlgump {0} {1} {2} {3} {4} {5} {6} }}", m_X + (i * colWidth), m_Y, colWidth, m_Height, page.Intern(caption), false, false);
else
ret += String.Format("{{ text {0} {1} {2} {3} }}", m_X + (i * colWidth), m_Y, skin.NormalText, page.Intern(caption));
}
else if (obj is GumpButton)
{
GumpButton btn = (GumpButton)obj;
ret+= String.Format("{{ button {0} {1} {2} {3} {4} {5} {6} }}", xbase, m_Y, btn.NormalID, btn.PressedID, (int)btn.Type, btn.Param, btn.ButtonID );
}
else if (obj is GumpCheck)
{
GumpCheck chk = (GumpCheck)obj;
ret += String.Format("{{ checkbox {0} {1} {2} {3} {4} {5} }}", xbase, m_Y, chk.ActiveID, chk.InactiveID, chk.InitialState, chk.SwitchID);
}
ret+= String.Format("{{gumppictiled {0} {1} {2} {3} {4} }}", m_X+(i*colWidth), m_Y, skin.EntryDividerWidth, skin.EntryDividerHeight, skin.EntryDividerID );
i++;
}
break;
case "icons":
string caption2 = (string)columnValues[captionID];
if (caption2.Contains("</"))
ret += String.Format("{{ htmlgump {0} {1} {2} {3} {4} {5} {6} }}", m_X, m_Y+skin.EntryCaptionPositionY, skin.EntryCaptionWidth, skin.EntryCaptionHeight, page.Intern(caption2), false, false);
else
ret += String.Format("{{ text {0} {1} {2} {3} }}", m_X, m_Y + skin.EntryCaptionPositionY, skin.NormalText, page.Intern(caption2));
int id = skin.EntryDefaultIcon;
ret+= String.Format("{{ gumppictiled {0} {1} {2} {3} {4} }}", m_X, m_Y, m_Width, m_Height, m_BackgroundID);
if( arguments.ContainsKey( "icon" ) )
id = (int)arguments["icon"];
ret+= String.Format("{{ gumppictiled {0} {1} {2} {3} {4} }}", ((skin.EntryCaptionWidth-m_X)-skin.EntryIconWidth)/2, m_Y+skin.EntryIconY, skin.EntryIconWidth, skin.EntryIconHeight, id );
GumpButton btn2 = null;
if( arguments.ContainsKey("button") )
{
btn2 = (GumpButton)arguments["button"];
ret+= String.Format("{{ buttontileart {0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} }}", m_X, m_Y, skin.EntryButtonUnderlay, skin.EntryButtonUnderlay, (int)btn2.Type, btn2.Param, btn2.ButtonID, skin.EntryButtonUnderlay, skin.DefaultBackgroundColor, skin.EntryIconWidth, skin.EntryIconHeight );
}
break;
}
if (m_Tooltip)
ret += String.Format("{{ tooltip {0} }}", TooltipID);
return ret;
}