本文整理汇总了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);
}
}
示例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;
}
示例3: UIWindow_OnMouseDown
void UIWindow_OnMouseDown(UIMouseEvent evt, UIElement listeningElement)
{
var element = UIController.GetElementAt(evt.MousePosition);
if (element == this)
{
_dragging = true;
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
示例8: BackClick
private static void BackClick(UIMouseEvent evt, UIElement listeningElement)
{
Main.PlaySound(11, -1, -1, 1);
Main.menuMode = 0;
}
示例9: ReloadList
private static void ReloadList(UIMouseEvent evt, UIElement listeningElement)
{
Main.PlaySound(10, -1, -1, 1);
Interface.modBrowser.loaded = false;
Main.menuMode = Interface.modBrowserID;
}
示例10: ContinueClick
private void ContinueClick(UIMouseEvent evt, UIElement listeningElement)
{
Main.PlaySound(10, -1, -1, 1);
Main.menuMode = this.gotoMenu;
}
示例11: OpenModsFolder
private static void OpenModsFolder(UIMouseEvent evt, UIElement listeningElement)
{
Main.PlaySound(10, -1, -1, 1);
Directory.CreateDirectory(ModLoader.ModPath);
Process.Start(ModLoader.ModPath);
}
示例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;
}
示例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);
}
示例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);
}
}
}
示例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;
}