diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..72418f4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,760 @@ +[*] +charset = utf-8 +end_of_line = crlf +indent_size = 4 +indent_style = space +insert_final_newline = false +max_line_length = 120 +tab_width = 4 +trim_trailing_whitespace = true +ij_continuation_indent_size = 8 +ij_formatter_off_tag = @formatter:off +ij_formatter_on_tag = @formatter:on +ij_formatter_tags_enabled = false +ij_smart_tabs = false +ij_visual_guides = none +ij_wrap_on_typing = false + +# Microsoft .NET properties +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_style_var_elsewhere = true:suggestion +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +dotnet_diagnostic.sa1200.severity = none +dotnet_naming_rule.constants_rule.severity = warning +dotnet_naming_rule.constants_rule.style = all_upper_style +dotnet_naming_rule.constants_rule.symbols = constants_symbols +dotnet_naming_rule.private_constants_rule.severity = warning +dotnet_naming_rule.private_constants_rule.style = all_upper_style +dotnet_naming_rule.private_constants_rule.symbols = private_constants_symbols +dotnet_naming_rule.private_static_readonly_rule.severity = warning +dotnet_naming_rule.private_static_readonly_rule.style = lower_camel_case_style +dotnet_naming_rule.private_static_readonly_rule.symbols = private_static_readonly_symbols +dotnet_naming_style.all_upper_style.capitalization = all_upper +dotnet_naming_style.all_upper_style.word_separator = _ +dotnet_naming_style.lower_camel_case_style.capitalization = camel_case +dotnet_naming_style.lower_camel_case_style.required_prefix = _ +dotnet_naming_symbols.constants_symbols.applicable_accessibilities = public,internal,protected,protected_internal,private_protected +dotnet_naming_symbols.constants_symbols.applicable_kinds = field +dotnet_naming_symbols.constants_symbols.required_modifiers = const +dotnet_naming_symbols.private_constants_symbols.applicable_accessibilities = private +dotnet_naming_symbols.private_constants_symbols.applicable_kinds = field +dotnet_naming_symbols.private_constants_symbols.required_modifiers = const +dotnet_naming_symbols.private_static_readonly_symbols.applicable_accessibilities = private +dotnet_naming_symbols.private_static_readonly_symbols.applicable_kinds = field +dotnet_naming_symbols.private_static_readonly_symbols.required_modifiers = static,readonly +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_apply_auto_detected_rules = false +resharper_autodetect_indent_settings = true +resharper_blank_lines_after_control_transfer_statements = 1 +resharper_blank_lines_around_single_line_auto_property = 1 +resharper_blank_lines_around_single_line_property = 1 +resharper_blank_lines_before_block_statements = 1 +resharper_csharp_empty_block_style = together_same_line +resharper_csharp_keep_blank_lines_in_code = 1 +resharper_csharp_keep_blank_lines_in_declarations = 1 +resharper_csharp_wrap_after_declaration_lpar = true +resharper_csharp_wrap_before_first_type_parameter_constraint = true +resharper_csharp_wrap_parameters_style = chop_if_long +resharper_enforce_line_ending_style = true +resharper_indent_preprocessor_region = no_indent +resharper_keep_existing_embedded_arrangement = false +resharper_keep_existing_expr_member_arrangement = false +resharper_keep_existing_initializer_arrangement = false +resharper_keep_existing_invocation_parens_arrangement = false +resharper_keep_existing_property_patterns_arrangement = false +resharper_keep_existing_switch_expression_arrangement = false +resharper_max_array_initializer_elements_on_line = 5 +resharper_max_enum_members_on_line = 0 +resharper_max_initializer_elements_on_line = 5 +resharper_place_accessorholder_attribute_on_same_line = false +resharper_place_field_attribute_on_same_line = false +resharper_place_simple_embedded_statement_on_same_line = false +resharper_show_autodetect_configure_formatting_tip = false +resharper_space_after_cast = false +resharper_use_indent_from_vs = false +resharper_wrap_array_initializer_style = chop_always +resharper_wrap_before_extends_colon = true +resharper_wrap_lines = true +resharper_wrap_object_and_collection_initializer_style = chop_always + +# 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 + +[*.css] +ij_css_align_closing_brace_with_properties = false +ij_css_blank_lines_around_nested_selector = 1 +ij_css_blank_lines_between_blocks = 1 +ij_css_brace_placement = end_of_line +ij_css_enforce_quotes_on_format = false +ij_css_hex_color_long_format = false +ij_css_hex_color_lower_case = false +ij_css_hex_color_short_format = false +ij_css_hex_color_upper_case = false +ij_css_keep_blank_lines_in_code = 2 +ij_css_keep_indents_on_empty_lines = false +ij_css_keep_single_line_blocks = false +ij_css_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_css_space_after_colon = true +ij_css_space_before_opening_brace = true +ij_css_use_double_quotes = true +ij_css_value_alignment = do_not_align + +[*.feature] +indent_size = 2 +ij_gherkin_keep_indents_on_empty_lines = false + +[*.less] +indent_size = 2 +ij_less_align_closing_brace_with_properties = false +ij_less_blank_lines_around_nested_selector = 1 +ij_less_blank_lines_between_blocks = 1 +ij_less_brace_placement = 0 +ij_less_enforce_quotes_on_format = false +ij_less_hex_color_long_format = false +ij_less_hex_color_lower_case = false +ij_less_hex_color_short_format = false +ij_less_hex_color_upper_case = false +ij_less_keep_blank_lines_in_code = 2 +ij_less_keep_indents_on_empty_lines = false +ij_less_keep_single_line_blocks = false +ij_less_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_less_space_after_colon = true +ij_less_space_before_opening_brace = true +ij_less_use_double_quotes = true +ij_less_value_alignment = 0 + +[*.properties] +ij_properties_align_group_field_declarations = false +ij_properties_keep_blank_lines = false +ij_properties_key_value_delimiter = equals +ij_properties_spaces_around_key_value_delimiter = false + +[*.sass] +indent_size = 2 +ij_sass_align_closing_brace_with_properties = false +ij_sass_blank_lines_around_nested_selector = 1 +ij_sass_blank_lines_between_blocks = 1 +ij_sass_brace_placement = 0 +ij_sass_enforce_quotes_on_format = false +ij_sass_hex_color_long_format = false +ij_sass_hex_color_lower_case = false +ij_sass_hex_color_short_format = false +ij_sass_hex_color_upper_case = false +ij_sass_keep_blank_lines_in_code = 2 +ij_sass_keep_indents_on_empty_lines = false +ij_sass_keep_single_line_blocks = false +ij_sass_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_sass_space_after_colon = true +ij_sass_space_before_opening_brace = true +ij_sass_use_double_quotes = true +ij_sass_value_alignment = 0 + +[*.scss] +indent_size = 2 +ij_scss_align_closing_brace_with_properties = false +ij_scss_blank_lines_around_nested_selector = 1 +ij_scss_blank_lines_between_blocks = 1 +ij_scss_brace_placement = 0 +ij_scss_enforce_quotes_on_format = false +ij_scss_hex_color_long_format = false +ij_scss_hex_color_lower_case = false +ij_scss_hex_color_short_format = false +ij_scss_hex_color_upper_case = false +ij_scss_keep_blank_lines_in_code = 2 +ij_scss_keep_indents_on_empty_lines = false +ij_scss_keep_single_line_blocks = false +ij_scss_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_scss_space_after_colon = true +ij_scss_space_before_opening_brace = true +ij_scss_use_double_quotes = true +ij_scss_value_alignment = 0 + +[*.styl] +indent_size = 2 +ij_stylus_align_closing_brace_with_properties = false +ij_stylus_blank_lines_around_nested_selector = 1 +ij_stylus_blank_lines_between_blocks = 1 +ij_stylus_brace_placement = 0 +ij_stylus_enforce_quotes_on_format = false +ij_stylus_hex_color_long_format = false +ij_stylus_hex_color_lower_case = false +ij_stylus_hex_color_short_format = false +ij_stylus_hex_color_upper_case = false +ij_stylus_keep_blank_lines_in_code = 2 +ij_stylus_keep_indents_on_empty_lines = false +ij_stylus_keep_single_line_blocks = false +ij_stylus_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_stylus_space_after_colon = true +ij_stylus_space_before_opening_brace = true +ij_stylus_use_double_quotes = true +ij_stylus_value_alignment = 0 + +[*.vue] +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 4 +ij_vue_indent_children_of_top_level = template +ij_vue_interpolation_new_line_after_start_delimiter = true +ij_vue_interpolation_new_line_before_end_delimiter = true +ij_vue_interpolation_wrap = off +ij_vue_keep_indents_on_empty_lines = false +ij_vue_spaces_within_interpolation_expressions = true +ij_vue_uniform_indent = true + +[.editorconfig] +ij_editorconfig_align_group_field_declarations = false +ij_editorconfig_space_after_colon = false +ij_editorconfig_space_after_comma = true +ij_editorconfig_space_before_colon = false +ij_editorconfig_space_before_comma = false +ij_editorconfig_spaces_around_assignment_operators = true + +[{*.ant,*.appxmanifest,*.axml,*.cscfg,*.csdef,*.disco,*.filelayout,*.fxml,*.jhm,*.jnlp,*.jrxml,*.manifest,*.myapp,*.nuspec,*.rng,*.stylecop,*.svcmap,*.tld,*.tps,*.wadcfgx,*.webref,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul,StyleCop.Cache}] +ij_xml_align_attributes = true +ij_xml_align_text = false +ij_xml_attribute_wrap = normal +ij_xml_block_comment_at_first_column = true +ij_xml_keep_blank_lines = 2 +ij_xml_keep_indents_on_empty_lines = false +ij_xml_keep_line_breaks = true +ij_xml_keep_line_breaks_in_text = true +ij_xml_keep_whitespaces = false +ij_xml_keep_whitespaces_around_cdata = preserve +ij_xml_keep_whitespaces_inside_cdata = false +ij_xml_line_comment_at_first_column = true +ij_xml_space_after_tag_name = false +ij_xml_space_around_equals_in_attribute = false +ij_xml_space_inside_empty_tag = false +ij_xml_text_wrap = normal + +[{*.ats,*.ts}] +ij_continuation_indent_size = 4 +ij_typescript_align_imports = false +ij_typescript_align_multiline_array_initializer_expression = false +ij_typescript_align_multiline_binary_operation = false +ij_typescript_align_multiline_chained_methods = false +ij_typescript_align_multiline_extends_list = false +ij_typescript_align_multiline_for = true +ij_typescript_align_multiline_parameters = true +ij_typescript_align_multiline_parameters_in_calls = false +ij_typescript_align_multiline_ternary_operation = false +ij_typescript_align_object_properties = 0 +ij_typescript_align_union_types = false +ij_typescript_align_var_statements = 0 +ij_typescript_array_initializer_new_line_after_left_brace = false +ij_typescript_array_initializer_right_brace_on_new_line = false +ij_typescript_array_initializer_wrap = off +ij_typescript_assignment_wrap = off +ij_typescript_binary_operation_sign_on_next_line = false +ij_typescript_binary_operation_wrap = off +ij_typescript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/** +ij_typescript_blank_lines_after_imports = 1 +ij_typescript_blank_lines_around_class = 1 +ij_typescript_blank_lines_around_field = 0 +ij_typescript_blank_lines_around_field_in_interface = 0 +ij_typescript_blank_lines_around_function = 1 +ij_typescript_blank_lines_around_method = 1 +ij_typescript_blank_lines_around_method_in_interface = 1 +ij_typescript_block_brace_style = end_of_line +ij_typescript_call_parameters_new_line_after_left_paren = false +ij_typescript_call_parameters_right_paren_on_new_line = false +ij_typescript_call_parameters_wrap = off +ij_typescript_catch_on_new_line = false +ij_typescript_chained_call_dot_on_new_line = true +ij_typescript_class_brace_style = end_of_line +ij_typescript_comma_on_new_line = false +ij_typescript_do_while_brace_force = never +ij_typescript_else_on_new_line = false +ij_typescript_enforce_trailing_comma = keep +ij_typescript_extends_keyword_wrap = off +ij_typescript_extends_list_wrap = off +ij_typescript_field_prefix = _ +ij_typescript_file_name_style = relaxed +ij_typescript_finally_on_new_line = false +ij_typescript_for_brace_force = never +ij_typescript_for_statement_new_line_after_left_paren = false +ij_typescript_for_statement_right_paren_on_new_line = false +ij_typescript_for_statement_wrap = off +ij_typescript_force_quote_style = false +ij_typescript_force_semicolon_style = false +ij_typescript_function_expression_brace_style = end_of_line +ij_typescript_if_brace_force = never +ij_typescript_import_merge_members = global +ij_typescript_import_prefer_absolute_path = global +ij_typescript_import_sort_members = true +ij_typescript_import_sort_module_name = false +ij_typescript_import_use_node_resolution = true +ij_typescript_imports_wrap = on_every_item +ij_typescript_indent_case_from_switch = true +ij_typescript_indent_chained_calls = true +ij_typescript_indent_package_children = 0 +ij_typescript_jsdoc_include_types = false +ij_typescript_jsx_attribute_value = braces +ij_typescript_keep_blank_lines_in_code = 2 +ij_typescript_keep_first_column_comment = true +ij_typescript_keep_indents_on_empty_lines = false +ij_typescript_keep_line_breaks = true +ij_typescript_keep_simple_blocks_in_one_line = false +ij_typescript_keep_simple_methods_in_one_line = false +ij_typescript_line_comment_add_space = true +ij_typescript_line_comment_at_first_column = false +ij_typescript_method_brace_style = end_of_line +ij_typescript_method_call_chain_wrap = off +ij_typescript_method_parameters_new_line_after_left_paren = false +ij_typescript_method_parameters_right_paren_on_new_line = false +ij_typescript_method_parameters_wrap = off +ij_typescript_object_literal_wrap = on_every_item +ij_typescript_parentheses_expression_new_line_after_left_paren = false +ij_typescript_parentheses_expression_right_paren_on_new_line = false +ij_typescript_place_assignment_sign_on_next_line = false +ij_typescript_prefer_as_type_cast = false +ij_typescript_prefer_explicit_types_function_expression_returns = false +ij_typescript_prefer_explicit_types_function_returns = false +ij_typescript_prefer_explicit_types_vars_fields = false +ij_typescript_prefer_parameters_wrap = false +ij_typescript_reformat_c_style_comments = false +ij_typescript_space_after_colon = true +ij_typescript_space_after_comma = true +ij_typescript_space_after_dots_in_rest_parameter = false +ij_typescript_space_after_generator_mult = true +ij_typescript_space_after_property_colon = true +ij_typescript_space_after_quest = true +ij_typescript_space_after_type_colon = true +ij_typescript_space_after_unary_not = false +ij_typescript_space_before_async_arrow_lparen = true +ij_typescript_space_before_catch_keyword = true +ij_typescript_space_before_catch_left_brace = true +ij_typescript_space_before_catch_parentheses = true +ij_typescript_space_before_class_lbrace = true +ij_typescript_space_before_class_left_brace = true +ij_typescript_space_before_colon = true +ij_typescript_space_before_comma = false +ij_typescript_space_before_do_left_brace = true +ij_typescript_space_before_else_keyword = true +ij_typescript_space_before_else_left_brace = true +ij_typescript_space_before_finally_keyword = true +ij_typescript_space_before_finally_left_brace = true +ij_typescript_space_before_for_left_brace = true +ij_typescript_space_before_for_parentheses = true +ij_typescript_space_before_for_semicolon = false +ij_typescript_space_before_function_left_parenth = true +ij_typescript_space_before_generator_mult = false +ij_typescript_space_before_if_left_brace = true +ij_typescript_space_before_if_parentheses = true +ij_typescript_space_before_method_call_parentheses = false +ij_typescript_space_before_method_left_brace = true +ij_typescript_space_before_method_parentheses = false +ij_typescript_space_before_property_colon = false +ij_typescript_space_before_quest = true +ij_typescript_space_before_switch_left_brace = true +ij_typescript_space_before_switch_parentheses = true +ij_typescript_space_before_try_left_brace = true +ij_typescript_space_before_type_colon = false +ij_typescript_space_before_unary_not = false +ij_typescript_space_before_while_keyword = true +ij_typescript_space_before_while_left_brace = true +ij_typescript_space_before_while_parentheses = true +ij_typescript_spaces_around_additive_operators = true +ij_typescript_spaces_around_arrow_function_operator = true +ij_typescript_spaces_around_assignment_operators = true +ij_typescript_spaces_around_bitwise_operators = true +ij_typescript_spaces_around_equality_operators = true +ij_typescript_spaces_around_logical_operators = true +ij_typescript_spaces_around_multiplicative_operators = true +ij_typescript_spaces_around_relational_operators = true +ij_typescript_spaces_around_shift_operators = true +ij_typescript_spaces_around_unary_operator = false +ij_typescript_spaces_within_array_initializer_brackets = false +ij_typescript_spaces_within_brackets = false +ij_typescript_spaces_within_catch_parentheses = false +ij_typescript_spaces_within_for_parentheses = false +ij_typescript_spaces_within_if_parentheses = false +ij_typescript_spaces_within_imports = false +ij_typescript_spaces_within_interpolation_expressions = false +ij_typescript_spaces_within_method_call_parentheses = false +ij_typescript_spaces_within_method_parentheses = false +ij_typescript_spaces_within_object_literal_braces = false +ij_typescript_spaces_within_object_type_braces = true +ij_typescript_spaces_within_parentheses = false +ij_typescript_spaces_within_switch_parentheses = false +ij_typescript_spaces_within_type_assertion = false +ij_typescript_spaces_within_union_types = true +ij_typescript_spaces_within_while_parentheses = false +ij_typescript_special_else_if_treatment = true +ij_typescript_ternary_operation_signs_on_next_line = false +ij_typescript_ternary_operation_wrap = off +ij_typescript_union_types_wrap = on_every_item +ij_typescript_use_chained_calls_group_indents = false +ij_typescript_use_double_quotes = true +ij_typescript_use_explicit_js_extension = global +ij_typescript_use_path_mapping = always +ij_typescript_use_public_modifier = false +ij_typescript_use_semicolon_after_statement = true +ij_typescript_var_declaration_wrap = normal +ij_typescript_while_brace_force = never +ij_typescript_while_on_new_line = false +ij_typescript_wrap_comments = false + +[{*.cjs,*.js}] +ij_continuation_indent_size = 4 +ij_javascript_align_imports = false +ij_javascript_align_multiline_array_initializer_expression = false +ij_javascript_align_multiline_binary_operation = false +ij_javascript_align_multiline_chained_methods = false +ij_javascript_align_multiline_extends_list = false +ij_javascript_align_multiline_for = true +ij_javascript_align_multiline_parameters = true +ij_javascript_align_multiline_parameters_in_calls = false +ij_javascript_align_multiline_ternary_operation = false +ij_javascript_align_object_properties = 0 +ij_javascript_align_union_types = false +ij_javascript_align_var_statements = 0 +ij_javascript_array_initializer_new_line_after_left_brace = false +ij_javascript_array_initializer_right_brace_on_new_line = false +ij_javascript_array_initializer_wrap = off +ij_javascript_assignment_wrap = off +ij_javascript_binary_operation_sign_on_next_line = false +ij_javascript_binary_operation_wrap = off +ij_javascript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/** +ij_javascript_blank_lines_after_imports = 1 +ij_javascript_blank_lines_around_class = 1 +ij_javascript_blank_lines_around_field = 0 +ij_javascript_blank_lines_around_function = 1 +ij_javascript_blank_lines_around_method = 1 +ij_javascript_block_brace_style = end_of_line +ij_javascript_call_parameters_new_line_after_left_paren = false +ij_javascript_call_parameters_right_paren_on_new_line = false +ij_javascript_call_parameters_wrap = off +ij_javascript_catch_on_new_line = false +ij_javascript_chained_call_dot_on_new_line = true +ij_javascript_class_brace_style = end_of_line +ij_javascript_comma_on_new_line = false +ij_javascript_do_while_brace_force = never +ij_javascript_else_on_new_line = false +ij_javascript_enforce_trailing_comma = keep +ij_javascript_extends_keyword_wrap = off +ij_javascript_extends_list_wrap = off +ij_javascript_field_prefix = _ +ij_javascript_file_name_style = relaxed +ij_javascript_finally_on_new_line = false +ij_javascript_for_brace_force = never +ij_javascript_for_statement_new_line_after_left_paren = false +ij_javascript_for_statement_right_paren_on_new_line = false +ij_javascript_for_statement_wrap = off +ij_javascript_force_quote_style = false +ij_javascript_force_semicolon_style = false +ij_javascript_function_expression_brace_style = end_of_line +ij_javascript_if_brace_force = never +ij_javascript_import_merge_members = global +ij_javascript_import_prefer_absolute_path = global +ij_javascript_import_sort_members = true +ij_javascript_import_sort_module_name = false +ij_javascript_import_use_node_resolution = true +ij_javascript_imports_wrap = on_every_item +ij_javascript_indent_case_from_switch = true +ij_javascript_indent_chained_calls = true +ij_javascript_indent_package_children = 0 +ij_javascript_jsx_attribute_value = braces +ij_javascript_keep_blank_lines_in_code = 2 +ij_javascript_keep_first_column_comment = true +ij_javascript_keep_indents_on_empty_lines = false +ij_javascript_keep_line_breaks = true +ij_javascript_keep_simple_blocks_in_one_line = false +ij_javascript_keep_simple_methods_in_one_line = false +ij_javascript_line_comment_add_space = true +ij_javascript_line_comment_at_first_column = false +ij_javascript_method_brace_style = end_of_line +ij_javascript_method_call_chain_wrap = off +ij_javascript_method_parameters_new_line_after_left_paren = false +ij_javascript_method_parameters_right_paren_on_new_line = false +ij_javascript_method_parameters_wrap = off +ij_javascript_object_literal_wrap = on_every_item +ij_javascript_parentheses_expression_new_line_after_left_paren = false +ij_javascript_parentheses_expression_right_paren_on_new_line = false +ij_javascript_place_assignment_sign_on_next_line = false +ij_javascript_prefer_as_type_cast = false +ij_javascript_prefer_explicit_types_function_expression_returns = false +ij_javascript_prefer_explicit_types_function_returns = false +ij_javascript_prefer_explicit_types_vars_fields = false +ij_javascript_prefer_parameters_wrap = false +ij_javascript_reformat_c_style_comments = false +ij_javascript_space_after_colon = true +ij_javascript_space_after_comma = true +ij_javascript_space_after_dots_in_rest_parameter = false +ij_javascript_space_after_generator_mult = true +ij_javascript_space_after_property_colon = true +ij_javascript_space_after_quest = true +ij_javascript_space_after_type_colon = true +ij_javascript_space_after_unary_not = false +ij_javascript_space_before_async_arrow_lparen = true +ij_javascript_space_before_catch_keyword = true +ij_javascript_space_before_catch_left_brace = true +ij_javascript_space_before_catch_parentheses = true +ij_javascript_space_before_class_lbrace = true +ij_javascript_space_before_class_left_brace = true +ij_javascript_space_before_colon = true +ij_javascript_space_before_comma = false +ij_javascript_space_before_do_left_brace = true +ij_javascript_space_before_else_keyword = true +ij_javascript_space_before_else_left_brace = true +ij_javascript_space_before_finally_keyword = true +ij_javascript_space_before_finally_left_brace = true +ij_javascript_space_before_for_left_brace = true +ij_javascript_space_before_for_parentheses = true +ij_javascript_space_before_for_semicolon = false +ij_javascript_space_before_function_left_parenth = true +ij_javascript_space_before_generator_mult = false +ij_javascript_space_before_if_left_brace = true +ij_javascript_space_before_if_parentheses = true +ij_javascript_space_before_method_call_parentheses = false +ij_javascript_space_before_method_left_brace = true +ij_javascript_space_before_method_parentheses = false +ij_javascript_space_before_property_colon = false +ij_javascript_space_before_quest = true +ij_javascript_space_before_switch_left_brace = true +ij_javascript_space_before_switch_parentheses = true +ij_javascript_space_before_try_left_brace = true +ij_javascript_space_before_type_colon = false +ij_javascript_space_before_unary_not = false +ij_javascript_space_before_while_keyword = true +ij_javascript_space_before_while_left_brace = true +ij_javascript_space_before_while_parentheses = true +ij_javascript_spaces_around_additive_operators = true +ij_javascript_spaces_around_arrow_function_operator = true +ij_javascript_spaces_around_assignment_operators = true +ij_javascript_spaces_around_bitwise_operators = true +ij_javascript_spaces_around_equality_operators = true +ij_javascript_spaces_around_logical_operators = true +ij_javascript_spaces_around_multiplicative_operators = true +ij_javascript_spaces_around_relational_operators = true +ij_javascript_spaces_around_shift_operators = true +ij_javascript_spaces_around_unary_operator = false +ij_javascript_spaces_within_array_initializer_brackets = false +ij_javascript_spaces_within_brackets = false +ij_javascript_spaces_within_catch_parentheses = false +ij_javascript_spaces_within_for_parentheses = false +ij_javascript_spaces_within_if_parentheses = false +ij_javascript_spaces_within_imports = false +ij_javascript_spaces_within_interpolation_expressions = false +ij_javascript_spaces_within_method_call_parentheses = false +ij_javascript_spaces_within_method_parentheses = false +ij_javascript_spaces_within_object_literal_braces = false +ij_javascript_spaces_within_object_type_braces = true +ij_javascript_spaces_within_parentheses = false +ij_javascript_spaces_within_switch_parentheses = false +ij_javascript_spaces_within_type_assertion = false +ij_javascript_spaces_within_union_types = true +ij_javascript_spaces_within_while_parentheses = false +ij_javascript_special_else_if_treatment = true +ij_javascript_ternary_operation_signs_on_next_line = false +ij_javascript_ternary_operation_wrap = off +ij_javascript_union_types_wrap = on_every_item +ij_javascript_use_chained_calls_group_indents = false +ij_javascript_use_double_quotes = true +ij_javascript_use_explicit_js_extension = global +ij_javascript_use_path_mapping = always +ij_javascript_use_public_modifier = false +ij_javascript_use_semicolon_after_statement = true +ij_javascript_var_declaration_wrap = normal +ij_javascript_while_brace_force = never +ij_javascript_while_on_new_line = false +ij_javascript_wrap_comments = false + +[{*.cjsx,*.coffee}] +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 2 +ij_coffeescript_align_function_body = false +ij_coffeescript_align_imports = false +ij_coffeescript_align_multiline_array_initializer_expression = true +ij_coffeescript_align_multiline_parameters = true +ij_coffeescript_align_multiline_parameters_in_calls = false +ij_coffeescript_align_object_properties = 0 +ij_coffeescript_align_union_types = false +ij_coffeescript_align_var_statements = 0 +ij_coffeescript_array_initializer_new_line_after_left_brace = false +ij_coffeescript_array_initializer_right_brace_on_new_line = false +ij_coffeescript_array_initializer_wrap = normal +ij_coffeescript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/** +ij_coffeescript_blank_lines_around_function = 1 +ij_coffeescript_call_parameters_new_line_after_left_paren = false +ij_coffeescript_call_parameters_right_paren_on_new_line = false +ij_coffeescript_call_parameters_wrap = normal +ij_coffeescript_chained_call_dot_on_new_line = true +ij_coffeescript_comma_on_new_line = false +ij_coffeescript_enforce_trailing_comma = keep +ij_coffeescript_field_prefix = _ +ij_coffeescript_file_name_style = relaxed +ij_coffeescript_force_quote_style = false +ij_coffeescript_force_semicolon_style = false +ij_coffeescript_function_expression_brace_style = end_of_line +ij_coffeescript_import_merge_members = global +ij_coffeescript_import_prefer_absolute_path = global +ij_coffeescript_import_sort_members = true +ij_coffeescript_import_sort_module_name = false +ij_coffeescript_import_use_node_resolution = true +ij_coffeescript_imports_wrap = on_every_item +ij_coffeescript_indent_chained_calls = true +ij_coffeescript_indent_package_children = 0 +ij_coffeescript_jsx_attribute_value = braces +ij_coffeescript_keep_blank_lines_in_code = 2 +ij_coffeescript_keep_first_column_comment = true +ij_coffeescript_keep_indents_on_empty_lines = false +ij_coffeescript_keep_line_breaks = true +ij_coffeescript_keep_simple_methods_in_one_line = false +ij_coffeescript_method_parameters_new_line_after_left_paren = false +ij_coffeescript_method_parameters_right_paren_on_new_line = false +ij_coffeescript_method_parameters_wrap = off +ij_coffeescript_object_literal_wrap = on_every_item +ij_coffeescript_prefer_as_type_cast = false +ij_coffeescript_prefer_explicit_types_function_expression_returns = false +ij_coffeescript_prefer_explicit_types_function_returns = false +ij_coffeescript_prefer_explicit_types_vars_fields = false +ij_coffeescript_reformat_c_style_comments = false +ij_coffeescript_space_after_comma = true +ij_coffeescript_space_after_dots_in_rest_parameter = false +ij_coffeescript_space_after_generator_mult = true +ij_coffeescript_space_after_property_colon = true +ij_coffeescript_space_after_type_colon = true +ij_coffeescript_space_after_unary_not = false +ij_coffeescript_space_before_async_arrow_lparen = true +ij_coffeescript_space_before_class_lbrace = true +ij_coffeescript_space_before_comma = false +ij_coffeescript_space_before_function_left_parenth = true +ij_coffeescript_space_before_generator_mult = false +ij_coffeescript_space_before_property_colon = false +ij_coffeescript_space_before_type_colon = false +ij_coffeescript_space_before_unary_not = false +ij_coffeescript_spaces_around_additive_operators = true +ij_coffeescript_spaces_around_arrow_function_operator = true +ij_coffeescript_spaces_around_assignment_operators = true +ij_coffeescript_spaces_around_bitwise_operators = true +ij_coffeescript_spaces_around_equality_operators = true +ij_coffeescript_spaces_around_logical_operators = true +ij_coffeescript_spaces_around_multiplicative_operators = true +ij_coffeescript_spaces_around_relational_operators = true +ij_coffeescript_spaces_around_shift_operators = true +ij_coffeescript_spaces_around_unary_operator = false +ij_coffeescript_spaces_within_array_initializer_braces = false +ij_coffeescript_spaces_within_array_initializer_brackets = false +ij_coffeescript_spaces_within_imports = false +ij_coffeescript_spaces_within_index_brackets = false +ij_coffeescript_spaces_within_interpolation_expressions = false +ij_coffeescript_spaces_within_method_call_parentheses = false +ij_coffeescript_spaces_within_method_parentheses = false +ij_coffeescript_spaces_within_object_braces = false +ij_coffeescript_spaces_within_object_literal_braces = false +ij_coffeescript_spaces_within_object_type_braces = true +ij_coffeescript_spaces_within_range_brackets = false +ij_coffeescript_spaces_within_type_assertion = false +ij_coffeescript_spaces_within_union_types = true +ij_coffeescript_union_types_wrap = on_every_item +ij_coffeescript_use_chained_calls_group_indents = false +ij_coffeescript_use_double_quotes = true +ij_coffeescript_use_explicit_js_extension = global +ij_coffeescript_use_path_mapping = always +ij_coffeescript_use_public_modifier = false +ij_coffeescript_use_semicolon_after_statement = false +ij_coffeescript_var_declaration_wrap = normal + +[{*.har,*.inputactions,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}] +indent_size = 2 +ij_json_keep_blank_lines_in_code = 0 +ij_json_keep_indents_on_empty_lines = false +ij_json_keep_line_breaks = true +ij_json_space_after_colon = true +ij_json_space_after_comma = true +ij_json_space_before_colon = true +ij_json_space_before_comma = false +ij_json_spaces_within_braces = false +ij_json_spaces_within_brackets = false +ij_json_wrap_long_lines = false +indent_style = space + +[{*.htm,*.html,*.ng,*.sht,*.shtm,*.shtml}] +ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3 +ij_html_align_attributes = true +ij_html_align_text = false +ij_html_attribute_wrap = normal +ij_html_block_comment_at_first_column = true +ij_html_do_not_align_children_of_min_lines = 0 +ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p +ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot +ij_html_enforce_quotes = false +ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var +ij_html_keep_blank_lines = 2 +ij_html_keep_indents_on_empty_lines = false +ij_html_keep_line_breaks = true +ij_html_keep_line_breaks_in_text = true +ij_html_keep_whitespaces = false +ij_html_keep_whitespaces_inside = span,pre,textarea +ij_html_line_comment_at_first_column = true +ij_html_new_line_after_last_attribute = never +ij_html_new_line_before_first_attribute = never +ij_html_quote_style = double +ij_html_remove_new_line_before_tags = br +ij_html_space_after_tag_name = false +ij_html_space_around_equality_in_attribute = false +ij_html_space_inside_empty_tag = false +ij_html_text_wrap = normal +ij_html_uniform_ident = false + +[{*.markdown,*.md}] +ij_markdown_force_one_space_after_blockquote_symbol = true +ij_markdown_force_one_space_after_header_symbol = true +ij_markdown_force_one_space_after_list_bullet = true +ij_markdown_force_one_space_between_words = true +ij_markdown_keep_indents_on_empty_lines = false +ij_markdown_max_lines_around_block_elements = 1 +ij_markdown_max_lines_around_header = 1 +ij_markdown_max_lines_between_paragraphs = 1 +ij_markdown_min_lines_around_block_elements = 1 +ij_markdown_min_lines_around_header = 1 +ij_markdown_min_lines_between_paragraphs = 1 + +[{*.toml,Cargo.lock,Gopkg.lock,Pipfile}] +ij_toml_keep_indents_on_empty_lines = false + +[{*.yaml,*.yml}] +indent_size = 2 +ij_yaml_align_values_properties = do_not_align +ij_yaml_autoinsert_sequence_marker = true +ij_yaml_block_mapping_on_new_line = false +ij_yaml_indent_sequence_value = true +ij_yaml_keep_indents_on_empty_lines = false +ij_yaml_keep_line_breaks = true +ij_yaml_sequence_on_new_line = false +ij_yaml_space_before_colon = false +ij_yaml_spaces_within_braces = true +ij_yaml_spaces_within_brackets = true +indent_style = space + +[*.{appxmanifest,asax,ascx,aspx,axaml,build,cg,cginc,compute,cs,cshtml,dtd,fs,fsi,fsscript,fsx,hlsl,hlsli,hlslinc,master,ml,mli,nuspec,paml,razor,resw,resx,shader,skin,usf,ush,vb,xaml,xamlx,xoml,xsd}] +indent_style = space +indent_size = 4 +tab_width = 4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e1a8f46 --- /dev/null +++ b/.gitignore @@ -0,0 +1,390 @@ +## 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 +*.tlog +*.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 + +# Nuget personal access tokens and Credentials +nuget.config + +# 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 + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +.idea/ +*.sln.iml + +GameBinaries diff --git a/Edit-and-run-before-opening-solution.bat b/Edit-and-run-before-opening-solution.bat new file mode 100644 index 0000000..7428111 --- /dev/null +++ b/Edit-and-run-before-opening-solution.bat @@ -0,0 +1,10 @@ +@echo off + +REM Location of your SpaceEngineers.exe +mklink /J GameBinaries "C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Bin64" + +REM Content folder linked to the Web developer's project or local build folder +mkdir GameBinaries\Plugins\Local\EnhancedUI 2>NUL +mklink /J GameBinaries\Plugins\Local\EnhancedUI\Content EnhancedUI\Content + +pause \ No newline at end of file diff --git a/EnhancedUI.sln b/EnhancedUI.sln new file mode 100644 index 0000000..0fa4f32 --- /dev/null +++ b/EnhancedUI.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnhancedUI", "EnhancedUI\EnhancedUI.csproj", "{0315930C-BB29-4303-8C62-65782E886CAA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0315930C-BB29-4303-8C62-65782E886CAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0315930C-BB29-4303-8C62-65782E886CAA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0315930C-BB29-4303-8C62-65782E886CAA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0315930C-BB29-4303-8C62-65782E886CAA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/EnhancedUI/BatchDataPlayer.cs b/EnhancedUI/BatchDataPlayer.cs new file mode 100644 index 0000000..43168c5 --- /dev/null +++ b/EnhancedUI/BatchDataPlayer.cs @@ -0,0 +1,115 @@ +using System; +using System.Drawing; +using System.Drawing.Imaging; +using System.IO; +using HarmonyLib; +using SharpDX; +using SharpDX.Direct3D; +using SharpDX.Direct3D11; +using SharpDX.DXGI; +using VRage; +using VRageMath; +using Device = SharpDX.Direct3D11.Device; +using MapFlags = SharpDX.Direct3D11.MapFlags; + +namespace EnhancedUI +{ + public class BatchDataPlayer : IVideoPlayer + { + private static readonly Func _deviceInstance = + AccessTools.MethodDelegate>(AccessTools.PropertyGetter( + Type.GetType("VRage.Platform.Windows.Render.MyPlatformRender, VRage.Platform.Windows", true), + "DeviceInstance")); + + private readonly Vector2I _size; + private readonly Func _dataGetter; + private Texture2D _texture; + private ShaderResourceView _srv; +#pragma warning disable 8618 + public BatchDataPlayer(Vector2I size, Func dataGetter) +#pragma warning restore 8618 + { + _size = size; + _dataGetter = dataGetter; + } + + public void Init(string filename) + { + var texture2DDescription = new Texture2DDescription + { + Width = VideoWidth, + Height = VideoHeight, + Format = Format.B8G8R8A8_UNorm_SRgb, + ArraySize = 1, + MipLevels = 1, + BindFlags = BindFlags.ShaderResource, + Usage = ResourceUsage.Dynamic, + CpuAccessFlags = CpuAccessFlags.Write, + SampleDescription = + { + Count = 1, + Quality = 0 + }, + OptionFlags = ResourceOptionFlags.None, + }; + _texture = new(_deviceInstance(), texture2DDescription); + var shaderResourceViewDescription = new ShaderResourceViewDescription + { + Format = Format.B8G8R8A8_UNorm_SRgb, + Dimension = ShaderResourceViewDimension.Texture2D, + Texture2D = + { + MipLevels = 1, + MostDetailedMip = 0 + } + }; + _srv = new(_deviceInstance(), _texture, shaderResourceViewDescription); + _texture.DebugName = _srv.DebugName = "BatchDataPlayer.Texture"; + } + + public void Dispose() + { + Stop(); + _srv.Dispose(); + _texture.Dispose(); + } + + public void Play() + { + CurrentState = VideoState.Playing; + } + + public void Stop() + { + CurrentState = VideoState.Stopped; + } + + public void Update(object context) + { + if (CurrentState == VideoState.Playing && _dataGetter() is { } data) + OnFrame((DeviceContext)context, data); + } + + private void OnFrame(DeviceContext context, byte[] data) + { + var dataBox = context.MapSubresource(_texture, 0, MapMode.WriteDiscard, MapFlags.None); + + if (dataBox.IsEmpty) + return; + + Utilities.Write(dataBox.DataPointer, data, 0, data.Length); + + context.UnmapSubresource(_texture, 0); + } + + public int VideoWidth => _size.X; + + public int VideoHeight => _size.Y; + + public float Volume { get; set; } + + public VideoState CurrentState { get; private set; } + + public IntPtr TextureSrv => _srv.NativePointer; + } +} \ No newline at end of file diff --git a/EnhancedUI/BrowserHost.cs b/EnhancedUI/BrowserHost.cs new file mode 100644 index 0000000..6be05d6 --- /dev/null +++ b/EnhancedUI/BrowserHost.cs @@ -0,0 +1,82 @@ +using System; +using System.Runtime.InteropServices; +using CefSharp; +using CefSharp.OffScreen; +using VRageMath; +using VRageRender; + +namespace EnhancedUI +{ + public class BrowserHost : IDisposable + { + public byte[] VideoData { get; private set; } + + public event Action? Ready; + + public readonly ChromiumWebBrowser Browser; + public BrowserHost(Vector2I size) + { + VideoData = new byte[size.X * size.Y * 4]; + Browser = new () + { + Size = new (size.X, size.Y) + }; + Browser.Paint += BrowserOnPaint; + Browser.BrowserInitialized += BrowserOnBrowserInitialized; + Browser.LifeSpanHandler = new LifespanHandler(); + } + + public byte[] GetVideoData() + { + return VideoData; + } + + private void BrowserOnBrowserInitialized(object sender, EventArgs e) + { + Ready.InvokeIfNotNull(); + } + + public void Navigate(string url) + { + Browser.Load(url); + } + + public void Draw() + { + if (Browser.IsBrowserInitialized) + Browser.GetBrowserHost().Invalidate(PaintElementType.View); + } + + private void BrowserOnPaint(object sender, OnPaintEventArgs e) + { + var videoData = VideoData; + Marshal.Copy(e.BufferHandle, videoData, 0, e.Width * e.Height * 4); + VideoData = videoData; + + e.Handled = true; + } + + public void Dispose() + { + Browser.Paint -= BrowserOnPaint; + Browser.BrowserInitialized -= BrowserOnBrowserInitialized; + Browser.Dispose(); + } + + private class LifespanHandler : ILifeSpanHandler + { + bool ILifeSpanHandler.OnBeforePopup(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, string targetFrameName, WindowOpenDisposition targetDisposition, bool userGesture, IPopupFeatures popupFeatures, IWindowInfo windowInfo, IBrowserSettings browserSettings, ref bool noJavascriptAccess, out IWebBrowser newBrowser) + { + newBrowser = null!; + return true; + } + + bool ILifeSpanHandler.DoClose(IWebBrowser browserControl, IBrowser browser) + { return false; } + + void ILifeSpanHandler.OnBeforeClose(IWebBrowser browserControl, IBrowser browser) { } + + void ILifeSpanHandler.OnAfterCreated(IWebBrowser browserControl, IBrowser browser) { } + } + } +} \ No newline at end of file diff --git a/EnhancedUI/Content/Terminal.html b/EnhancedUI/Content/Terminal.html new file mode 100644 index 0000000..a1a9a72 --- /dev/null +++ b/EnhancedUI/Content/Terminal.html @@ -0,0 +1,95 @@ + + + + + Terminal + + + + +

TERMINAL

+ +

+ +

+ +

+ +

+ +

+ Google +

+ +
    +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
  • X
  • +
+ +

END

+ + + \ No newline at end of file diff --git a/EnhancedUI/Content/common.css b/EnhancedUI/Content/common.css new file mode 100644 index 0000000..d66a383 --- /dev/null +++ b/EnhancedUI/Content/common.css @@ -0,0 +1,9 @@ +body { + background: transparent; + font-size: xx-large; +} + +h1 { + color: yellow; + font-size: 48px; +} \ No newline at end of file diff --git a/EnhancedUI/EnhancedUI.csproj b/EnhancedUI/EnhancedUI.csproj new file mode 100644 index 0000000..9e09a74 --- /dev/null +++ b/EnhancedUI/EnhancedUI.csproj @@ -0,0 +1,131 @@ + + + net48 + default + enable + bin\ + x64 + + + full + + + pdbonly + + + + + $(SolutionDir)GameBinaries\EmptyKeys.UserInterface.dll + False + + + False + $(SolutionDir)GameBinaries\Sandbox.Common.dll + False + + + False + $(SolutionDir)GameBinaries\Sandbox.Game.dll + False + + + False + $(SolutionDir)GameBinaries\Sandbox.Graphics.dll + False + + + False + $(SolutionDir)GameBinaries\SharpDX.dll + False + + + False + $(SolutionDir)GameBinaries\SharpDX.Direct3D11.dll + False + + + $(SolutionDir)GameBinaries\SharpDX.DXGI.dll + False + + + False + $(SolutionDir)GameBinaries\SpaceEngineers.Game.dll + False + + + False + $(SolutionDir)GameBinaries\SpaceEngineers.ObjectBuilders.dll + False + + + + False + $(SolutionDir)GameBinaries\VRage.dll + False + + + False + $(SolutionDir)GameBinaries\VRage.Audio.dll + False + + + False + $(SolutionDir)GameBinaries\VRage.Game.dll + False + + + False + $(SolutionDir)GameBinaries\VRage.Game.XmlSerializers.dll + False + + + False + $(SolutionDir)GameBinaries\VRage.Input.dll + False + + + False + $(SolutionDir)GameBinaries\VRage.Library.dll + False + + + False + $(SolutionDir)GameBinaries\VRage.Math.dll + False + + + $(SolutionDir)GameBinaries\VRage.Platform.Windows.dll + False + + + False + $(SolutionDir)GameBinaries\VRage.Render.dll + False + + + False + $(SolutionDir)GameBinaries\VRage.Render11.dll + False + + + False + $(SolutionDir)GameBinaries\VRage.Scripting.dll + False + + + $(SolutionDir)GameBinaries\VRage.Steam.dll + False + + + + + + + + + + + + + + \ No newline at end of file diff --git a/EnhancedUI/Gui/ChromiumGuiControl.cs b/EnhancedUI/Gui/ChromiumGuiControl.cs new file mode 100644 index 0000000..b11a7d3 --- /dev/null +++ b/EnhancedUI/Gui/ChromiumGuiControl.cs @@ -0,0 +1,258 @@ +using System; +using System.IO; +using System.Collections.Generic; +using System.Linq; +using CefSharp; +using Sandbox.Graphics; +using Sandbox.Graphics.GUI; +using VRage.Collections; +using VRage.Input; +using VRageMath; +using VRageRender; +using VRageRender.Messages; +using Rectangle = VRageMath.Rectangle; + +namespace EnhancedUI.Gui +{ + public class ChromiumGuiControl : MyGuiControlBase + { + private readonly BrowserHost _browserHost; + public static BatchDataPlayer? Player; + + private uint _videoId; + + //Returns false if the browser is not initialized else it returns true. + public bool IsBrowserInitialized => _browserHost.Browser.IsBrowserInitialized; + + public readonly MyGuiControlRotatingWheel Wheel = new(Vector2.Zero) + { + Visible = false + }; + + private readonly WebContent _content; + private readonly string _name; + + private bool _capsLock; + private MyKeys _lastKey; + private int _delay; + + public ChromiumGuiControl(WebContent content, string name) + { + _content = content; + _name = name; + + var rect = GetVideoScreenRectangle(); + _browserHost = new(new(rect.Width, rect.Height)); + + _browserHost.Ready += BrowserHostOnReady; + _browserHost.Browser.LoadingStateChanged += BrowserOnLoadingStateChanged; + + Player = new(new(rect.Width, rect.Height), _browserHost.GetVideoData); + } + + private void BrowserOnLoadingStateChanged(object sender, LoadingStateChangedEventArgs e) + { + Wheel.Visible = e.IsLoading; + } + + private void BrowserHostOnReady() + { + var url = _content.FormatIndexUrl(_name); + _browserHost.Navigate(url); + _videoId = MyRenderProxy.PlayVideo(VideoPlayPatch.VIDEO_NAME, 0); + } + + // Removes the browser instance when ChromiumGuiControl is no longer needed. + public override void OnRemoving() + { + base.OnRemoving(); + + _browserHost.Ready -= BrowserHostOnReady; + _browserHost.Browser.LoadingStateChanged -= BrowserOnLoadingStateChanged; + + _browserHost.Dispose(); + MyRenderProxy.CloseVideo(_videoId); + } + + // Returns the on-screen rectangle of the video player (browser) in pixels + private Rectangle GetVideoScreenRectangle() + { + var pos = (Vector2I)MyGuiManager.GetScreenCoordinateFromNormalizedCoordinate(GetPositionAbsoluteTopLeft()); + + var size = (Vector2I)MyGuiManager.GetScreenSizeFromNormalizedSize(Size); + + return new(pos.X, pos.Y, size.X, size.Y); + } + + // Renders the HTML document on the screen using the video player + public override void Draw(float transitionAlpha, float backgroundTransitionAlpha) + { + if (!MyRenderProxy.IsVideoValid(_videoId)) + return; + + _browserHost.Draw(); + MyRenderProxy.UpdateVideo(_videoId); + MyRenderProxy.DrawVideo(_videoId, GetVideoScreenRectangle(), new(Vector4.One), + MyVideoRectangleFitMode.AutoFit, false); + } + + // Reloads the HTML document + public void ReloadPage() + { + _browserHost.Browser.Reload(); + } + + // Clears the cookies from the CEF browser + public void ClearCookies() + { + Cef.GetGlobalCookieManager().DeleteCookies("", ""); + } + + public override MyGuiControlBase HandleInput() + { + if (!IsBrowserInitialized) + return null!; + + var input = MyInput.Static; + + if (input.IsAnyCtrlKeyPressed() && input.IsNewKeyPressed(MyKeys.R)) + { + ReloadPage(); + if (MyInput.Static.IsAnyShiftKeyPressed()) + ClearCookies(); + + return base.HandleInput(); + } + + var browser = _browserHost.Browser; + var browserHost = browser.GetBrowser().GetHost(); + + if (input.IsKeyPress(MyKeys.CapsLock)) + _capsLock = !_capsLock; + + var modifiers = GetModifiers(); + + var pressedKeys = new List(); + input.GetPressedKeys(pressedKeys); + + if (pressedKeys.Count == 0) + { + _lastKey = MyKeys.None; + } + + foreach (var key in pressedKeys) + { + if (key == MyKeys.Escape) + continue; + + if (key == _lastKey) + { + if (_delay > 0) + { + _delay--; + continue; + } + _delay = 5; + } + else + { + _lastKey = key; + _delay = 20; + } + + var keyChar = (char)key; + + browserHost.SendKeyEvent(new() + { + WindowsKeyCode = keyChar, // Space + FocusOnEditableField = true, + IsSystemKey = false, + Type = KeyEventType.KeyDown, + Modifiers = modifiers + }); + + browserHost.SendKeyEvent(new() + { + WindowsKeyCode = keyChar, // Space + FocusOnEditableField = true, + IsSystemKey = false, + Type = KeyEventType.Char, + Modifiers = modifiers + }); + + browserHost.SendKeyEvent(new() + { + WindowsKeyCode = keyChar, // Space + FocusOnEditableField = true, + IsSystemKey = false, + Type = KeyEventType.KeyUp, + Modifiers = modifiers + }); + } + + var mousePosition = input.GetMousePosition(); + var hasValidMousePosition = mousePosition.X >= 0 && mousePosition.Y >= 0; + + if (!hasValidMousePosition) + return base.HandleInput(); + + // Correct for left-top corner (position) + var vr = GetVideoScreenRectangle(); + mousePosition.X -= vr.Left; + mousePosition.Y -= vr.Top; + + // Correct for aspect ratio and scale (if any) + mousePosition /= Rectangle.Size; + + var intMousePosition = new Vector2I(mousePosition + new Vector2(0.5f, 0.5f)); + + var wheelDelta = MyInput.Static.DeltaMouseScrollWheelValue(); + + if (wheelDelta != 0) + { + browser.SendMouseWheelEvent(intMousePosition.X, intMousePosition.Y, 0, wheelDelta, modifiers); + } + else + { + browserHost.SendMouseMoveEvent(intMousePosition.X, intMousePosition.Y, false, modifiers); + } + + if (input.IsLeftMousePressed()) + { + browserHost.SendMouseClickEvent(intMousePosition.X, intMousePosition.Y, MouseButtonType.Left, false, + 1, modifiers); + } + + if (input.IsMiddleMousePressed()) + { + browserHost.SendMouseClickEvent(intMousePosition.X, intMousePosition.Y, MouseButtonType.Middle, + false, + 1, modifiers); + } + + if (input.IsRightMousePressed()) + { + browserHost.SendMouseClickEvent(intMousePosition.X, intMousePosition.Y, MouseButtonType.Right, + false, + 1, modifiers); + } + + // TODO: Double-click, drag&drop, context menu + + return base.HandleInput(); + } + + private CefEventFlags GetModifiers() + { + var input = MyInput.Static; + return ( + (_capsLock ? CefEventFlags.CapsLockOn : 0) | + (input.IsAnyShiftKeyPressed() ? CefEventFlags.ShiftDown : 0) | + (input.IsAnyCtrlKeyPressed() ? CefEventFlags.ControlDown : 0) | + (input.IsAnyAltKeyPressed() ? CefEventFlags.AltDown : 0) | + (input.IsLeftMousePressed() ? CefEventFlags.LeftMouseButton : 0) | + (input.IsMiddleMousePressed() ? CefEventFlags.MiddleMouseButton : 0) | + (input.IsRightMousePressed() ? CefEventFlags.RightMouseButton : 0)); + } + } +} \ No newline at end of file diff --git a/EnhancedUI/Gui/CreateControlPanelPatch.cs b/EnhancedUI/Gui/CreateControlPanelPatch.cs new file mode 100644 index 0000000..7ed61ef --- /dev/null +++ b/EnhancedUI/Gui/CreateControlPanelPatch.cs @@ -0,0 +1,50 @@ +using System.Collections.Generic; +using HarmonyLib; +using Sandbox.Game.Gui; +using Sandbox.Game.Localization; +using Sandbox.Graphics.GUI; +using VRage.Game.ModAPI; + +namespace EnhancedUI.Gui +{ + //Replaces the controls on the Control Panel section of the terminal. + [HarmonyPatch(typeof(MyGuiScreenTerminal), "CreateControlPanelPageControls")] + internal static class CreateControlPanelPatch + { + private const string NAME = "Terminal"; + private static WebContent Content = new WebContent(); + + private static bool Prefix( + MyGuiControlTabPage page, + Dictionary ___m_defaultFocusedControlKeyboard) + { + // Code for a reload button + //MyGuiControlButton refreshButton = new MyGuiControlButton(new Vector2(0, 0.0f), VRage.Game.MyGuiControlButtonStyleEnum.Default, null, null, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, "Reload HTML page.", new System.Text.StringBuilder("Reload Page"), onButtonClick: new Action(ReloadAction)); + //page.Controls.Add(refreshButton); + + page.Name = "PageControlPanel"; + page.TextEnum = MySpaceTexts.ControlPanel; + page.TextScale = 0.7005405f; + + var control = new ChromiumGuiControl(Content, NAME) + { + Position = new(0f, 0.005f), + Size = new(0.9f, 0.7f) + }; + + // Adds the GUI elements to the screen + page.Controls.Add(control); + page.Controls.Add(control.Wheel); + + ___m_defaultFocusedControlKeyboard[MyTerminalPageEnum.ControlPanel] = control; + return false; + } + + /* Code for reloading the page with the reload button + private static void ReloadAction(MyGuiControlButton myGuiControlButton) + { + control.ReloadPage(); + } + */ + } +} \ No newline at end of file diff --git a/EnhancedUI/Gui/InitControlPanelPatch.cs b/EnhancedUI/Gui/InitControlPanelPatch.cs new file mode 100644 index 0000000..92be9c0 --- /dev/null +++ b/EnhancedUI/Gui/InitControlPanelPatch.cs @@ -0,0 +1,17 @@ +using System; +using System.Reflection; +using HarmonyLib; + +namespace EnhancedUI.Gui +{ + [HarmonyPatch] + internal static class InitControlPanelPatch + { + private static MethodBase TargetMethod() + { + return AccessTools.Method(Type.GetType("Sandbox.Game.Gui.MyTerminalControlPanel, Sandbox.Game", true), "Init"); + } + + private static bool Prefix() => false; + } +} \ No newline at end of file diff --git a/EnhancedUI/Gui/WebContent.cs b/EnhancedUI/Gui/WebContent.cs new file mode 100644 index 0000000..a6efdcf --- /dev/null +++ b/EnhancedUI/Gui/WebContent.cs @@ -0,0 +1,27 @@ +using System.IO; +using System.Web; +using EnhancedUI.Utils; + +namespace EnhancedUI.Gui +{ + public class WebContent + { + private readonly string baseUrl; + + public WebContent() + { + /* Document and resources are loaded from the Content folder next to the plugin DLL. + * If no Content folder found, then from the development server: http://127.0.0.1:3000 + */ + var contentDir = Path.Combine(FileSystem.GetPluginsDir(), "Content"); + baseUrl = Directory.Exists(contentDir) + ? "file://" + HttpUtility.UrlPathEncode(contentDir.Replace('\\', '/')) + : "http://127.0.0.1:3000"; + } + + public string FormatIndexUrl(string name) + { + return $"{baseUrl}/{name}.html"; + } + } +} \ No newline at end of file diff --git a/EnhancedUI/Main.cs b/EnhancedUI/Main.cs new file mode 100644 index 0000000..83e1517 --- /dev/null +++ b/EnhancedUI/Main.cs @@ -0,0 +1,41 @@ +using System.IO; +using System.Reflection; +using CefSharp; +using CefSharp.OffScreen; +using EnhancedUI.Gui; +using HarmonyLib; +using Sandbox.Graphics.GUI; +using VRage.FileSystem; +using VRage.Input; +using VRage.Plugins; + +namespace EnhancedUI +{ + public class Main : IPlugin + { + public void Dispose() + { + Cef.Shutdown(); + } + + public void Init(object gameInstance) + { + new Harmony("EnhancedUI").PatchAll(Assembly.GetExecutingAssembly()); + + var settings = new CefSettings + { + CachePath = Path.Combine(MyFileSystem.CachePath, "CefCache"), + CommandLineArgsDisabled = true, + }; + settings.DisableGpuAcceleration(); + + CefSharpSettings.SubprocessExitIfParentProcessClosed = true; + + Cef.Initialize(settings, true, browserProcessHandler: null); + } + + public void Update() + { + } + } +} \ No newline at end of file diff --git a/EnhancedUI/Utils/FileSystem.cs b/EnhancedUI/Utils/FileSystem.cs new file mode 100644 index 0000000..a149f8e --- /dev/null +++ b/EnhancedUI/Utils/FileSystem.cs @@ -0,0 +1,14 @@ +using System.IO; + +namespace EnhancedUI.Utils +{ + public static class FileSystem + { + public static string GetPluginsDir() + { + var executingAssembly = System.Reflection.Assembly.GetExecutingAssembly(); + var dllDirectory = Path.GetDirectoryName(executingAssembly.Location); + return dllDirectory ?? "."; + } + } +} \ No newline at end of file diff --git a/EnhancedUI/VideoPlayPatch.cs b/EnhancedUI/VideoPlayPatch.cs new file mode 100644 index 0000000..2f88302 --- /dev/null +++ b/EnhancedUI/VideoPlayPatch.cs @@ -0,0 +1,54 @@ +using System; +using System.Reflection; +using System.Runtime.ExceptionServices; +using System.Security; +using EnhancedUI.Gui; +using HarmonyLib; +using VRageRender; + +namespace EnhancedUI +{ + // Patch to allow loading HTML files using the video player + [HarmonyPatch] + internal static class VideoPlayPatch + { + private static readonly Type _factoryType = Type.GetType("VRageRender.MyVideoFactory, VRage.Render11", true); + private static readonly Type _playerType = Type.GetType("VRageRender.MyVideoPlayer, VRage.Render11", true); + + private static readonly MethodBase _getByIdMethod = AccessTools.Method(_factoryType, "GetVideo"); + private static readonly MethodBase _initMethod = AccessTools.Method(_playerType, "Init"); + + public const string VIDEO_NAME = "CefFrame"; + + private static MethodBase TargetMethod() + { + return AccessTools.Method(_factoryType, "Play"); + } + + [HandleProcessCorruptedStateExceptions] + [SecurityCritical] + private static bool Prefix(uint id, string videoFile) + { + if (videoFile != VIDEO_NAME) + return true; + + var video = _getByIdMethod.Invoke(null, new object[]{id}); + if (video is null || ChromiumGuiControl.Player is null) + return false; + + try + { + lock (video) + { + _initMethod.Invoke(video, new object[] {videoFile, ChromiumGuiControl.Player}); + } + } + catch (Exception e) + { + MyRenderProxy.Log.WriteLine(e); + } + + return false; + } + } +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d9f26d4 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +EnhancedUI