-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from Ottermandias/SmallFixes
Small fixes
- Loading branch information
Showing
43 changed files
with
2,667 additions
and
2,153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,85 @@ | ||
|
||
[*] | ||
charset=utf-8 | ||
end_of_line=lf | ||
trim_trailing_whitespace=false | ||
insert_final_newline=false | ||
indent_style=space | ||
indent_size=4 | ||
|
||
# Microsoft .NET properties | ||
csharp_new_line_before_members_in_object_initializers=false | ||
csharp_preferred_modifier_order=public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:suggestion | ||
csharp_space_after_cast=false | ||
csharp_space_after_keywords_in_control_flow_statements=false | ||
csharp_space_between_method_call_parameter_list_parentheses=true | ||
csharp_space_between_method_declaration_parameter_list_parentheses=true | ||
csharp_space_between_parentheses=control_flow_statements,expressions,type_casts | ||
csharp_style_var_elsewhere=true:suggestion | ||
csharp_style_var_for_built_in_types=true:suggestion | ||
csharp_style_var_when_type_is_apparent=true:suggestion | ||
dotnet_style_parentheses_in_arithmetic_binary_operators=never_if_unnecessary:none | ||
dotnet_style_parentheses_in_other_binary_operators=never_if_unnecessary:none | ||
dotnet_style_parentheses_in_relational_binary_operators=never_if_unnecessary:none | ||
dotnet_style_predefined_type_for_locals_parameters_members=true:suggestion | ||
dotnet_style_predefined_type_for_member_access=true:suggestion | ||
dotnet_style_qualification_for_event=false:suggestion | ||
dotnet_style_qualification_for_field=false:suggestion | ||
dotnet_style_qualification_for_method=false:suggestion | ||
dotnet_style_qualification_for_property=false:suggestion | ||
dotnet_style_require_accessibility_modifiers=for_non_interface_members:suggestion | ||
|
||
# ReSharper properties | ||
resharper_autodetect_indent_settings=true | ||
resharper_csharp_space_within_array_access_brackets=true | ||
resharper_enforce_line_ending_style=true | ||
resharper_place_attribute_on_same_line=false | ||
resharper_space_after_cast=false | ||
resharper_space_within_checked_parentheses=true | ||
resharper_space_within_default_parentheses=true | ||
resharper_space_within_nameof_parentheses=true | ||
resharper_space_within_single_line_array_initializer_braces=true | ||
resharper_space_within_sizeof_parentheses=true | ||
resharper_space_within_typeof_parentheses=true | ||
resharper_space_within_type_argument_angles=true | ||
resharper_space_within_type_parameter_angles=true | ||
resharper_use_indent_from_vs=false | ||
resharper_wrap_lines=true | ||
|
||
# ReSharper inspection severities | ||
resharper_arrange_redundant_parentheses_highlighting=hint | ||
resharper_arrange_this_qualifier_highlighting=hint | ||
resharper_arrange_type_member_modifiers_highlighting=hint | ||
resharper_arrange_type_modifiers_highlighting=hint | ||
resharper_built_in_type_reference_style_for_member_access_highlighting=hint | ||
resharper_built_in_type_reference_style_highlighting=hint | ||
resharper_redundant_base_qualifier_highlighting=warning | ||
resharper_suggest_var_or_type_built_in_types_highlighting=hint | ||
resharper_suggest_var_or_type_elsewhere_highlighting=hint | ||
resharper_suggest_var_or_type_simple_types_highlighting=hint | ||
resharper_web_config_module_not_resolved_highlighting=warning | ||
resharper_web_config_type_not_resolved_highlighting=warning | ||
resharper_web_config_wrong_module_highlighting=warning | ||
|
||
[*.{appxmanifest,asax,ascx,aspx,build,cg,cginc,compute,cs,cshtml,dtd,hlsl,hlsli,hlslinc,master,nuspec,razor,resw,resx,shader,skin,usf,ush,vb,xaml,xamlx,xoml,xsd}] | ||
indent_style=space | ||
indent_size=4 | ||
tab_width=4 | ||
|
||
[*] | ||
charset=utf-8 | ||
end_of_line=lf | ||
trim_trailing_whitespace=true | ||
insert_final_newline=false | ||
indent_style=space | ||
indent_size=4 | ||
|
||
# Microsoft .NET properties | ||
csharp_new_line_before_members_in_object_initializers=false | ||
csharp_preferred_modifier_order=public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:suggestion | ||
csharp_prefer_braces=true:none | ||
csharp_space_after_cast=false | ||
csharp_space_after_keywords_in_control_flow_statements=false | ||
csharp_space_between_method_call_parameter_list_parentheses=true | ||
csharp_space_between_method_declaration_parameter_list_parentheses=true | ||
csharp_space_between_parentheses=control_flow_statements,expressions,type_casts | ||
csharp_style_var_elsewhere=true:suggestion | ||
csharp_style_var_for_built_in_types=true:suggestion | ||
csharp_style_var_when_type_is_apparent=true:suggestion | ||
dotnet_style_parentheses_in_arithmetic_binary_operators=never_if_unnecessary:none | ||
dotnet_style_parentheses_in_other_binary_operators=never_if_unnecessary:none | ||
dotnet_style_parentheses_in_relational_binary_operators=never_if_unnecessary:none | ||
dotnet_style_predefined_type_for_locals_parameters_members=true:suggestion | ||
dotnet_style_predefined_type_for_member_access=true:suggestion | ||
dotnet_style_qualification_for_event=false:suggestion | ||
dotnet_style_qualification_for_field=false:suggestion | ||
dotnet_style_qualification_for_method=false:suggestion | ||
dotnet_style_qualification_for_property=false:suggestion | ||
dotnet_style_require_accessibility_modifiers=for_non_interface_members:suggestion | ||
|
||
# ReSharper properties | ||
resharper_align_multiline_binary_expressions_chain=false | ||
resharper_align_multiline_calls_chain=false | ||
resharper_autodetect_indent_settings=true | ||
resharper_braces_redundant=true | ||
resharper_constructor_or_destructor_body=expression_body | ||
resharper_csharp_empty_block_style=together | ||
resharper_csharp_max_line_length=144 | ||
resharper_csharp_space_within_array_access_brackets=true | ||
resharper_enforce_line_ending_style=true | ||
resharper_int_align_assignments=true | ||
resharper_int_align_comments=true | ||
resharper_int_align_fields=true | ||
resharper_int_align_invocations=false | ||
resharper_int_align_nested_ternary=true | ||
resharper_int_align_properties=false | ||
resharper_int_align_switch_expressions=true | ||
resharper_int_align_switch_sections=true | ||
resharper_int_align_variables=true | ||
resharper_local_function_body=expression_body | ||
resharper_method_or_operator_body=expression_body | ||
resharper_place_attribute_on_same_line=false | ||
resharper_space_after_cast=false | ||
resharper_space_within_checked_parentheses=true | ||
resharper_space_within_default_parentheses=true | ||
resharper_space_within_nameof_parentheses=true | ||
resharper_space_within_single_line_array_initializer_braces=true | ||
resharper_space_within_sizeof_parentheses=true | ||
resharper_space_within_typeof_parentheses=true | ||
resharper_space_within_type_argument_angles=true | ||
resharper_space_within_type_parameter_angles=true | ||
resharper_use_indent_from_vs=false | ||
resharper_wrap_lines=true | ||
|
||
# ReSharper inspection severities | ||
resharper_arrange_redundant_parentheses_highlighting=hint | ||
resharper_arrange_this_qualifier_highlighting=hint | ||
resharper_arrange_type_member_modifiers_highlighting=hint | ||
resharper_arrange_type_modifiers_highlighting=hint | ||
resharper_built_in_type_reference_style_for_member_access_highlighting=hint | ||
resharper_built_in_type_reference_style_highlighting=hint | ||
resharper_redundant_base_qualifier_highlighting=warning | ||
resharper_suggest_var_or_type_built_in_types_highlighting=hint | ||
resharper_suggest_var_or_type_elsewhere_highlighting=hint | ||
resharper_suggest_var_or_type_simple_types_highlighting=hint | ||
resharper_web_config_module_not_resolved_highlighting=warning | ||
resharper_web_config_type_not_resolved_highlighting=warning | ||
resharper_web_config_wrong_module_highlighting=warning | ||
|
||
[*.{appxmanifest,asax,ascx,aspx,build,cg,cginc,compute,cs,cshtml,dtd,hlsl,hlsli,hlslinc,master,nuspec,razor,resw,resx,shader,skin,usf,ush,vb,xaml,xamlx,xoml,xsd}] | ||
indent_style=space | ||
indent_size=4 | ||
tab_width=4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,61 @@ | ||
using System.Runtime.InteropServices; | ||
using Dalamud.Game.ClientState.Actors; | ||
using Dalamud.Game.ClientState.Actors.Types; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
using System.Threading.Tasks; | ||
using Dalamud.Game.ClientState.Actors; | ||
using Dalamud.Game.ClientState.Actors.Types; | ||
|
||
namespace Penumbra | ||
namespace Penumbra.Game | ||
{ | ||
public static class RefreshActors | ||
{ | ||
private const int RenderModeOffset = 0x0104; | ||
private const int RenderTaskPlayerDelay = 75; | ||
private const int RenderTaskOtherDelay = 25; | ||
private const int ModelInvisibilityFlag = 0b10; | ||
|
||
private static async void Redraw(Actor actor) | ||
{ | ||
var ptr = actor.Address; | ||
var renderModePtr = ptr + RenderModeOffset; | ||
var renderStatus = Marshal.ReadInt32(renderModePtr); | ||
|
||
async void DrawObject(int delay) | ||
{ | ||
Marshal.WriteInt32(renderModePtr, renderStatus | ModelInvisibilityFlag); | ||
await Task.Delay(delay); | ||
Marshal.WriteInt32(renderModePtr, renderStatus & ~ModelInvisibilityFlag); | ||
} | ||
|
||
if (actor.ObjectKind == Dalamud.Game.ClientState.Actors.ObjectKind.Player) | ||
{ | ||
DrawObject(RenderTaskPlayerDelay); | ||
await Task.Delay(RenderTaskPlayerDelay); | ||
} | ||
else | ||
DrawObject(RenderTaskOtherDelay); | ||
|
||
} | ||
|
||
public static void RedrawSpecific(ActorTable actors, string name) | ||
{ | ||
if (name?.Length == 0) | ||
RedrawAll(actors); | ||
|
||
foreach (var actor in actors) | ||
if (actor.Name == name) | ||
Redraw(actor); | ||
} | ||
|
||
public static void RedrawAll(ActorTable actors) | ||
{ | ||
foreach (var actor in actors) | ||
Redraw(actor); | ||
} | ||
public static class RefreshActors | ||
{ | ||
private const int RenderModeOffset = 0x0104; | ||
private const int RenderTaskPlayerDelay = 75; | ||
private const int RenderTaskOtherDelay = 25; | ||
private const int ModelInvisibilityFlag = 0b10; | ||
|
||
private static async void Redraw( Actor actor ) | ||
{ | ||
var ptr = actor.Address; | ||
var renderModePtr = ptr + RenderModeOffset; | ||
var renderStatus = Marshal.ReadInt32( renderModePtr ); | ||
|
||
async void DrawObject( int delay ) | ||
{ | ||
Marshal.WriteInt32( renderModePtr, renderStatus | ModelInvisibilityFlag ); | ||
await Task.Delay( delay ); | ||
Marshal.WriteInt32( renderModePtr, renderStatus & ~ModelInvisibilityFlag ); | ||
} | ||
|
||
if( actor.ObjectKind == ObjectKind.Player ) | ||
{ | ||
DrawObject( RenderTaskPlayerDelay ); | ||
await Task.Delay( RenderTaskPlayerDelay ); | ||
} | ||
else | ||
{ | ||
DrawObject( RenderTaskOtherDelay ); | ||
} | ||
} | ||
|
||
public static void RedrawSpecific( ActorTable actors, string name ) | ||
{ | ||
if( name?.Length == 0 ) | ||
{ | ||
RedrawAll( actors ); | ||
} | ||
|
||
foreach( var actor in actors.Where( A => A.Name == name ) ) | ||
{ | ||
Redraw( actor ); | ||
} | ||
} | ||
|
||
public static void RedrawAll( ActorTable actors ) | ||
{ | ||
foreach( var actor in actors ) | ||
{ | ||
Redraw( actor ); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.