diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8336bde --- /dev/null +++ b/.gitignore @@ -0,0 +1,341 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ +# ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true +**/wwwroot/lib/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb diff --git a/README.md b/README.md new file mode 100644 index 0000000..b1c6532 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +ZhongliShieldIndicator +- + +原神小工具 钟离护盾指示器 \ No newline at end of file diff --git a/ZhongliShieldIndicator.sln b/ZhongliShieldIndicator.sln new file mode 100644 index 0000000..37c5799 --- /dev/null +++ b/ZhongliShieldIndicator.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31912.275 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZhongliShieldIndicator", "ZhongliShieldIndicator\ZhongliShieldIndicator.csproj", "{D04A0A02-2B19-4810-A9BC-6790EC15E5AE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D04A0A02-2B19-4810-A9BC-6790EC15E5AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D04A0A02-2B19-4810-A9BC-6790EC15E5AE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D04A0A02-2B19-4810-A9BC-6790EC15E5AE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D04A0A02-2B19-4810-A9BC-6790EC15E5AE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1AFBFC73-1A10-4BFF-8E70-721E1BC0217D} + EndGlobalSection +EndGlobal diff --git a/ZhongliShieldIndicator/App.config b/ZhongliShieldIndicator/App.config new file mode 100644 index 0000000..46322a3 --- /dev/null +++ b/ZhongliShieldIndicator/App.config @@ -0,0 +1,27 @@ + + + + +
+ + + + + + + + + 0 + + + 0 + + + 1 + + + True + + + + \ No newline at end of file diff --git a/ZhongliShieldIndicator/Bass.Net.dll b/ZhongliShieldIndicator/Bass.Net.dll new file mode 100644 index 0000000..713b50d Binary files /dev/null and b/ZhongliShieldIndicator/Bass.Net.dll differ diff --git a/ZhongliShieldIndicator/FodyWeavers.xml b/ZhongliShieldIndicator/FodyWeavers.xml new file mode 100644 index 0000000..f1dea8f --- /dev/null +++ b/ZhongliShieldIndicator/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/ZhongliShieldIndicator/FodyWeavers.xsd b/ZhongliShieldIndicator/FodyWeavers.xsd new file mode 100644 index 0000000..8ac6e92 --- /dev/null +++ b/ZhongliShieldIndicator/FodyWeavers.xsd @@ -0,0 +1,111 @@ + + + + + + + + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with line breaks. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with line breaks. + + + + + The order of preloaded assemblies, delimited with line breaks. + + + + + + This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. + + + + + Controls if .pdbs for reference assemblies are also embedded. + + + + + Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. + + + + + As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. + + + + + Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. + + + + + Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with |. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with |. + + + + + The order of preloaded assemblies, delimited with |. + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/ZhongliShieldIndicator/Form1.Designer.cs b/ZhongliShieldIndicator/Form1.Designer.cs new file mode 100644 index 0000000..8f1055f --- /dev/null +++ b/ZhongliShieldIndicator/Form1.Designer.cs @@ -0,0 +1,184 @@ +namespace ZhongliShieldIndicator +{ + partial class Form1 + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.rgnProgress = new System.Windows.Forms.Label(); + this.renderTimer = new System.Windows.Forms.Timer(this.components); + this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.钟离位置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.位置1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.位置2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.位置3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.位置4ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.重置小部件位置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.chkPlaySound = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // rgnProgress + // + this.rgnProgress.Location = new System.Drawing.Point(57, 18); + this.rgnProgress.Name = "rgnProgress"; + this.rgnProgress.Size = new System.Drawing.Size(208, 10); + this.rgnProgress.TabIndex = 0; + this.rgnProgress.Visible = false; + // + // renderTimer + // + this.renderTimer.Interval = 1; + this.renderTimer.Tick += new System.EventHandler(this.renderTimer_Tick); + // + // notifyIcon1 + // + this.notifyIcon1.ContextMenuStrip = this.contextMenuStrip1; + this.notifyIcon1.Text = "钟离护盾指示器"; + this.notifyIcon1.Visible = true; + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.钟离位置ToolStripMenuItem, + this.chkPlaySound, + this.重置小部件位置ToolStripMenuItem, + this.toolStripSeparator1, + this.退出ToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(181, 120); + // + // 钟离位置ToolStripMenuItem + // + this.钟离位置ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.位置1ToolStripMenuItem, + this.位置2ToolStripMenuItem, + this.位置3ToolStripMenuItem, + this.位置4ToolStripMenuItem}); + this.钟离位置ToolStripMenuItem.Name = "钟离位置ToolStripMenuItem"; + this.钟离位置ToolStripMenuItem.Size = new System.Drawing.Size(172, 22); + this.钟离位置ToolStripMenuItem.Text = "钟离所在队伍位置"; + // + // 位置1ToolStripMenuItem + // + this.位置1ToolStripMenuItem.Name = "位置1ToolStripMenuItem"; + this.位置1ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.位置1ToolStripMenuItem.Text = "位置1"; + this.位置1ToolStripMenuItem.Click += new System.EventHandler(this.位置1ToolStripMenuItem_Click); + // + // 位置2ToolStripMenuItem + // + this.位置2ToolStripMenuItem.Name = "位置2ToolStripMenuItem"; + this.位置2ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.位置2ToolStripMenuItem.Text = "位置2"; + this.位置2ToolStripMenuItem.Click += new System.EventHandler(this.位置1ToolStripMenuItem_Click); + // + // 位置3ToolStripMenuItem + // + this.位置3ToolStripMenuItem.Name = "位置3ToolStripMenuItem"; + this.位置3ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.位置3ToolStripMenuItem.Text = "位置3"; + this.位置3ToolStripMenuItem.Click += new System.EventHandler(this.位置1ToolStripMenuItem_Click); + // + // 位置4ToolStripMenuItem + // + this.位置4ToolStripMenuItem.Name = "位置4ToolStripMenuItem"; + this.位置4ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.位置4ToolStripMenuItem.Text = "位置4"; + this.位置4ToolStripMenuItem.Click += new System.EventHandler(this.位置1ToolStripMenuItem_Click); + // + // 重置小部件位置ToolStripMenuItem + // + this.重置小部件位置ToolStripMenuItem.Name = "重置小部件位置ToolStripMenuItem"; + this.重置小部件位置ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.重置小部件位置ToolStripMenuItem.Text = "重置小部件位置"; + this.重置小部件位置ToolStripMenuItem.Click += new System.EventHandler(this.重置小部件位置ToolStripMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); + // + // 退出ToolStripMenuItem + // + this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem"; + this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.退出ToolStripMenuItem.Text = "退出"; + this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click); + // + // chkPlaySound + // + this.chkPlaySound.CheckOnClick = true; + this.chkPlaySound.Name = "chkPlaySound"; + this.chkPlaySound.Size = new System.Drawing.Size(180, 22); + this.chkPlaySound.Text = "播放音效"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.BackColor = System.Drawing.Color.Blue; + this.BackgroundImage = global::ZhongliShieldIndicator.Properties.Resources.bar_bg_glow; + this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.ClientSize = new System.Drawing.Size(278, 46); + this.ContextMenuStrip = this.contextMenuStrip1; + this.Controls.Add(this.rgnProgress); + this.DoubleBuffered = true; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "Form1"; + this.Text = "ZhongliShieldIndicator"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); + this.Load += new System.EventHandler(this.Form1_Load); + this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown); + this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove); + this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseUp); + this.contextMenuStrip1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label rgnProgress; + private System.Windows.Forms.Timer renderTimer; + private System.Windows.Forms.NotifyIcon notifyIcon1; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem 钟离位置ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem 位置1ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem 位置2ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem 位置3ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem 位置4ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem 重置小部件位置ToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem chkPlaySound; + } +} + diff --git a/ZhongliShieldIndicator/Form1.cs b/ZhongliShieldIndicator/Form1.cs new file mode 100644 index 0000000..b1c2716 --- /dev/null +++ b/ZhongliShieldIndicator/Form1.cs @@ -0,0 +1,301 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ZhongliShieldIndicator +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + [DllImport("user32.dll")] + public static extern bool GetAsyncKeyState(Keys vKey); + + private Properties.Settings Set + { + get + { + return Properties.Settings.Default; + } + } + + private void Form1_Load(object sender, EventArgs e) + { + this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); + TopMost = true; + ShowInTaskbar = false; + gdi = new MyGDIFramework.GdiSystem(this); + gdi.Graphics.Clear(Color.Transparent); + gdi.UpdateWindow(); + imgBarFilled = new Bitmap(Properties.Resources.bar_bg_glow, this.Size); + imgBarNormal = new Bitmap(Properties.Resources.bar_bg, this.Size); + imgFgShield = new Bitmap(Properties.Resources.bar_shield, rgnProgress.Size); + imgFgSkill = new Bitmap(Properties.Resources.bar_skill, rgnProgress.Size); + notifyIcon1.Icon = this.Icon; + gdi.Graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; + gdi.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; + renderTimer.Start(); + this.Top = Set.windowX; + this.Left = Set.windowY; + chkPlaySound.Checked = Set.playSound; + whoisZhongli = Set.zhongliPos; + } + MyGDIFramework.GdiSystem gdi = null; + Bitmap imgBarNormal = null; + Bitmap imgBarFilled = null; + + + Brush shieldBrush = new SolidBrush(Color.FromArgb(169,214,127,0)); + Brush skillBrush = new SolidBrush(Color.FromArgb(169, 214,204,0)); + + Bitmap imgFgSkill, imgFgShield; + + // state + int currentCharactor = -1; + long shieldEndTime = 0; + long skillEndTime = 0; + long pressBeginTime = 0; + bool isEPressed = false; + long skillTime = 4000; + + // config + int whoisZhongli = 1; + long skillShortCdTime = 4000; + long skillLongCdTime = 12000; + long shieldTime = 20000; + + long longSkillTriggerTime = 800; + long skillShortPrefixTime = 400; + + private int _topMostCd = 200; + private void renderTimer_Tick(object sender, EventArgs e) + { + UpdateStatus(); + GetAsyncKeyState(Keys.D1); + GetAsyncKeyState(Keys.D2); + GetAsyncKeyState(Keys.D3); + GetAsyncKeyState(Keys.D4); + GetAsyncKeyState(Keys.E); + PlaySounds(); + Graphics g = gdi.Graphics; + g.Clear(Color.Transparent); + RenderUI(g); + gdi.UpdateWindow(); + _topMostCd--; + if(_topMostCd < 0) + { + _topMostCd = 200; + TopMost = true; + } + } + void UpdateStatus() + { + if (GetAsyncKeyState(Keys.D1)) + { + currentCharactor = 1; + } + if (GetAsyncKeyState(Keys.D2)) + { + currentCharactor = 2; + } + if (GetAsyncKeyState(Keys.D3)) + { + currentCharactor = 3; + } + if (GetAsyncKeyState(Keys.D4)) + { + currentCharactor = 4; + } + if(currentCharactor != whoisZhongli) + { + return; + } + bool canPressE = skillEndTime < SysClock; + if (!canPressE) + { + return; + } + bool keyEState = GetAsyncKeyState(Keys.E); + if (keyEState && !isEPressed) + { + pressBeginTime = SysClock; + isEPressed = true; + } + if(isEPressed && SysClock - pressBeginTime > longSkillTriggerTime) + { + skillEndTime = SysClock + skillLongCdTime; + shieldEndTime = SysClock + shieldTime; + skillTime = skillLongCdTime; + isEPressed=false; + return; + } + if (isEPressed && !keyEState) + { + isEPressed = false; + skillTime = skillShortCdTime; + skillEndTime = pressBeginTime+ skillShortPrefixTime + skillShortCdTime; + } + + } + void RenderUI(Graphics g) + { + + bool canPressE = skillEndTime < SysClock; + if (canPressE) + { + g.DrawImage(imgBarFilled, 0, 0); + } + else + { + g.DrawImage(imgBarNormal, 0, 0); + } + long skillDuration = skillEndTime - SysClock; + long shieldDuration = shieldEndTime - SysClock; + Rectangle srcRect = Rectangle.Empty; + Rectangle dstRect = Rectangle.Empty; + if (shieldDuration > 0) + { + int w = (int)(rgnProgress.Width * (shieldDuration) / (shieldTime)); + if (w > rgnProgress.Width) + { + w = rgnProgress.Width; + } + srcRect.Width = w; + srcRect.Height = rgnProgress.Height; + dstRect.X = rgnProgress.Left; + dstRect.Y = rgnProgress.Top; + dstRect.Width = w; + dstRect.Height = rgnProgress.Height; + g.DrawImage(imgFgShield, dstRect, srcRect, GraphicsUnit.Pixel); + } + if (skillDuration > 0) + { + int w = (int)(rgnProgress.Width * (skillDuration) / (skillTime)); + if(w > rgnProgress.Width) + { + w = rgnProgress.Width; + } + srcRect.Width = w; + srcRect.Height = rgnProgress.Height; + dstRect.X = rgnProgress.Left; + dstRect.Y = rgnProgress.Top; + dstRect.Width = w; + dstRect.Height = rgnProgress.Height; + g.DrawImage(imgFgSkill, dstRect, srcRect, GraphicsUnit.Pixel); + } + } + + int lastSec = 0; + bool lastShieldStatus = true; + bool lastSkillStatus = true; + void PlaySounds() + { + bool nowSkillStatus = skillEndTime < SysClock; + bool nowShieldStatus = shieldEndTime < SysClock; + if(nowSkillStatus && !lastSkillStatus) + { + PlaySfx(Program.channelSfxAvailable); + } + lastSkillStatus = nowSkillStatus; + + if(!lastShieldStatus && nowShieldStatus) + { + PlaySfx(Program.channelSfxBroken); + } + lastShieldStatus = nowShieldStatus; + + int nowSec = (int)((shieldEndTime - SysClock) / 1000); + if(nowSec <=4 && nowSec >=0 && lastSec - 1 == nowSec) + { + PlaySfx(Program.channelSfxWarning); + } + lastSec = nowSec; + } + + private void PlaySfx(int handle) + { + if (!chkPlaySound.Checked) { return; } + if(!Un4seen.Bass.Bass.BASS_ChannelPlay(handle, true)) + { + Console.WriteLine(Un4seen.Bass.Bass.BASS_ErrorGetCode()); + } + } + + Point moveOrigin = Point.Empty; + bool isMoving = false; + private void Form1_MouseDown(object sender, MouseEventArgs e) + { + if(e.Button == MouseButtons.Left) + { + moveOrigin = e.Location; + isMoving = true; + } + } + + private void Form1_MouseMove(object sender, MouseEventArgs e) + { + if (isMoving) + { + this.Top += e.Y - moveOrigin.Y; + this.Left += e.X - moveOrigin.X; + } + } + + DateTime _dateOrigin = DateTime.Now; + long SysClock + { + get + { + return (long)(DateTime.Now - _dateOrigin).TotalMilliseconds; + } + } + + private void 位置1ToolStripMenuItem_Click(object sender, EventArgs e) + { + int i = ((ToolStripMenuItem)sender).Text.Last() - '0'; + whoisZhongli = i; + 位置1ToolStripMenuItem.Checked = false; + 位置2ToolStripMenuItem.Checked = false; + 位置3ToolStripMenuItem.Checked = false; + 位置4ToolStripMenuItem.Checked = false; + ((ToolStripMenuItem)sender).Checked = true; + } + + private void Form1_FormClosing(object sender, FormClosingEventArgs e) + { + Set.windowX = this.Top; + Set.windowY = this.Left; + Set.playSound = chkPlaySound.Checked; + Set.zhongliPos = whoisZhongli; + Set.Save(); + } + + private void 重置小部件位置ToolStripMenuItem_Click(object sender, EventArgs e) + { + this.Top = Screen.GetWorkingArea(this).Height * 8 / 10; + this.Left = Screen.GetWorkingArea(this).Width / 2 - this.Width / 2; + } + + private void 退出ToolStripMenuItem_Click(object sender, EventArgs e) + { + Close(); + } + + private void Form1_MouseUp(object sender, MouseEventArgs e) + { + if(e.Button == MouseButtons.Left) + { + isMoving = false; + } + } + } +} diff --git a/ZhongliShieldIndicator/Form1.resx b/ZhongliShieldIndicator/Form1.resx new file mode 100644 index 0000000..fadfe70 --- /dev/null +++ b/ZhongliShieldIndicator/Form1.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 141, 17 + + + 259, 17 + + \ No newline at end of file diff --git a/ZhongliShieldIndicator/GdiSystem.cs b/ZhongliShieldIndicator/GdiSystem.cs new file mode 100644 index 0000000..aa9d19d --- /dev/null +++ b/ZhongliShieldIndicator/GdiSystem.cs @@ -0,0 +1,387 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace MyGDIFramework +{ + + public class GdiSystem : IDisposable + { + Form thisWindow; + + /// + /// 在FormLoad中调用这个方法 + /// + /// + public GdiSystem(Form attachForm) + { + thisWindow = attachForm; + + if (attachForm.Handle != IntPtr.Zero) + { + int oldWindowLong = Win32.GetWindowLong(attachForm.Handle, Win32.GWL_EXSTYLE); + Win32.SetWindowLong(attachForm.Handle, Win32.GWL_EXSTYLE, oldWindowLong | Win32.WS_EX_LAYERED); + } + else + { + throw new AccessViolationException("窗口没有初始化"); + } + oldBits = IntPtr.Zero; + screenDC = Win32.GetDC(IntPtr.Zero); + hBitmap = IntPtr.Zero; + memDc = Win32.CreateCompatibleDC(screenDC); + blendFunc.BlendOp = Win32.AC_SRC_OVER; + blendFunc.SourceConstantAlpha = 255; + blendFunc.AlphaFormat = Win32.AC_SRC_ALPHA; + blendFunc.BlendFlags = 0; + + initBitmaps(); + + } + + private void initBitmaps() + { + thisBitmap = new Bitmap(thisWindow.Width, thisWindow.Height); + thisGraphics = Graphics.FromImage(thisBitmap); + bitMapSize = new Win32.Size(thisBitmap.Width, thisBitmap.Height); + } + /// + /// 获取一个可以绘制的画布对象,在上面绘制窗体内容 + /// + /// + /// + public Graphics Graphics + { + get + { + return thisGraphics; + } + } + /// + /// 画完之后提交绘制内容 + /// + public void UpdateWindow() + { + SetBits(thisBitmap); + } + IntPtr oldBits; + IntPtr screenDC; + IntPtr hBitmap; + IntPtr memDc; + Win32.BLENDFUNCTION blendFunc = new Win32.BLENDFUNCTION(); + + Win32.Point topLoc = new Win32.Point(0, 0); + Win32.Size bitMapSize; + Win32.Point srcLoc = new Win32.Point(0, 0); + private void SetBits(Bitmap bitmap) + { + + if (!Bitmap.IsCanonicalPixelFormat(bitmap.PixelFormat) || !Bitmap.IsAlphaPixelFormat(bitmap.PixelFormat)) + throw new ApplicationException("The picture must be 32bit picture with alpha channel."); + try + { + topLoc.x = thisWindow.Left; + topLoc.y = thisWindow.Top; + hBitmap = thisBitmap.GetHbitmap(Color.FromArgb(0)); + oldBits = Win32.SelectObject(memDc, hBitmap); + Win32.UpdateLayeredWindow(thisWindow.Handle, screenDC, ref topLoc, ref bitMapSize, memDc, ref srcLoc, 0, ref blendFunc, Win32.ULW_ALPHA); + } + finally + { + if (hBitmap != IntPtr.Zero) + { + Win32.SelectObject(memDc, oldBits); + Win32.DeleteObject(hBitmap); + } + } + } + + public void Dispose() + { + Win32.ReleaseDC(IntPtr.Zero, screenDC); + Win32.DeleteDC(memDc); + } + + private Bitmap thisBitmap; + private Graphics thisGraphics; + + + public class Win32 + { + [StructLayout(LayoutKind.Sequential)] + public struct Size + { + public Int32 cx; + public Int32 cy; + + public Size(Int32 x, Int32 y) + { + cx = x; + cy = y; + } + } + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct BLENDFUNCTION + { + public byte BlendOp; + public byte BlendFlags; + public byte SourceConstantAlpha; + public byte AlphaFormat; + } + + [StructLayout(LayoutKind.Sequential)] + public struct Point + { + public Int32 x; + public Int32 y; + + public Point(Int32 x, Int32 y) + { + this.x = x; + this.y = y; + } + } + + public const byte AC_SRC_OVER = 0; + public const Int32 ULW_ALPHA = 2; + public const byte AC_SRC_ALPHA = 1; + public const int GWL_EXSTYLE = -20; + public const int WS_EX_LAYERED = 0x80000; + + [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)] + public static extern IntPtr CreateCompatibleDC(IntPtr hDC); + + [DllImport("user32.dll", ExactSpelling = true, SetLastError = true)] + public static extern IntPtr GetDC(IntPtr hWnd); + + [DllImport("gdi32.dll", ExactSpelling = true)] + public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObj); + + [DllImport("user32.dll", ExactSpelling = true)] + public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC); + + [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)] + public static extern int DeleteDC(IntPtr hDC); + + [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)] + public static extern int DeleteObject(IntPtr hObj); + + [DllImport("user32.dll", ExactSpelling = true, SetLastError = true)] + public static extern int UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDst, ref Point pptDst, ref Size psize, IntPtr hdcSrc, ref Point pptSrc, Int32 crKey, ref BLENDFUNCTION pblend, Int32 dwFlags); + + [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)] + public static extern IntPtr ExtCreateRegion(IntPtr lpXform, uint nCount, IntPtr rgnData); + + [DllImport("user32.dll", EntryPoint = "GetWindowLongA")] + public static extern int GetWindowLong(IntPtr hwnd, int nIndex); + + [DllImport("user32.dll", EntryPoint = "SetWindowLongA")] + public static extern int SetWindowLong(IntPtr hwnd, int nIndex, int dwNewLong); + + } + } + + public class DrawUtils + { + #region drawAlphaImage + public static void drawAlphaImage(Graphics g, Image image, float x, float y, float w, float h, float alpha) + { + if (alpha >= 0.99) + { + g.DrawImage(image, x, y, w, h); + return; + } + g.DrawImage(image, new Rectangle((int)x, (int)y, (int)w, (int)h), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, alphaImage(alpha)); + } + private static ImageAttributes alphaAttrs = new ImageAttributes(); + private static ColorMatrix cmx = new ColorMatrix(new float[][]{ + new float[5]{ 1,0,0,0,0 }, + new float[5]{ 0,1,0,0,0 }, + new float[5]{ 0,0,1,0,0 }, + new float[5]{ 0,0,0,0.5f,0 }, + new float[5]{ 0,0,0,0,0 } + }); + private static ImageAttributes alphaImage(float alpha) + { + cmx.Matrix33 = alpha; + alphaAttrs.SetColorMatrix(cmx, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); + return alphaAttrs; + } + #endregion + + #region drawRotateImg + public static void drawRotateImg(Graphics g, Bitmap img, float angle, float centerX, float centerY) + { + drawRotateImg(g, (Image)img, angle, centerX, centerY); + } + public static void drawRotateImg(Graphics g, Bitmap img, float angle, float centerX, float centerY, float imgW, float imgH) + { + drawRotateImg(g, (Image)img, angle, centerX, centerY, imgW, imgH); + } + public static void drawRotateImg(Graphics g, Image img, float angle, float centerX, float centerY) + { + drawRotateImg(g, img, angle, centerX, centerY, img.Width, img.Height); + } + + public static void drawRotateImg(Graphics g, Image img, float angle, float centerX, float centerY, float imgW, float imgH) + { + float width = imgW; + float height = imgH; + Matrix mtrx = new Matrix(); + mtrx.RotateAt(angle, new PointF((width / 2), (height / 2)), MatrixOrder.Append); + //得到旋转后的矩形 + GraphicsPath path = new GraphicsPath(); + path.AddRectangle(new RectangleF(0f, 0f, width, height)); + RectangleF rct = path.GetBounds(mtrx); + Point Offset = new Point((int)(rct.Width - width) / 2, (int)(rct.Height - height) / 2); + //构造图像显示区域:让图像的中心与窗口的中心点一致 + RectangleF rect = new RectangleF(-width / 2 + centerX, -height / 2 + centerY, (int)width, (int)height); + PointF center = new PointF((int)(rect.X + rect.Width / 2), (int)(rect.Y + rect.Height / 2)); + g.TranslateTransform(center.X, center.Y); + g.RotateTransform(angle); + //恢复图像在水平和垂直方向的平移 + g.TranslateTransform(-center.X, -center.Y); + g.DrawImage(img, rect); + //重至绘图的所有变换 + g.ResetTransform(); + } + + #endregion + } + + /* 快速图像处理,需要勾选 Properties - 生成 - 允许不安全代码 才能使用,使用时去掉这行即可 + public class FastBitmap + { + Bitmap source = null; + IntPtr Iptr = IntPtr.Zero; + BitmapData bitmapData = null; + + public int Depth { get; private set; } + public int Width { get; private set; } + public int Height { get; private set; } + + public FastBitmap(Bitmap source) + { + this.source = source; + } + + public void LockBits() + { + try + { + // Get width and height of bitmap + Width = source.Width; + Height = source.Height; + + // get total locked pixels count + int PixelCount = Width * Height; + + // Create rectangle to lock + Rectangle rect = new Rectangle(0, 0, Width, Height); + + // get source bitmap pixel format size + Depth = System.Drawing.Bitmap.GetPixelFormatSize(source.PixelFormat); + + // Check if bpp (Bits Per Pixel) is 8, 24, or 32 + if (Depth != 8 && Depth != 24 && Depth != 32) + { + throw new ArgumentException("Only 8, 24 and 32 bpp images are supported."); + } + + // Lock bitmap and return bitmap data + bitmapData = source.LockBits(rect, ImageLockMode.ReadWrite, + source.PixelFormat); + + //得到首地址 + unsafe + { + Iptr = bitmapData.Scan0; + //二维图像循环 + + } + } + catch (Exception ex) + { + throw ex; + } + } + + public void UnlockBits() + { + try + { + source.UnlockBits(bitmapData); + } + catch (Exception ex) + { + throw ex; + } + } + + public Color GetPixel(int x, int y) + { + unsafe + { + byte* ptr = (byte*)Iptr; + ptr = ptr + bitmapData.Stride * y; + ptr += Depth * x / 8; + Color c = Color.Empty; + if (Depth == 32) + { + int a = ptr[3]; + int r = ptr[2]; + int g = ptr[1]; + int b = ptr[0]; + c = Color.FromArgb(a, r, g, b); + } + else if (Depth == 24) + { + int r = ptr[2]; + int g = ptr[1]; + int b = ptr[0]; + c = Color.FromArgb(r, g, b); + } + else if (Depth == 8) + { + int r = ptr[0]; + c = Color.FromArgb(r, r, r); + } + return c; + } + } + + public void SetPixel(int x, int y, Color c) + { + unsafe + { + byte* ptr = (byte*)Iptr; + ptr = ptr + bitmapData.Stride * y; + ptr += Depth * x / 8; + if (Depth == 32) + { + ptr[3] = c.A; + ptr[2] = c.R; + ptr[1] = c.G; + ptr[0] = c.B; + } + else if (Depth == 24) + { + ptr[2] = c.R; + ptr[1] = c.G; + ptr[0] = c.B; + } + else if (Depth == 8) + { + ptr[2] = c.R; + ptr[1] = c.G; + ptr[0] = c.B; + } + } + } + } + /**/ +} diff --git a/ZhongliShieldIndicator/Program.cs b/ZhongliShieldIndicator/Program.cs new file mode 100644 index 0000000..1be0901 --- /dev/null +++ b/ZhongliShieldIndicator/Program.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ZhongliShieldIndicator +{ + internal static class Program + { + public const string appid = "com.zyfdroid.zsi_v100000001"; + public static void makeFileExists(byte[] data, String filename) + { + if (!Directory.Exists(Path.GetDirectoryName(filename))) + { + Directory.CreateDirectory(Path.GetDirectoryName(filename)); + } + if (!File.Exists(filename)) + { + File.WriteAllBytes(filename + ".tmp", data); + File.Move(filename + ".tmp", filename); + } + } + + public static int extractAndMakeChannel(byte[] data,String filename) + { + makeFileExists(data,filename); + int chan = Un4seen.Bass.Bass.BASS_StreamCreateFile(filename, 0, new FileInfo(filename).Length, Un4seen.Bass.BASSFlag.BASS_DEFAULT); + Console.WriteLine(Un4seen.Bass.Bass.BASS_ErrorGetCode()); + return chan; + } + + /// + /// 应用程序的主入口点。 + /// + + public static int channelSfxWarning = 0; + public static int channelSfxBroken = 0; + public static int channelSfxAvailable = 0; + + [STAThread] + static void Main() + { + String rootpath = Path.Combine(Path.GetTempPath(), appid, "libs"); + String soundpath = Path.Combine(rootpath, "sfx"); + makeFileExists(Properties.Resources.bass, Path.Combine(rootpath, "bass.dll")); + if (Un4seen.Bass.Bass.LoadMe(Path.Combine(rootpath))) + { + Un4seen.Bass.Bass.BASS_Init(-1, 44100, Un4seen.Bass.BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero); + channelSfxAvailable = extractAndMakeChannel(Properties.Resources.available, Path.Combine(soundpath, "available.ogg")); + channelSfxBroken = extractAndMakeChannel(Properties.Resources._break, Path.Combine(soundpath, "broken.ogg")); + channelSfxWarning = extractAndMakeChannel(Properties.Resources.warn, Path.Combine(soundpath, "warn.ogg")); + } + else + { + Console.WriteLine(Un4seen.Bass.Bass.BASS_ErrorGetCode()); + } + + + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/ZhongliShieldIndicator/Properties/AssemblyInfo.cs b/ZhongliShieldIndicator/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..fe826d3 --- /dev/null +++ b/ZhongliShieldIndicator/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("ZhongliShieldIndicator")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("HP")] +[assembly: AssemblyProduct("ZhongliShieldIndicator")] +[assembly: AssemblyCopyright("Copyright © HP 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("d04a0a02-2b19-4810-a9bc-6790ec15e5ae")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ZhongliShieldIndicator/Properties/Resources.Designer.cs b/ZhongliShieldIndicator/Properties/Resources.Designer.cs new file mode 100644 index 0000000..21b30a3 --- /dev/null +++ b/ZhongliShieldIndicator/Properties/Resources.Designer.cs @@ -0,0 +1,143 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace ZhongliShieldIndicator.Properties { + using System; + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// 返回此类使用的缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ZhongliShieldIndicator.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 重写当前线程的 CurrentUICulture 属性,对 + /// 使用此强类型资源类的所有资源查找执行重写。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// 查找 System.Byte[] 类型的本地化资源。 + /// + internal static byte[] _break { + get { + object obj = ResourceManager.GetObject("_break", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// 查找 System.Byte[] 类型的本地化资源。 + /// + internal static byte[] available { + get { + object obj = ResourceManager.GetObject("available", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap bar_bg { + get { + object obj = ResourceManager.GetObject("bar_bg", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap bar_bg_glow { + get { + object obj = ResourceManager.GetObject("bar_bg_glow", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap bar_shield { + get { + object obj = ResourceManager.GetObject("bar_shield", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Drawing.Bitmap 类型的本地化资源。 + /// + internal static System.Drawing.Bitmap bar_skill { + get { + object obj = ResourceManager.GetObject("bar_skill", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// 查找 System.Byte[] 类型的本地化资源。 + /// + internal static byte[] bass { + get { + object obj = ResourceManager.GetObject("bass", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// 查找 System.Byte[] 类型的本地化资源。 + /// + internal static byte[] warn { + get { + object obj = ResourceManager.GetObject("warn", resourceCulture); + return ((byte[])(obj)); + } + } + } +} diff --git a/ZhongliShieldIndicator/Properties/Resources.resx b/ZhongliShieldIndicator/Properties/Resources.resx new file mode 100644 index 0000000..d10927d --- /dev/null +++ b/ZhongliShieldIndicator/Properties/Resources.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\available.ogg;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\bar_bg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\bar_bg_glow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\bar_shield.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\bar_skill.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\bass.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\warn.ogg;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\break.ogg;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ZhongliShieldIndicator/Properties/Settings.Designer.cs b/ZhongliShieldIndicator/Properties/Settings.Designer.cs new file mode 100644 index 0000000..b98e8a2 --- /dev/null +++ b/ZhongliShieldIndicator/Properties/Settings.Designer.cs @@ -0,0 +1,74 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace ZhongliShieldIndicator.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int windowX { + get { + return ((int)(this["windowX"])); + } + set { + this["windowX"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int windowY { + get { + return ((int)(this["windowY"])); + } + set { + this["windowY"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1")] + public int zhongliPos { + get { + return ((int)(this["zhongliPos"])); + } + set { + this["zhongliPos"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool playSound { + get { + return ((bool)(this["playSound"])); + } + set { + this["playSound"] = value; + } + } + } +} diff --git a/ZhongliShieldIndicator/Properties/Settings.settings b/ZhongliShieldIndicator/Properties/Settings.settings new file mode 100644 index 0000000..ea05f8e --- /dev/null +++ b/ZhongliShieldIndicator/Properties/Settings.settings @@ -0,0 +1,18 @@ + + + + + + 0 + + + 0 + + + 1 + + + True + + + \ No newline at end of file diff --git a/ZhongliShieldIndicator/Resources/available.ogg b/ZhongliShieldIndicator/Resources/available.ogg new file mode 100644 index 0000000..4c68237 Binary files /dev/null and b/ZhongliShieldIndicator/Resources/available.ogg differ diff --git a/ZhongliShieldIndicator/Resources/bar_bg.png b/ZhongliShieldIndicator/Resources/bar_bg.png new file mode 100644 index 0000000..3e6ebfe Binary files /dev/null and b/ZhongliShieldIndicator/Resources/bar_bg.png differ diff --git a/ZhongliShieldIndicator/Resources/bar_bg_glow.png b/ZhongliShieldIndicator/Resources/bar_bg_glow.png new file mode 100644 index 0000000..5b89b2e Binary files /dev/null and b/ZhongliShieldIndicator/Resources/bar_bg_glow.png differ diff --git a/ZhongliShieldIndicator/Resources/bar_shield.png b/ZhongliShieldIndicator/Resources/bar_shield.png new file mode 100644 index 0000000..af3c401 Binary files /dev/null and b/ZhongliShieldIndicator/Resources/bar_shield.png differ diff --git a/ZhongliShieldIndicator/Resources/bar_skill.png b/ZhongliShieldIndicator/Resources/bar_skill.png new file mode 100644 index 0000000..8dd3628 Binary files /dev/null and b/ZhongliShieldIndicator/Resources/bar_skill.png differ diff --git a/ZhongliShieldIndicator/Resources/break.ogg b/ZhongliShieldIndicator/Resources/break.ogg new file mode 100644 index 0000000..21fca71 Binary files /dev/null and b/ZhongliShieldIndicator/Resources/break.ogg differ diff --git a/ZhongliShieldIndicator/Resources/warn.ogg b/ZhongliShieldIndicator/Resources/warn.ogg new file mode 100644 index 0000000..dc693cd Binary files /dev/null and b/ZhongliShieldIndicator/Resources/warn.ogg differ diff --git a/ZhongliShieldIndicator/ZhongliShieldIndicator.csproj b/ZhongliShieldIndicator/ZhongliShieldIndicator.csproj new file mode 100644 index 0000000..a9df63e --- /dev/null +++ b/ZhongliShieldIndicator/ZhongliShieldIndicator.csproj @@ -0,0 +1,131 @@ + + + + + + Debug + AnyCPU + {D04A0A02-2B19-4810-A9BC-6790EC15E5AE} + WinExe + ZhongliShieldIndicator + ZhongliShieldIndicator + v4.5.2 + 512 + true + true + + + + + AnyCPU + true + embedded + false + bin\Debug\ + DEBUG;TRACE + prompt + 2 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + app.manifest + + + icon.ico + + + + False + .\Bass.Net.dll + + + ..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + + + \ No newline at end of file diff --git a/ZhongliShieldIndicator/app.manifest b/ZhongliShieldIndicator/app.manifest new file mode 100644 index 0000000..8efeab9 --- /dev/null +++ b/ZhongliShieldIndicator/app.manifest @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ZhongliShieldIndicator/bass.dll b/ZhongliShieldIndicator/bass.dll new file mode 100644 index 0000000..4be4264 Binary files /dev/null and b/ZhongliShieldIndicator/bass.dll differ diff --git a/ZhongliShieldIndicator/icon.ico b/ZhongliShieldIndicator/icon.ico new file mode 100644 index 0000000..17c1fdd Binary files /dev/null and b/ZhongliShieldIndicator/icon.ico differ diff --git a/ZhongliShieldIndicator/packages.config b/ZhongliShieldIndicator/packages.config new file mode 100644 index 0000000..ebb4441 --- /dev/null +++ b/ZhongliShieldIndicator/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/design.pptx b/design.pptx new file mode 100644 index 0000000..0cbdb55 Binary files /dev/null and b/design.pptx differ