当前位置: 首页>>代码示例>>C#>>正文


C# UI.UIMouseEvent类代码示例

本文整理汇总了C#中Terraria.UI.UIMouseEvent的典型用法代码示例。如果您正苦于以下问题:C# UIMouseEvent类的具体用法?C# UIMouseEvent怎么用?C# UIMouseEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UIMouseEvent类属于Terraria.UI命名空间,在下文中一共展示了UIMouseEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Publish

		private void Publish(UIMouseEvent evt, UIElement listeningElement)
		{
			Main.PlaySound(10, -1, -1, 1);
			try
			{
				TmodFile[] modFiles = ModLoader.FindMods();
				bool ok = false;
				TmodFile theTModFile = null;
				foreach (TmodFile tModFile in modFiles)
				{
					if (Path.GetFileName(tModFile.Name).Equals(@Path.GetFileName(mod) + @".tmod"))
					{
						ok = true;
						theTModFile = tModFile;
					}
				}
				if (!ok)
				{
					throw new Exception();
				}
				System.Net.ServicePointManager.Expect100Continue = false;
				string filename = @ModLoader.ModPath + @Path.DirectorySeparatorChar + @Path.GetFileName(mod) + @".tmod";
				string url = "http://javid.ddns.net/tModLoader/publishmod.php";
				using (var stream = File.Open(filename, FileMode.Open))
				{
					var files = new[]
					{
						new IO.UploadFile
						{
							Name = "file",
							Filename = Path.GetFileName(filename),
							//    ContentType = "text/plain",
							Stream = stream
						}
					};
					BuildProperties bp = BuildProperties.ReadModFile(theTModFile);
					var values = new NameValueCollection
					{
						{ "displayname", bp.displayName },
						{ "name", Path.GetFileNameWithoutExtension(filename) },
						{ "version", bp.version },
						{ "author", bp.author },
						{ "homepage", bp.homepage },
						{ "description", bp.description },
						{ "steamid64", Steamworks.SteamUser.GetSteamID().ToString() },
						{ "modloaderversion", bp.modBuildVersion },
					};
					byte[] result = IO.UploadFile.UploadFiles(url, files, values);
					string s = System.Text.Encoding.UTF8.GetString(result, 0, result.Length);
					ErrorLogger.LogModPublish(s);
				}
			}
			catch (WebException e)
			{
				ErrorLogger.LogModBrowserException(e);
			}
		}
开发者ID:DrakoGlyph,项目名称:tModLoader,代码行数:57,代码来源:UIModSourceItem.cs

示例2: OKClick

		private void OKClick(UIMouseEvent evt, UIElement listeningElement)
		{
			Main.PlaySound(10, -1, -1, 1);
			ModLoader.modBrowserPassphrase = passcodeTextField.currentString;
			Main.SaveSettings();
			Main.menuMode = this.gotoMenu;
		}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:7,代码来源:UIEnterPassphraseMenu.cs

示例3: UIWindow_OnMouseDown

 void UIWindow_OnMouseDown(UIMouseEvent evt, UIElement listeningElement)
 {
     var element = UIController.GetElementAt(evt.MousePosition);
     if (element == this)
     {
         _dragging = true;
     }
 }
开发者ID:chatrat12,项目名称:Prism,代码行数:8,代码来源:PUIWindow.cs

示例4: NewCharacterClick

        private void NewCharacterClick(UIMouseEvent evt, UIElement listeningElement)
        {
            Main.PlaySound(10, -1, -1, 1);
            Player player = new Player();
			player.GiveStartEquipment();
			Main.PendingPlayer = player;
            Main.menuMode = 2;
        }
开发者ID:EmuDevs,项目名称:EDTerraria,代码行数:8,代码来源:UICharacterSelect.cs

示例5: NewCharacterClick

		private void NewCharacterClick(UIMouseEvent evt, UIElement listeningElement)
		{
			Main.PlaySound(10, -1, -1, 1);
			Player player = new Player();
			player.inventory[0].SetDefaults("Copper Shortsword");
			player.inventory[0].Prefix(-1);
			player.inventory[1].SetDefaults("Copper Pickaxe");
			player.inventory[1].Prefix(-1);
			player.inventory[2].SetDefaults("Copper Axe");
			player.inventory[2].Prefix(-1);
			Main.PendingPlayer = player;
			Main.menuMode = 2;
		}
开发者ID:thegamingboffin,项目名称:Ulterraria_Reborn_GitHub,代码行数:13,代码来源:UICharacterSelect.cs

示例6: MouseDown

		public override void MouseDown(UIMouseEvent evt)
		{
			base.MouseDown(evt);
			if (evt.Target == this)
			{
				Rectangle handleRectangle = this.GetHandleRectangle();
				if (handleRectangle.Contains(new Point((int)evt.MousePosition.X, (int)evt.MousePosition.Y)))
				{
					this._isDragging = true;
					this._dragYOffset = evt.MousePosition.Y - (float)handleRectangle.Y;
					return;
				}
				CalculatedStyle innerDimensions = base.GetInnerDimensions();
				float num = UserInterface.ActiveInstance.MousePosition.Y - innerDimensions.Y - (float)(handleRectangle.Height >> 1);
				this._viewPosition = MathHelper.Clamp(num / innerDimensions.Height * this._maxViewSize, 0f, this._maxViewSize - this._viewSize);
			}
		}
开发者ID:thegamingboffin,项目名称:Ulterraria_Reborn_GitHub,代码行数:17,代码来源:UIScrollbar.cs

示例7: MouseOver

		public override void MouseOver(UIMouseEvent evt)
		{
			base.MouseOver(evt);
			this.BackgroundColor = new Color(73, 94, 171);
			this.BorderColor = new Color(89, 116, 213);
		}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:6,代码来源:UIModItem.cs

示例8: BackClick

 private static void BackClick(UIMouseEvent evt, UIElement listeningElement)
 {
     Main.PlaySound(11, -1, -1, 1);
     Main.menuMode = 0;
 }
开发者ID:Evarenis,项目名称:tModLoader,代码行数:5,代码来源:UIModBrowser.cs

示例9: ReloadList

 private static void ReloadList(UIMouseEvent evt, UIElement listeningElement)
 {
     Main.PlaySound(10, -1, -1, 1);
     Interface.modBrowser.loaded = false;
     Main.menuMode = Interface.modBrowserID;
 }
开发者ID:Evarenis,项目名称:tModLoader,代码行数:6,代码来源:UIModBrowser.cs

示例10: ContinueClick

		private void ContinueClick(UIMouseEvent evt, UIElement listeningElement)
		{
			Main.PlaySound(10, -1, -1, 1);
			Main.menuMode = this.gotoMenu;
		}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:5,代码来源:UIErrorMessage.cs

示例11: OpenModsFolder

		private static void OpenModsFolder(UIMouseEvent evt, UIElement listeningElement)
		{
			Main.PlaySound(10, -1, -1, 1);
			Directory.CreateDirectory(ModLoader.ModPath);
			Process.Start(ModLoader.ModPath);
		}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:6,代码来源:UIMods.cs

示例12: Moreinfo

		internal void Moreinfo(UIMouseEvent evt, UIElement listeningElement)
		{
			Main.PlaySound(10, -1, -1, 1);
			Interface.modInfo.SetModName(properties.displayName);
			Interface.modInfo.SetModInfo(properties.description);
			Interface.modInfo.SetGotoMenu(Interface.modsMenuID);
			Interface.modInfo.SetURL(properties.homepage);
			Main.menuMode = Interface.modInfoID;
		}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:9,代码来源:UIModItem.cs

示例13: FadedMouseOver

		private static void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement)
		{
			Main.PlaySound(12, -1, -1, 1);
			((UIPanel)evt.Target).BackgroundColor = new Color(73, 94, 171);
		}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:5,代码来源:UIErrorMessage.cs

示例14: EnableAll

 private void EnableAll(UIMouseEvent evt, UIElement listeningElement)
 {
     Main.PlaySound(12, -1, -1, 1);
     foreach (UIModItem modItem in items)
     {
         if (!modItem.enabled)
         {
             modItem.ToggleEnabled(evt, listeningElement);
         }
     }
 }
开发者ID:guyde2011,项目名称:tModLoader,代码行数:11,代码来源:UIMods.cs

示例15: BuildAndReload

		private void BuildAndReload(UIMouseEvent evt, UIElement listeningElement)
		{
			Main.PlaySound(10, -1, -1, 1);
			ModLoader.modToBuild = this.mod;
			ModLoader.reloadAfterBuild = true;
			ModLoader.buildAll = false;
			Main.menuMode = Interface.buildModID;
		}
开发者ID:DrakoGlyph,项目名称:tModLoader,代码行数:8,代码来源:UIModSourceItem.cs


注:本文中的Terraria.UI.UIMouseEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。