當前位置: 首頁>>代碼示例>>C#>>正文


C# Gump.Intern方法代碼示例

本文整理匯總了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;
		}
開發者ID:greeduomacro,項目名稱:unknown-shard-1,代碼行數:65,代碼來源:GumpList.cs


注:本文中的Server.Gumps.Gump.Intern方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。