• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# UI.UIMouseEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Unpublish

 internal void Unpublish(UIMouseEvent evt, UIElement listeningElement)
 {
     if (ModLoader.modBrowserPassphrase == "")
     {
         Main.menuMode = Interface.enterPassphraseMenuID;
         Interface.enterPassphraseMenu.SetGotoMenu(Interface.managePublishedID);
         return;
     }
     Main.PlaySound(12, -1, -1, 1);
     try
     {
         System.Net.ServicePointManager.Expect100Continue = false;
         string url = "http://javid.ddns.net/tModLoader/unpublishmymod.php";
         IO.UploadFile[] files = new IO.UploadFile[0];
         var values = new NameValueCollection
         {
             { "name", this.name },
             { "steamid64", Steamworks.SteamUser.GetSteamID().ToString() },
             { "modloaderversion", ModLoader.versionedName },
             { "passphrase", ModLoader.modBrowserPassphrase },
         };
         byte[] result = IO.UploadFile.UploadFiles(url, files, values);
         string s = System.Text.Encoding.UTF8.GetString(result, 0, result.Length);
         ErrorLogger.LogModUnPublish(s);
     }
     catch (Exception e)
     {
         ErrorLogger.LogModBrowserException(e);
     }
 }
开发者ID:bluemagic123,项目名称:tModLoader,代码行数:30,代码来源:UIModManageItem.cs


示例17: ReloadMods

 private static void ReloadMods(UIMouseEvent evt, UIElement listeningElement)
 {
     Main.PlaySound(10, -1, -1, 1);
     ModLoader.Reload();
 }
开发者ID:guyde2011,项目名称:tModLoader,代码行数:5,代码来源:UIMods.cs


示例18: SortList

		private void SortList(UIMouseEvent evt, UIElement listeningElement)
		{
			SortList();
		}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:4,代码来源:UIModBrowser.cs


示例19: FilterList

		private void FilterList(UIMouseEvent evt, UIElement listeningElement)
		{
			FilterList();
		}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:4,代码来源:UIMods.cs


示例20: GotoModPacksMenu

		private static void GotoModPacksMenu(UIMouseEvent evt, UIElement listeningElement)
		{
			Main.PlaySound(12, -1, -1, 1);
			Main.menuMode = Interface.modPacksMenuID;
		}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:5,代码来源:UIMods.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Terraria_Server.NPC类代码示例发布时间:2022-05-26
下一篇:
C# UI.UIElement类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap