chore: initial commit

This commit is contained in:
Anna 2020-07-28 18:46:16 -04:00
commit 3e11a83879
15 changed files with 4265 additions and 0 deletions

203
.editorconfig Normal file
View File

@ -0,0 +1,203 @@
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.{cs,json}]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
tab_width = 4
# New line preferences
end_of_line = lf
insert_final_newline = true
[*.cs]
#### .NET Coding Conventions ####
# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = false
file_header_template = unset
# this. and Me. preferences
dotnet_style_qualification_for_event = true:silent
dotnet_style_qualification_for_field = true:silent
dotnet_style_qualification_for_method = true:silent
dotnet_style_qualification_for_property = true:silent
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
# Expression-level preferences
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_object_initializer = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
# Field preferences
dotnet_style_readonly_field = true:suggestion
# Parameter preferences
dotnet_code_quality_unused_parameters = all:suggestion
#### C# Coding Conventions ####
# var preferences
csharp_style_var_elsewhere = false:silent
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_when_type_is_apparent = false:silent
# Expression-bodied members
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_prefer_switch_expression = true:suggestion
# Null-checking preferences
csharp_style_conditional_delegate_call = true:suggestion
# Modifier preferences
csharp_prefer_static_local_function = true:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
# Code-block preferences
csharp_prefer_braces = true:silent
csharp_prefer_simple_using_statement = true:suggestion
# Expression-level preferences
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
# 'using' directive preferences
csharp_using_directive_placement = outside_namespace:silent
#### C# Formatting Rules ####
# New line preferences
csharp_new_line_before_catch = false
csharp_new_line_before_else = false
csharp_new_line_before_finally = false
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = none
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
#### Naming styles ####
# Naming rules
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
# Symbol specifications
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
# Naming styles
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
* text eol=lf
*.wav binary

362
.gitignore vendored Normal file
View File

@ -0,0 +1,362 @@
## 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
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# 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
nunit-*.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/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# 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
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# 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
# NuGet Symbol Packages
*.snupkg
# 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
*.appxbundle
*.appxupload
# 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/
# 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
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# 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/
# 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
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd

30
Peeping Tom.sln Normal file
View File

@ -0,0 +1,30 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30320.27
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Peeping Tom", "Peeping Tom\Peeping Tom.csproj", "{888F98DF-AF1D-4852-8411-11B1FEEFE674}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9B879446-A687-4B9D-8628-807CCB8C51AE}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{888F98DF-AF1D-4852-8411-11B1FEEFE674}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{888F98DF-AF1D-4852-8411-11B1FEEFE674}.Debug|Any CPU.Build.0 = Debug|Any CPU
{888F98DF-AF1D-4852-8411-11B1FEEFE674}.Release|Any CPU.ActiveCfg = Release|Any CPU
{888F98DF-AF1D-4852-8411-11B1FEEFE674}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B2CFA10E-4CFB-4327-A884-7803D18A4531}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,51 @@
using Dalamud.Configuration;
using Dalamud.Plugin;
using System;
using System.Numerics;
namespace PeepingTom {
[Serializable]
class Configuration : IPluginConfiguration {
public int Version { get; set; } = 1;
[NonSerialized]
private DalamudPluginInterface pi;
public bool MarkTargeted { get; set; } = false;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2235:Mark all non-serializable fields", Justification = "it works?")]
public Vector4 TargetedColour { get; set; } = new Vector4(0f, 1f, 0f, 1f);
public float TargetedSize { get; set; } = 2f;
public bool MarkTargeting { get; set; } = false;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2235:Mark all non-serializable fields", Justification = "it works?")]
public Vector4 TargetingColour { get; set; } = new Vector4(1f, 0f, 0f, 1f);
public float TargetingSize { get; set; } = 2f;
public bool DebugMarkers { get; set; } = false;
public bool KeepHistory { get; set; } = true;
public int NumHistory { get; set; } = 5;
public bool LogParty { get; set; } = true;
public bool LogAlliance { get; set; } = false;
public bool LogInCombat { get; set; } = false;
public bool FocusTargetOnHover { get; set; } = true;
public bool PlaySoundOnTarget { get; set; } = false;
public string SoundPath { get; set; } = null;
public float SoundCooldown { get; set; } = 10f;
public bool ShowInCombat { get; set; } = false;
public bool ShowInInstance { get; set; } = false;
public bool ShowInCutscenes { get; set; } = false;
public void Initialize(DalamudPluginInterface pluginInterface) {
this.pi = pluginInterface;
}
public void Save() {
this.pi.SavePluginConfig(this);
}
}
}

View File

@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Will add later and don't need warnings clogging up", Scope = "member", Target = "~M:PeepingTom.PeepingTomPlugin.Initialize(Dalamud.Plugin.DalamudPluginInterface)")]

View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.CodeAnalysis.FxCopAnalyzers.2.9.6\build\Microsoft.CodeAnalysis.FxCopAnalyzers.props" Condition="Exists('..\packages\Microsoft.CodeAnalysis.FxCopAnalyzers.2.9.6\build\Microsoft.CodeAnalysis.FxCopAnalyzers.props')" />
<Import Project="..\packages\Microsoft.NetFramework.Analyzers.2.9.6\build\Microsoft.NetFramework.Analyzers.props" Condition="Exists('..\packages\Microsoft.NetFramework.Analyzers.2.9.6\build\Microsoft.NetFramework.Analyzers.props')" />
<Import Project="..\packages\Microsoft.NetCore.Analyzers.2.9.6\build\Microsoft.NetCore.Analyzers.props" Condition="Exists('..\packages\Microsoft.NetCore.Analyzers.2.9.6\build\Microsoft.NetCore.Analyzers.props')" />
<Import Project="..\packages\Microsoft.CodeQuality.Analyzers.2.9.6\build\Microsoft.CodeQuality.Analyzers.props" Condition="Exists('..\packages\Microsoft.CodeQuality.Analyzers.2.9.6\build\Microsoft.CodeQuality.Analyzers.props')" />
<Import Project="..\packages\Microsoft.CodeAnalysis.VersionCheckAnalyzer.2.9.6\build\Microsoft.CodeAnalysis.VersionCheckAnalyzer.props" Condition="Exists('..\packages\Microsoft.CodeAnalysis.VersionCheckAnalyzer.2.9.6\build\Microsoft.CodeAnalysis.VersionCheckAnalyzer.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{888F98DF-AF1D-4852-8411-11B1FEEFE674}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PeepingTom</RootNamespace>
<AssemblyName>PeepingTom</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<Reference Include="Dalamud">
<HintPath>..\..\..\..\AppData\Roaming\XIVLauncher\addon\Hooks\Dalamud.dll</HintPath>
</Reference>
<Reference Include="ImGui.NET">
<HintPath>..\..\..\..\AppData\Roaming\XIVLauncher\addon\Hooks\ImGui.NET.dll</HintPath>
</Reference>
<Reference Include="ImGuiScene">
<HintPath>..\..\..\..\AppData\Roaming\XIVLauncher\addon\Hooks\ImGuiScene.dll</HintPath>
</Reference>
<Reference Include="SharpDX.Mathematics, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Configuration.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="Plugin.cs" />
<Compile Include="PluginUI.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="Resources\target.wav" />
</ItemGroup>
<ItemGroup>
<None Include="PeepingTom.json" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.VersionCheckAnalyzer.2.9.6\analyzers\dotnet\cs\Microsoft.CodeAnalysis.VersionCheckAnalyzer.resources.dll" />
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.VersionCheckAnalyzer.2.9.6\analyzers\dotnet\Microsoft.CodeAnalysis.VersionCheckAnalyzer.dll" />
<Analyzer Include="..\packages\Microsoft.CodeQuality.Analyzers.2.9.6\analyzers\dotnet\cs\Humanizer.dll" />
<Analyzer Include="..\packages\Microsoft.CodeQuality.Analyzers.2.9.6\analyzers\dotnet\cs\Microsoft.CodeQuality.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.CodeQuality.Analyzers.2.9.6\analyzers\dotnet\cs\Microsoft.CodeQuality.CSharp.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.NetCore.Analyzers.2.9.6\analyzers\dotnet\cs\Microsoft.NetCore.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.NetCore.Analyzers.2.9.6\analyzers\dotnet\cs\Microsoft.NetCore.CSharp.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.NetFramework.Analyzers.2.9.6\analyzers\dotnet\cs\Microsoft.NetFramework.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.NetFramework.Analyzers.2.9.6\analyzers\dotnet\cs\Microsoft.NetFramework.CSharp.Analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CodeAnalysis.VersionCheckAnalyzer.2.9.6\build\Microsoft.CodeAnalysis.VersionCheckAnalyzer.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeAnalysis.VersionCheckAnalyzer.2.9.6\build\Microsoft.CodeAnalysis.VersionCheckAnalyzer.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.CodeQuality.Analyzers.2.9.6\build\Microsoft.CodeQuality.Analyzers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeQuality.Analyzers.2.9.6\build\Microsoft.CodeQuality.Analyzers.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.NetCore.Analyzers.2.9.6\build\Microsoft.NetCore.Analyzers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.NetCore.Analyzers.2.9.6\build\Microsoft.NetCore.Analyzers.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.NetFramework.Analyzers.2.9.6\build\Microsoft.NetFramework.Analyzers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.NetFramework.Analyzers.2.9.6\build\Microsoft.NetFramework.Analyzers.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.CodeAnalysis.FxCopAnalyzers.2.9.6\build\Microsoft.CodeAnalysis.FxCopAnalyzers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeAnalysis.FxCopAnalyzers.2.9.6\build\Microsoft.CodeAnalysis.FxCopAnalyzers.props'))" />
</Target>
</Project>

View File

@ -0,0 +1,10 @@
{
"Author": "ascclemens",
"Name": "Peeping Tom",
"Description": "Shows who is or was targeting you",
"InternalName": "PeepingTom",
"AssemblyVersion": "1.0.0",
"RepoUrl": "https://git.sr.ht/~jkcclemens/PeepingTom",
"ApplicableVersion": "any",
"DalamudApiLevel": 1
}

63
Peeping Tom/Plugin.cs Normal file
View File

@ -0,0 +1,63 @@
using Dalamud.Game.Command;
using Dalamud.Plugin;
using System;
namespace PeepingTom {
public class PeepingTomPlugin : IDalamudPlugin, IDisposable {
public string Name => "Peeping Tom";
private DalamudPluginInterface pi;
private Configuration config;
private PluginUI ui;
public void Initialize(DalamudPluginInterface pluginInterface) {
this.pi = pluginInterface ?? throw new ArgumentNullException(nameof(pluginInterface), "DalamudPluginInterface argument was null");
this.config = this.pi.GetPluginConfig() as Configuration ?? new Configuration();
this.config.Initialize(this.pi);
this.ui = new PluginUI(this, this.config, this.pi);
this.pi.CommandManager.AddHandler("/ppeepingtom", new CommandInfo(OnCommand) {
HelpMessage = "Use with no arguments to show the list. Use with \"c\" or \"config\" to show the config"
});
this.pi.CommandManager.AddHandler("/ptom", new CommandInfo(OnCommand) {
HelpMessage = "Alias for /ppeepingtom"
});
this.pi.CommandManager.AddHandler("/ppeep", new CommandInfo(OnCommand) {
HelpMessage = "Alias for /ppeepingtom"
});
this.pi.UiBuilder.OnBuildUi += DrawUI;
this.pi.UiBuilder.OnOpenConfigUi += ConfigUI;
}
private void OnCommand(string command, string args) {
if (args == "config" || args == "c") {
this.ui.SettingsVisible = true;
} else {
this.ui.Visible = true;
}
}
protected virtual void Dispose(bool includeManaged) {
this.pi.UiBuilder.OnBuildUi -= DrawUI;
this.pi.UiBuilder.OnOpenConfigUi -= ConfigUI;
this.pi.CommandManager.RemoveHandler("/ppeepingtom");
this.pi.CommandManager.RemoveHandler("/ptom");
this.pi.CommandManager.RemoveHandler("/ppeep");
this.ui.Dispose();
}
public void Dispose() {
this.Dispose(true);
GC.SuppressFinalize(this);
}
private void DrawUI() {
this.ui.Draw();
}
private void ConfigUI(object sender, EventArgs args) {
this.ui.SettingsVisible = true;
}
}
}

483
Peeping Tom/PluginUI.cs Normal file
View File

@ -0,0 +1,483 @@
using Dalamud.Game.Chat;
using Dalamud.Game.Chat.SeStringHandling;
using Dalamud.Game.Chat.SeStringHandling.Payloads;
using Dalamud.Game.ClientState;
using Dalamud.Game.ClientState.Actors.Types;
using Dalamud.Plugin;
using ImGuiNET;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Media;
using System.Numerics;
using System.Runtime.InteropServices;
namespace PeepingTom {
class PluginUI : IDisposable {
private readonly PeepingTomPlugin plugin;
private readonly Configuration config;
private readonly DalamudPluginInterface pi;
private readonly List<PlayerCharacter> previousTargeters = new List<PlayerCharacter>();
private IntPtr? previousFocus = null;
private long soundLastPlayed = 0;
private int lastTargetAmount = 0;
private bool visible = false;
public bool Visible {
get { return this.visible; }
set { this.visible = value; }
}
private bool settingsVisible = false;
public bool SettingsVisible {
get { return this.settingsVisible; }
set { this.settingsVisible = value; }
}
public PluginUI(PeepingTomPlugin plugin, Configuration config, DalamudPluginInterface pluginInterface) {
this.plugin = plugin;
this.config = config;
this.pi = pluginInterface;
}
public void Dispose() {
this.Visible = false;
this.SettingsVisible = false;
this.previousTargeters.Clear();
}
public void Draw() {
if (this.SettingsVisible) {
// 700x250 if setting a size
ImGui.SetNextWindowSize(new Vector2(700, 250));
if (ImGui.Begin($"{this.plugin.Name} settings", ref this.settingsVisible)) {
if (ImGui.BeginTabBar("##settings-tabs")) {
if (ImGui.BeginTabItem("Markers")) {
bool markTargeted = this.config.MarkTargeted;
if (ImGui.Checkbox("Mark your target", ref markTargeted)) {
this.config.MarkTargeted = markTargeted;
this.config.Save();
}
Vector4 targetedColour = this.config.TargetedColour;
if (ImGui.ColorEdit4("Target mark colour", ref targetedColour)) {
this.config.TargetedColour = targetedColour;
this.config.Save();
}
float targetedSize = this.config.TargetedSize;
if (ImGui.DragFloat("Target mark size", ref targetedSize, 0.01f, 0f, 15f)) {
targetedSize = Math.Max(0f, targetedSize);
this.config.TargetedSize = targetedSize;
this.config.Save();
}
ImGui.Spacing();
bool markTargeting = this.config.MarkTargeting;
if (ImGui.Checkbox("Mark targeting you", ref markTargeting)) {
this.config.MarkTargeting = markTargeting;
this.config.Save();
}
Vector4 targetingColour = this.config.TargetingColour;
if (ImGui.ColorEdit4("Targeting mark colour", ref targetingColour)) {
this.config.TargetingColour = targetingColour;
this.config.Save();
}
float targetingSize = this.config.TargetingSize;
if (ImGui.DragFloat("Targeting mark size", ref targetingSize, 0.01f, 0f, 15f)) {
targetingSize = Math.Max(0f, targetingSize);
this.config.TargetingSize = targetingSize;
this.config.Save();
}
ImGui.EndTabItem();
}
if (ImGui.BeginTabItem("Filters")) {
bool showParty = this.config.LogParty;
if (ImGui.Checkbox("Log party members", ref showParty)) {
this.config.LogParty = showParty;
this.config.Save();
}
bool logAlliance = this.config.LogAlliance;
if (ImGui.Checkbox("Log alliance members", ref logAlliance)) {
this.config.LogAlliance = logAlliance;
this.config.Save();
}
bool logInCombat = this.config.LogInCombat;
if (ImGui.Checkbox("Log targeters engaged in combat", ref logInCombat)) {
this.config.LogInCombat = logInCombat;
this.config.Save();
}
ImGui.EndTabItem();
}
if (ImGui.BeginTabItem("Behaviour")) {
bool focusTarget = this.config.FocusTargetOnHover;
if (ImGui.Checkbox("Focus target on hover", ref focusTarget)) {
this.config.FocusTargetOnHover = focusTarget;
this.config.Save();
}
bool playSound = this.config.PlaySoundOnTarget;
if (ImGui.Checkbox("Play sound when targeted", ref playSound)) {
this.config.PlaySoundOnTarget = playSound;
this.config.Save();
}
string path = this.config.SoundPath ?? "";
if (ImGui.InputText("Path to WAV file", ref path, 1_000)) {
path = path.Trim();
this.config.SoundPath = path.Length == 0 ? null : path;
this.config.Save();
}
ImGui.Text("Leave this blank to use a built-in sound.");
float soundCooldown = this.config.SoundCooldown;
if (ImGui.DragFloat("Cooldown for sound (seconds)", ref soundCooldown, .01f, 0f, 30f)) {
soundCooldown = Math.Max(0f, soundCooldown);
this.config.SoundCooldown = soundCooldown;
this.config.Save();
}
ImGui.EndTabItem();
}
if (ImGui.BeginTabItem("Visibility")) {
// TODO: this needs somewhere better to live in the settings
bool showInCombat = this.config.ShowInCombat;
if (ImGui.Checkbox("Show window while in combat", ref showInCombat)) {
this.config.ShowInCombat = showInCombat;
}
bool showInInstance = this.config.ShowInInstance;
if (ImGui.Checkbox("Show window while in instance", ref showInInstance)) {
this.config.ShowInInstance = showInInstance;
}
bool showInCutscenes = this.config.ShowInCutscenes;
if (ImGui.Checkbox("Show window while in cutscenes", ref showInCutscenes)) {
this.config.ShowInCutscenes = showInCutscenes;
}
ImGui.EndTabItem();
}
if (ImGui.BeginTabItem("History")) {
bool keepHistory = this.config.KeepHistory;
if (ImGui.Checkbox("Show previous targeters", ref keepHistory)) {
this.config.KeepHistory = keepHistory;
this.config.Save();
}
int numHistory = this.config.NumHistory;
if (ImGui.InputInt("Number of previous targeters to keep", ref numHistory)) {
numHistory = Math.Max(0, Math.Min(10, numHistory));
this.config.NumHistory = numHistory;
this.config.Save();
}
ImGui.EndTabItem();
}
if (ImGui.BeginTabItem("Debug")) {
bool debugMarkers = this.config.DebugMarkers;
if (ImGui.Checkbox("Debug markers", ref debugMarkers)) {
this.config.DebugMarkers = debugMarkers;
this.config.Save();
}
ImGui.Separator();
if (ImGui.Button("Log targeting you")) {
PlayerCharacter player = this.pi.ClientState.LocalPlayer;
if (player != null) {
// loop over all players looking at the current player
var actors = this.pi.ClientState.Actors
.Where(actor => actor.TargetActorID == player.ActorId && actor is PlayerCharacter)
.Select(actor => actor as PlayerCharacter);
foreach (PlayerCharacter actor in actors) {
PlayerPayload payload = new PlayerPayload(actor.Name, actor.HomeWorld.Id);
Payload[] payloads = { payload };
this.pi.Framework.Gui.Chat.PrintChat(new XivChatEntry {
MessageBytes = new SeString(payloads).Encode()
});
}
}
}
if (ImGui.Button("Log your target")) {
PlayerCharacter target = GetCurrentTarget();
if (target != null) {
PlayerPayload payload = new PlayerPayload(target.Name, target.HomeWorld.Id);
Payload[] payloads = { payload };
this.pi.Framework.Gui.Chat.PrintChat(new XivChatEntry {
MessageBytes = new SeString(payloads).Encode()
});
}
}
if (this.pi.ClientState.LocalPlayer != null) {
PlayerCharacter player = this.pi.ClientState.LocalPlayer;
IntPtr statusPtr = this.pi.TargetModuleScanner.ResolveRelativeAddress(player.Address, 0x1901);
byte status = Marshal.ReadByte(statusPtr);
ImGui.Text($"Status: {status}");
}
ImGui.EndTabItem();
}
ImGui.EndTabBar();
}
ImGui.End();
}
}
bool inCombat = this.pi.ClientState.Condition[ConditionFlag.InCombat];
bool inInstance = this.pi.ClientState.Condition[ConditionFlag.BoundByDuty];
bool inCutscene = this.pi.ClientState.Condition[ConditionFlag.WatchingCutscene];
// FIXME: this could just be a boolean expression
bool shouldBeShown = this.Visible;
if (inCombat && !this.config.ShowInCombat) {
shouldBeShown = false;
} else if (inInstance && !this.config.ShowInInstance) {
shouldBeShown = false;
} else if (inCutscene && !this.config.ShowInCutscenes) {
shouldBeShown = false;
}
if (shouldBeShown) {
PlayerCharacter player = this.pi.ClientState.LocalPlayer;
if (player != null) {
PlayerCharacter[] targeting = this.pi.ClientState.Actors
.Where(actor => actor.TargetActorID == player.ActorId && actor is PlayerCharacter)
.Select(actor => actor as PlayerCharacter)
.Where(actor => this.config.LogParty || this.pi.ClientState.PartyList.All(member => member.Actor.ActorId != actor.ActorId))
.Where(actor => this.config.LogAlliance || !this.InAlliance(actor))
.Where(actor => this.config.LogInCombat || !this.InCombat(actor))
.ToArray();
if (this.config.PlaySoundOnTarget && targeting.Length > this.lastTargetAmount && this.CanPlaySound()) {
this.soundLastPlayed = Stopwatch.GetTimestamp();
this.PlaySound();
}
this.lastTargetAmount = targeting.Length;
if (ImGui.Begin(this.plugin.Name, ref this.visible, ImGuiWindowFlags.AlwaysAutoResize)) {
ImGui.Text("Targeting you");
if (ImGui.ListBoxHeader("##targeting", targeting.Length, 5)) {
// add the two first players for testing
//foreach (PlayerCharacter p in this.pi.ClientState.Actors
// .Where(actor => actor is PlayerCharacter)
// .Skip(1)
// .Select(actor => actor as PlayerCharacter)
// .Take(2)) {
// this.AddEntry(p);
//}
foreach (PlayerCharacter targeter in targeting) {
if (this.config.KeepHistory) {
// add the targeter to the previous list
if (this.previousTargeters.Any(old => old.ActorId == targeter.ActorId)) {
this.previousTargeters.RemoveAll(old => old.ActorId == targeter.ActorId);
}
this.previousTargeters.Insert(0, targeter);
while (this.previousTargeters.Where(old => !targeting.Contains(old)).Count() > this.config.NumHistory) {
this.previousTargeters.RemoveAt(this.previousTargeters.Count - 1);
}
}
this.AddEntry(targeter);
}
if (this.config.KeepHistory) {
foreach (PlayerCharacter oldTargeter in this.previousTargeters.Where(old => !targeting.Contains(old))) {
this.AddEntry(oldTargeter, ImGuiSelectableFlags.Disabled);
}
}
ImGui.ListBoxFooter();
}
if (this.config.FocusTargetOnHover && !ImGui.IsAnyItemHovered() && this.previousFocus != null) {
// old focus target still here
if (this.pi.ClientState.Actors.Any(actor => actor.Address == this.previousFocus)) {
this.FocusTargetRaw((IntPtr)this.previousFocus);
} else {
this.FocusTargetRaw(IntPtr.Zero);
}
this.previousFocus = null;
}
ImGui.Text("Click to link or right click to target.");
ImGui.End();
}
}
}
if (this.config.MarkTargeted) {
PlayerCharacter target = GetCurrentTarget();
MarkPlayer(GetCurrentTarget(), this.config.TargetedColour, this.config.TargetedSize);
}
if (this.config.MarkTargeting) {
PlayerCharacter player = this.pi.ClientState.LocalPlayer;
if (player != null) {
var actors = this.pi.ClientState.Actors
.Where(actor => actor.TargetActorID == player.ActorId && actor is PlayerCharacter)
.Select(actor => actor as PlayerCharacter);
foreach (PlayerCharacter target in actors) {
MarkPlayer(target, this.config.TargetingColour, this.config.TargetingSize);
}
}
}
}
private void AddEntry(PlayerCharacter targeter, ImGuiSelectableFlags flags = ImGuiSelectableFlags.None) {
ImGui.Selectable(targeter.Name, false, flags);
bool hover = ImGui.IsItemHovered();
bool left = hover && ImGui.IsMouseClicked(0);
bool right = hover && ImGui.IsMouseClicked(1);
bool present = this.pi.ClientState.Actors.Any(actor => actor.ActorId == targeter.ActorId);
if (this.config.FocusTargetOnHover && hover && present) {
if (this.previousFocus == null) {
this.previousFocus = this.GetRawFocusTarget();
}
this.FocusTarget(targeter);
}
if (left) {
PlayerPayload payload = new PlayerPayload(targeter.Name, targeter.HomeWorld.Id);
Payload[] payloads = { payload };
this.pi.Framework.Gui.Chat.PrintChat(new XivChatEntry {
MessageBytes = new SeString(payloads).Encode()
});
} else if (right && present) {
this.Target(targeter);
}
}
private void MarkPlayer(PlayerCharacter player, Vector4 colour, float size) {
if (player == null) {
return;
}
if (!this.pi.Framework.Gui.WorldToScreen(player.Position, out SharpDX.Vector2 screenPos)) {
return;
}
ImGuiWindowFlags flags = ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoBackground | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoInputs | ImGuiWindowFlags.NoFocusOnAppearing;
if (this.config.DebugMarkers) {
flags &= ~ImGuiWindowFlags.NoBackground;
}
// smallest window size is 32x32
if (ImGui.Begin($"Targeting Marker: {player.Name}@{player.HomeWorld}", flags)) {
// determine the window size, giving it lots of space
float winSize = Math.Max(32, size * 10);
ImGui.SetWindowPos(new Vector2(screenPos.X - winSize / 2, screenPos.Y - winSize / 2));
ImGui.SetWindowSize(new Vector2(winSize, winSize));
ImGui.GetWindowDrawList().AddCircleFilled(
new Vector2(screenPos.X, screenPos.Y),
size,
ImGui.GetColorU32(colour),
100
);
ImGui.End();
}
}
private PlayerCharacter GetCurrentTarget() {
PlayerCharacter player = this.pi.ClientState.LocalPlayer;
if (player == null) {
return null;
}
int targetId = player.TargetActorID;
if (targetId <= 0) {
return null;
}
return this.pi.ClientState.Actors
.Where(actor => actor.ActorId == targetId && actor is PlayerCharacter)
.Select(actor => actor as PlayerCharacter)
.FirstOrDefault();
}
private void Target(Actor actor) {
IntPtr targetPtr = this.pi.TargetModuleScanner.ResolveRelativeAddress(this.pi.TargetModuleScanner.Module.BaseAddress, 0x1c64150);
Marshal.WriteIntPtr(targetPtr, actor.Address);
}
private void FocusTarget(Actor actor) {
FocusTargetRaw(actor.Address);
}
private void FocusTargetRaw(IntPtr ptr) {
IntPtr targetPtr = this.pi.TargetModuleScanner.ResolveRelativeAddress(this.pi.TargetModuleScanner.Module.BaseAddress, 0x1c641c8);
Marshal.WriteIntPtr(targetPtr, ptr);
}
private IntPtr GetRawFocusTarget() {
IntPtr targetPtr = this.pi.TargetModuleScanner.ResolveRelativeAddress(this.pi.TargetModuleScanner.Module.BaseAddress, 0x1c641c8);
return Marshal.ReadIntPtr(targetPtr);
}
private bool CanPlaySound() {
if (this.soundLastPlayed == 0) {
return true;
}
long current = Stopwatch.GetTimestamp();
long diff = current - this.soundLastPlayed;
// only play every 10 seconds?
float secs = (float)diff / Stopwatch.Frequency;
return secs >= this.config.SoundCooldown;
}
private void PlaySound() {
SoundPlayer player;
if (this.config.SoundPath == null) {
player = new SoundPlayer(Properties.Resources.Target);
} else {
player = new SoundPlayer(this.config.SoundPath);
}
try {
player.Play();
} catch (FileNotFoundException e) {
this.SendError($"Could not play sound: {e.Message}");
} catch (InvalidOperationException e) {
this.SendError($"Could not play sound: {e.Message}");
} finally {
player.Dispose();
}
}
private void SendError(string message) {
Payload[] payloads = { new TextPayload($"[Who's Looking] {message}") };
this.pi.Framework.Gui.Chat.PrintChat(new XivChatEntry {
MessageBytes = new SeString(payloads).Encode(),
Type = XivChatType.ErrorMessage
});
}
private byte GetStatus(Actor actor) {
IntPtr statusPtr = this.pi.TargetModuleScanner.ResolveRelativeAddress(actor.Address, 0x1901);
return Marshal.ReadByte(statusPtr);
}
private bool InCombat(Actor actor) {
return (GetStatus(actor) & 2) > 0;
}
private bool InAlliance(Actor actor) {
return (GetStatus(actor) & 32) > 0;
}
}
}

View File

@ -0,0 +1,38 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Peeping Tom")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Peeping Tom")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("888f98df-af1d-4852-8411-11b1feefe674")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: NeutralResourcesLanguage("en-GB")]

View File

@ -0,0 +1,72 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace PeepingTom.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.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() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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("PeepingTom.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream Target {
get {
return ResourceManager.GetStream("Target", resourceCulture);
}
}
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.CodeAnalysis.FxCopAnalyzers" version="2.9.6" targetFramework="net48" developmentDependency="true" />
<package id="Microsoft.CodeAnalysis.VersionCheckAnalyzer" version="2.9.6" targetFramework="net48" developmentDependency="true" />
<package id="Microsoft.CodeQuality.Analyzers" version="2.9.6" targetFramework="net48" developmentDependency="true" />
<package id="Microsoft.NetCore.Analyzers" version="2.9.6" targetFramework="net48" developmentDependency="true" />
<package id="Microsoft.NetFramework.Analyzers" version="2.9.6" targetFramework="net48" developmentDependency="true" />
</packages>