Compare commits
440 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 67bec11f10 | |||
| 35efdd4628 | |||
| 271a6ae650 | |||
| 003bd5c695 | |||
| e1f84a9b10 | |||
| 9745abea0c | |||
| 1e418ab86f | |||
| 1c820b7f53 | |||
| 2cc260170e | |||
| de86084dbc | |||
| f56b968768 | |||
| edab5c7a6d | |||
| 82cbf4c281 | |||
| 00ae81751b | |||
| 89384702b4 | |||
| 54316313dc | |||
| 4059b363a3 | |||
| 0220e5d756 | |||
| 2315f10d91 | |||
| 3283e51381 | |||
| 7e960371a3 | |||
| f2a2daf39d | |||
| 7d87f1c4fe | |||
| fe84fd558e | |||
| 624ad20404 | |||
| 54ff88d6d4 | |||
| c955f30422 | |||
| 7a1bd1babc | |||
| d0be75e79d | |||
| e0ead86616 | |||
| b66005daea | |||
| 0fe66d2c3c | |||
| 169168cea9 | |||
| f6d3794d87 | |||
| 763f5a3f5d | |||
| 8a18f7caaa | |||
| 5f7bfb5890 | |||
| 3be4e73c27 | |||
| 667950c98e | |||
| 3e91177833 | |||
| 51f18e46a0 | |||
| f66316161b | |||
| 679b8f0f5e | |||
| 0e470fcdce | |||
| abbbf95002 | |||
| fbbbeebade | |||
| 7c9b90c767 | |||
| b81894b859 | |||
| 655c903cb5 | |||
| 8c4afaac17 | |||
| c6a3780753 | |||
| d9f6704316 | |||
| 011490368b | |||
| 8ed10a536b | |||
| 6051e49307 | |||
| 55120e6572 | |||
| 7542d48983 | |||
| 7b36763359 | |||
| eecedd9f97 | |||
| 1003a88cad | |||
| 299fd59cbb | |||
| 74bcb91b65 | |||
| 2c64aaa251 | |||
| 607d2c7241 | |||
| b2a0f3a77c | |||
| d26c4701fa | |||
| 7f317a2b18 | |||
| 38149059c3 | |||
| 67175419a9 | |||
| d3fdcdf43d | |||
| f4ea460644 | |||
| d5735d8dcc | |||
| 80b48ac3ad | |||
| cddd29a986 | |||
| 799fdb67cc | |||
| 69fa0fecbd | |||
| fd5f970a8b | |||
| fee2459e73 | |||
| 63cad62c89 | |||
| dca5de4085 | |||
| 8edc3c70d3 | |||
| 3c33acf6d7 | |||
| c8ba8c1cd0 | |||
| 94e4828aeb | |||
| 1d88cb4c42 | |||
| c5fe69f0d3 | |||
| b46d3ad0a8 | |||
| e33cf0dcb9 | |||
| 0d016aaa5d | |||
| 5b972238bb | |||
| 7ac1eb3fd4 | |||
| db48f27842 | |||
| f8b5c14509 | |||
| 28e4b30cd6 | |||
| 4510c1e404 | |||
| 6b44f549b4 | |||
| ae1436b103 | |||
| 2684c31f10 | |||
| bdd64cad07 | |||
| 28ea2fa553 | |||
| dd597fca44 | |||
| b9d3ff8f26 | |||
| df3d5d78d6 | |||
| 2e057ce6c4 | |||
| e5dbc333fa | |||
| d0ec94c3e6 | |||
| cafb6faa39 | |||
| b8d289a847 | |||
| f16d8f5c78 | |||
| eabb39ba86 | |||
| b489ac946c | |||
| 8d9151c74a | |||
| 4ecbaf2a4b | |||
| 3e4601a0c8 | |||
| 61d5a33683 | |||
| 7ed689587b | |||
| 612bf8814f | |||
| be17472cd5 | |||
| 8bf50151d5 | |||
| 57da455700 | |||
| 0982b68a4a | |||
| 0fc88e480a | |||
| 7eb50e2c8d | |||
| 58e754c169 | |||
| 83064cd40b | |||
| 5ca3b73b7f | |||
| 570a6f071c | |||
| 11ad5db127 | |||
| 5c550e8587 | |||
| eb2a04c56b | |||
| 3f714d6f38 | |||
| 747e0e1574 | |||
| debfdcd278 | |||
| f85daf3dbe | |||
| 3b24b2adc4 | |||
| c493340104 | |||
| 3a7f9b3adb | |||
| b1b6402827 | |||
| 7d73def53d | |||
| c4c85cf4b8 | |||
| a37882893e | |||
| 702e4ca160 | |||
| 1ebc7b820f | |||
| 3152312890 | |||
| 4000bbd199 | |||
| 3cabdf3e15 | |||
| 05c28f7e92 | |||
| 699d4ede1d | |||
| 31673fdff6 | |||
| 07337108bc | |||
| fd82033666 | |||
| cd01fa63a1 | |||
| b81c50b433 | |||
| 355a57089b | |||
| cf7ab6226c | |||
| 03da6d58a4 | |||
| 90a4544ab2 | |||
| 9b4557f197 | |||
| e594258cf3 | |||
| bb863c5b32 | |||
| 0797d1a517 | |||
| 8dc8b87580 | |||
| baeec369e6 | |||
| a1f2b22b19 | |||
| 5931f2f301 | |||
| 0b25df0ea7 | |||
| b75c7b177a | |||
| ccc5a4e17a | |||
| daa800c8b1 | |||
| a531973c0d | |||
| 4c8b0da3da | |||
| 9a8a014795 | |||
| 9640d336a6 | |||
| 12ce015d83 | |||
| f455bf4736 | |||
| 9bc66c7cf3 | |||
| e9022de150 | |||
| cb327b8073 | |||
| 1c354d18bb | |||
| 0ed88691c2 | |||
| c64fcfd4d1 | |||
| 6689cdb968 | |||
| 345aa3ea2a | |||
| 1ffc41f97d | |||
| 36b92f0520 | |||
| cb612044ea | |||
| 71081d8344 | |||
| 54bfeb0f6f | |||
| 5f83c70292 | |||
| 3d7883ee01 | |||
| e4ee7aaafa | |||
| aff2528a6f | |||
| 0d2ee63420 | |||
| de9d1ac60b | |||
| 19f7099af0 | |||
| f8a734d93f | |||
| 3f7e86b32e | |||
| e5bf375b42 | |||
| 93329087a9 | |||
| 72d568e5b3 | |||
| c9dfd024b2 | |||
| 8c624a0032 | |||
| 079e280226 | |||
| 3bdf45c29c | |||
| d257a41660 | |||
| 36f2bbd8d1 | |||
| da291b7fca | |||
| c8485233d5 | |||
| 2d768e4edb | |||
| e58376bf50 | |||
| dceb028184 | |||
| 33a4d94c44 | |||
| b2f158f893 | |||
| da6da32651 | |||
| 477591e2fa | |||
| ddb293399e | |||
| 7494b001a2 | |||
| 9f0a40bedc | |||
| 8da05c3080 | |||
| 5b5f52f86e | |||
| af3caa9b96 | |||
| 206b25b8d6 | |||
| 00deef01a4 | |||
| 74e2c655f0 | |||
| fa91c4e847 | |||
| 1125caabca | |||
| eead8d813c | |||
| 28b20ad6d3 | |||
| a88ec1714d | |||
| 0110295e7d | |||
| 9752206996 | |||
| 2f4e4c33ca | |||
| b30b6b135c | |||
| df0844b737 | |||
| 21d703bf0b | |||
| 4048f0b8d0 | |||
| 2d0e9ae70c | |||
| eaf11dcebe | |||
| 9bd8262191 | |||
| ddb00a0836 | |||
| aec8ba15f2 | |||
| c84eae199b | |||
| 9ead8098f5 | |||
| b190456005 | |||
| ebc0999a8e | |||
| c0b3edb20c | |||
| 64cadcf87b | |||
| 0165cba966 | |||
| 3da550c2fc | |||
| 4b43fdb0ad | |||
| 56621669b2 | |||
| ed2a0f7374 | |||
| 59e86cd8dd | |||
| a74e3da030 | |||
| b8ed2a1ce5 | |||
| e6c6c02780 | |||
| ab9ebedeee | |||
| 11af4ce4c4 | |||
| 8a78390a15 | |||
| 23e47e06c0 | |||
| ff60576f3c | |||
| 5b5bacfc41 | |||
| eb8b7be2f5 | |||
| eb05e04f79 | |||
| 2f0affcdbb | |||
| dfa7c47887 | |||
| acf799440e | |||
| 3e98b9103f | |||
| 4a613f7acb | |||
| af5f4d380a | |||
| ecf1e93a1b | |||
| e404a2e0d9 | |||
| d485f5ea1f | |||
| b48684ce5a | |||
| a11c8bc6e9 | |||
| 985a284e7d | |||
| e629518550 | |||
| c28c972ae3 | |||
| bc0f44712f | |||
| f663cb3c14 | |||
| 5a9c2018b0 | |||
| a1cdae05d0 | |||
| c17f5ae516 | |||
| a2db8cb639 | |||
| 507efc8cda | |||
| 6f3cf2f3ce | |||
| c979a05d6c | |||
| c53e453341 | |||
| 2519b413f8 | |||
| e5ac4faf7b | |||
| 0c26d1aa67 | |||
| 8b13ba1fdc | |||
| 52da5d5e23 | |||
| 916640fb60 | |||
| feeb1df4eb | |||
| f2086865ce | |||
| 15a89dd6e7 | |||
| 53952717c0 | |||
| fcbbd174b6 | |||
| d41cea0031 | |||
| c943a2cff3 | |||
| abcd0847ef | |||
| 2f52cbb7d4 | |||
| 9103bbb892 | |||
| 8f9c01d322 | |||
| af4651b37e | |||
| 485dc4e1b4 | |||
| c878d24d11 | |||
| cb5c940a84 | |||
| dd3a0ea069 | |||
| 4bf6c3ef1f | |||
| 2378ce6bf2 | |||
| b85db24601 | |||
| cae7d76206 | |||
| 4c6d52e652 | |||
| cbfdfe35be | |||
| 537b96c79f | |||
| d3d28924e6 | |||
| 48f1fb5ba1 | |||
| 0b13efd0b5 | |||
| 289fe2eb78 | |||
| fe9e66b0ff | |||
| 990edd8300 | |||
| db95ec7dff | |||
| 7e036c1d00 | |||
| 1c511a147d | |||
| f093d93761 | |||
| e7c8667497 | |||
| 497197eb2c | |||
| 08b2ffc600 | |||
| 8db3eca46c | |||
| 4d54eabdac | |||
| 698eb01bbe | |||
| a3fbaab173 | |||
| 57291e925d | |||
| 8e9332ac8c | |||
| fcb72e2b78 | |||
| 7012e8c0d8 | |||
| 176474ec2a | |||
| 9fc8749d15 | |||
| 09634b416d | |||
| 393ef175bf | |||
| d63c710836 | |||
| fa9baa3929 | |||
| 4c18b9a62b | |||
| 26c12c3410 | |||
| 76a4de1192 | |||
| 55aeaea5b9 | |||
| e6d25f3e38 | |||
| 740c7cf1bb | |||
| 71f0b63079 | |||
| 8ee54bb8df | |||
| e3ce41306e | |||
| af7c757e63 | |||
| a10c115b9b | |||
| 6d49dbad3e | |||
| a651b3b9ad | |||
| 3f2e56be67 | |||
| feb6e262e4 | |||
| 1d557f1b0e | |||
| fea4965889 | |||
| 91663832f0 | |||
| 9cf1b19801 | |||
| 1f7f0945c5 | |||
| cd6afb32cb | |||
| 7d5496e959 | |||
| ed426556e1 | |||
| 96c445356b | |||
| 1c2d361b77 | |||
| 581aae1735 | |||
| 70109e1896 | |||
| 0df5819a88 | |||
| 3fbbe8543f | |||
| 03dfb8e3da | |||
| a987e97610 | |||
| ecd46ed630 | |||
| f2f7599f81 | |||
| ac158907ea | |||
| 9506af49db | |||
| c882eac1ca | |||
| 7a6b44048a | |||
| 0d39d59a04 | |||
| f0e0db55e3 | |||
| f207239d56 | |||
| ccf2ec9f12 | |||
| aff7a5e7ce | |||
| cd84ca2b3f | |||
| 7c645afa1d | |||
| 24c1e0e754 | |||
| 9f6a0807d1 | |||
| 15f83c8b0e | |||
| c7253bdf02 | |||
| cf10c566dd | |||
| acfe838bc6 | |||
| 9e1f559644 | |||
| 2c79a67dae | |||
| 1687271bfd | |||
| cb5457ba2e | |||
| a701f6c103 | |||
| 8cad8651d2 | |||
| 61b547606c | |||
| 059cfa6e28 | |||
| 71d84e4486 | |||
| 92301869ed | |||
| c3d06a9c94 | |||
| 911c870e24 | |||
| 8cda19d993 | |||
| 62621ba855 | |||
| 497c259031 | |||
| 9ad9d2acd2 | |||
| 1b63765caa | |||
| 61764459ed | |||
| 1b7f2c40e6 | |||
| 93d52ae819 | |||
| 48b3d5c6b1 | |||
| e9a9d8a01c | |||
| a155a57f33 | |||
| 90b83a0690 | |||
| f10301c3e4 | |||
| 8571a936a4 | |||
| 3f6144836c | |||
| 53c432a635 | |||
| 340cadf3b9 | |||
| 8d6868aef6 | |||
| 6e8fcc8cc3 | |||
| 57670ffc76 | |||
| 2144eedd76 | |||
| 43daef83de | |||
| 4a9ad426e7 | |||
| 13beda3a8d | |||
| 18c05af4db | |||
| df6e1e1cbd | |||
| 01b1a14511 | |||
| b6af8d559c | |||
| 22dbfc2e24 | |||
| 2f3b01732c | |||
| 88803382dd | |||
| 74c51163c7 | |||
| 877ff4ba18 | |||
| ad2feb5a27 |
+243
-147
@@ -1,156 +1,252 @@
|
|||||||
|
# ##############################################################
|
||||||
|
# #
|
||||||
|
# # .editorconfig – Hellion Forge / Hellion Media
|
||||||
|
# #
|
||||||
|
# # Überarbeitet: Mai 2026
|
||||||
|
# #
|
||||||
|
# # Strategie:
|
||||||
|
# # - Standard-.NET-Conventions (private Fields = _camelCase)
|
||||||
|
# # - CSharpier übernimmt die meiste Formatierung
|
||||||
|
# # - Hier: Naming, IDE-Hints, Backup-Format-Regeln
|
||||||
|
# #
|
||||||
|
# # ##############################################################
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Defaults (alle Files)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
indent_style=space
|
indent_style = space
|
||||||
tab_width=4
|
tab_width = 4
|
||||||
indent_size=4
|
indent_size = 4
|
||||||
trim_trailing_whitespace=true
|
charset = utf-8
|
||||||
insert_final_newline=false
|
end_of_line = lf
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
# JetBrains Rider custom properties for code formatting styles
|
|
||||||
resharper_csharp_brace_style=next_line
|
|
||||||
|
|
||||||
resharper_csharp_braces_for_foreach=not_required
|
# =====================================================
|
||||||
resharper_csharp_braces_for_for=not_required
|
# Markdown: Trailing Spaces erlaubt (2 Spaces = <br>)
|
||||||
resharper_csharp_braces_for_while=not_required
|
# =====================================================
|
||||||
charset=utf-8
|
|
||||||
end_of_line=crlf
|
|
||||||
|
|
||||||
# Microsoft .NET properties
|
[*.md]
|
||||||
csharp_new_line_before_members_in_object_initializers=false
|
trim_trailing_whitespace = false
|
||||||
csharp_preferred_modifier_order=public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion
|
|
||||||
csharp_style_prefer_utf8_string_literals=true:suggestion
|
|
||||||
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_naming_rule.private_constants_rule.import_to_resharper=True
|
|
||||||
dotnet_naming_rule.private_constants_rule.resharper_description=Constant fields (private)
|
|
||||||
dotnet_naming_rule.private_constants_rule.resharper_guid=236f7aa5-7b06-43ca-bf2a-9b31bfcff09a
|
|
||||||
dotnet_naming_rule.private_constants_rule.severity=warning
|
|
||||||
dotnet_naming_rule.private_constants_rule.style=upper_camel_case_style
|
|
||||||
dotnet_naming_rule.private_constants_rule.symbols=private_constants_symbols
|
|
||||||
dotnet_naming_rule.private_instance_fields_rule.import_to_resharper=True
|
|
||||||
dotnet_naming_rule.private_instance_fields_rule.resharper_description=Instance fields (private)
|
|
||||||
dotnet_naming_rule.private_instance_fields_rule.resharper_guid=4a98fdf6-7d98-4f5a-afeb-ea44ad98c70c
|
|
||||||
dotnet_naming_rule.private_instance_fields_rule.severity=warning
|
|
||||||
dotnet_naming_rule.private_instance_fields_rule.style=upper_camel_case_style
|
|
||||||
dotnet_naming_rule.private_instance_fields_rule.symbols=private_instance_fields_symbols
|
|
||||||
dotnet_naming_rule.private_instance_fields_rule_1.import_to_resharper=True
|
|
||||||
dotnet_naming_rule.private_instance_fields_rule_1.resharper_description=Instance fields (private)
|
|
||||||
dotnet_naming_rule.private_instance_fields_rule_1.resharper_guid=4a98fdf6-7d98-4f5a-afeb-ea44ad98c70c
|
|
||||||
dotnet_naming_rule.private_instance_fields_rule_1.severity=warning
|
|
||||||
dotnet_naming_rule.private_instance_fields_rule_1.style=upper_camel_case_style
|
|
||||||
dotnet_naming_rule.private_instance_fields_rule_1.symbols=private_instance_fields_symbols_1
|
|
||||||
dotnet_naming_rule.private_static_fields_rule.import_to_resharper=True
|
|
||||||
dotnet_naming_rule.private_static_fields_rule.resharper_description=Static fields (private)
|
|
||||||
dotnet_naming_rule.private_static_fields_rule.resharper_guid=f9fce829-e6f4-4cb2-80f1-5497c44f51df
|
|
||||||
dotnet_naming_rule.private_static_fields_rule.severity=warning
|
|
||||||
dotnet_naming_rule.private_static_fields_rule.style=upper_camel_case_style
|
|
||||||
dotnet_naming_rule.private_static_fields_rule.symbols=private_static_fields_symbols
|
|
||||||
dotnet_naming_rule.private_static_readonly_rule.import_to_resharper=True
|
|
||||||
dotnet_naming_rule.private_static_readonly_rule.resharper_description=Static readonly fields (private)
|
|
||||||
dotnet_naming_rule.private_static_readonly_rule.resharper_guid=15b5b1f1-457c-4ca6-b278-5615aedc07d3
|
|
||||||
dotnet_naming_rule.private_static_readonly_rule.severity=warning
|
|
||||||
dotnet_naming_rule.private_static_readonly_rule.style=upper_camel_case_style
|
|
||||||
dotnet_naming_rule.private_static_readonly_rule.symbols=private_static_readonly_symbols
|
|
||||||
dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper=True
|
|
||||||
dotnet_naming_rule.unity_serialized_field_rule.resharper_description=Unity serialized field
|
|
||||||
dotnet_naming_rule.unity_serialized_field_rule.resharper_guid=5f0fdb63-c892-4d2c-9324-15c80b22a7ef
|
|
||||||
dotnet_naming_rule.unity_serialized_field_rule.severity=warning
|
|
||||||
dotnet_naming_rule.unity_serialized_field_rule.style=lower_camel_case_style_1
|
|
||||||
dotnet_naming_rule.unity_serialized_field_rule.symbols=unity_serialized_field_symbols
|
|
||||||
dotnet_naming_rule.unity_serialized_field_rule_1.import_to_resharper=True
|
|
||||||
dotnet_naming_rule.unity_serialized_field_rule_1.resharper_description=Unity serialized field
|
|
||||||
dotnet_naming_rule.unity_serialized_field_rule_1.resharper_guid=5f0fdb63-c892-4d2c-9324-15c80b22a7ef
|
|
||||||
dotnet_naming_rule.unity_serialized_field_rule_1.severity=warning
|
|
||||||
dotnet_naming_rule.unity_serialized_field_rule_1.style=lower_camel_case_style_1
|
|
||||||
dotnet_naming_rule.unity_serialized_field_rule_1.symbols=unity_serialized_field_symbols_1
|
|
||||||
dotnet_naming_style.lower_camel_case_style.capitalization=camel_case
|
|
||||||
dotnet_naming_style.lower_camel_case_style.required_prefix=_
|
|
||||||
dotnet_naming_style.lower_camel_case_style_1.capitalization=camel_case
|
|
||||||
dotnet_naming_style.upper_camel_case_style.capitalization=pascal_case
|
|
||||||
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_constants_symbols.resharper_applicable_kinds=constant_field
|
|
||||||
dotnet_naming_symbols.private_constants_symbols.resharper_required_modifiers=any
|
|
||||||
dotnet_naming_symbols.private_instance_fields_symbols.applicable_accessibilities=private
|
|
||||||
dotnet_naming_symbols.private_instance_fields_symbols.applicable_kinds=field
|
|
||||||
dotnet_naming_symbols.private_instance_fields_symbols.resharper_applicable_kinds=field,readonly_field
|
|
||||||
dotnet_naming_symbols.private_instance_fields_symbols.resharper_required_modifiers=instance
|
|
||||||
dotnet_naming_symbols.private_instance_fields_symbols_1.applicable_accessibilities=private
|
|
||||||
dotnet_naming_symbols.private_instance_fields_symbols_1.applicable_kinds=field
|
|
||||||
dotnet_naming_symbols.private_instance_fields_symbols_1.resharper_applicable_kinds=field,readonly_field
|
|
||||||
dotnet_naming_symbols.private_instance_fields_symbols_1.resharper_required_modifiers=instance
|
|
||||||
dotnet_naming_symbols.private_static_fields_symbols.applicable_accessibilities=private
|
|
||||||
dotnet_naming_symbols.private_static_fields_symbols.applicable_kinds=field
|
|
||||||
dotnet_naming_symbols.private_static_fields_symbols.required_modifiers=static
|
|
||||||
dotnet_naming_symbols.private_static_fields_symbols.resharper_applicable_kinds=field
|
|
||||||
dotnet_naming_symbols.private_static_fields_symbols.resharper_required_modifiers=static
|
|
||||||
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=readonly,static
|
|
||||||
dotnet_naming_symbols.private_static_readonly_symbols.resharper_applicable_kinds=readonly_field
|
|
||||||
dotnet_naming_symbols.private_static_readonly_symbols.resharper_required_modifiers=static
|
|
||||||
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities=*
|
|
||||||
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds=
|
|
||||||
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds=unity_serialised_field
|
|
||||||
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers=instance
|
|
||||||
dotnet_naming_symbols.unity_serialized_field_symbols_1.applicable_accessibilities=*
|
|
||||||
dotnet_naming_symbols.unity_serialized_field_symbols_1.applicable_kinds=
|
|
||||||
dotnet_naming_symbols.unity_serialized_field_symbols_1.resharper_applicable_kinds=unity_serialised_field
|
|
||||||
dotnet_naming_symbols.unity_serialized_field_symbols_1.resharper_required_modifiers=instance
|
|
||||||
dotnet_style_parentheses_in_arithmetic_binary_operators=never_if_unnecessary:none
|
|
||||||
dotnet_style_parentheses_in_other_binary_operators=always_for_clarity: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_cpp_insert_final_newline=true
|
|
||||||
resharper_csharp_insert_final_newline=false
|
|
||||||
resharper_formatter_off_tag=@formatter:off
|
|
||||||
resharper_formatter_on_tag=@formatter:on
|
|
||||||
resharper_formatter_tags_enabled=true
|
|
||||||
resharper_fsharp_insert_final_newline=false
|
|
||||||
resharper_html_insert_final_newline=false
|
|
||||||
resharper_resx_insert_final_newline=false
|
|
||||||
resharper_shaderlab_insert_final_newline=false
|
|
||||||
resharper_t4_insert_final_newline=false
|
|
||||||
resharper_use_indent_from_vs=false
|
|
||||||
resharper_vb_insert_final_newline=false
|
|
||||||
resharper_xmldoc_insert_final_newline=false
|
|
||||||
resharper_xml_insert_final_newline=false
|
|
||||||
|
|
||||||
# ReSharper inspection severities
|
# =====================================================
|
||||||
resharper_arrange_redundant_parentheses_highlighting=hint
|
# JSON / YAML / Web-Configs: 2-Space-Indent
|
||||||
resharper_arrange_this_qualifier_highlighting=hint
|
# Konsistent mit yamllint und Prettier-Override
|
||||||
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_razor_assembly_not_resolved_highlighting=warning
|
|
||||||
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
|
|
||||||
|
|
||||||
[{*.har,*.jsb2,*.jsb3,*.json,*.jsonc,*.postman_collection,*.postman_collection.json,*.postman_environment,*.postman_environment.json,.babelrc,.eslintrc,.prettierrc,.stylelintrc,bowerrc,jest.config}]
|
[*.{yaml,yml}]
|
||||||
indent_style=space
|
indent_size = 2
|
||||||
indent_size=2
|
|
||||||
|
|
||||||
[{*.yaml,*.yml}]
|
[*.{json,jsonc,har,jsb2,jsb3,postman_collection,postman_environment}]
|
||||||
indent_style=space
|
indent_size = 2
|
||||||
indent_size=2
|
|
||||||
|
|
||||||
[*.{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,c++m,cc,ccm,cginc,compute,cp,cpp,cppm,cs,cshtml,cu,cuh,cxx,cxxm,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,mxx,nuspec,paml,razor,resw,resx,shader,skin,tpp,usf,ush,uxml,vb,xaml,xamlx,xoml,xsd}]
|
[{.babelrc,.eslintrc,.prettierrc,.markdownlintrc,.stylelintrc,bowerrc}]
|
||||||
indent_style=space
|
indent_size = 2
|
||||||
indent_size=4
|
|
||||||
tab_width=4
|
|
||||||
|
# =====================================================
|
||||||
|
# .NET / XAML / Razor / Resources: 4-Space-Indent
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
[*.{cs,csx,vb,fs,fsi,fsx}]
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.{xml,xsd,xaml,axaml,paml,resx,resw,nuspec,config}]
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.{cshtml,razor,aspx,ascx,asax,master,axaml}]
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
|
||||||
|
# ##############################################################
|
||||||
|
# #
|
||||||
|
# # C# Sektion: Style, Naming, Format
|
||||||
|
# #
|
||||||
|
# ##############################################################
|
||||||
|
|
||||||
|
[*.{cs,csx}]
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# C# Style – var-Präferenz
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
csharp_style_var_for_built_in_types = true:suggestion
|
||||||
|
csharp_style_var_when_type_is_apparent = true:suggestion
|
||||||
|
csharp_style_var_elsewhere = true:suggestion
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# C# Style – Sonstiges
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# UTF-8 String Literals (C# 11+)
|
||||||
|
csharp_style_prefer_utf8_string_literals = true:suggestion
|
||||||
|
|
||||||
|
# Reihenfolge der Access-Modifier (Microsoft-Empfehlung)
|
||||||
|
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion
|
||||||
|
|
||||||
|
# Initializer: nicht alles auf eine Zeile
|
||||||
|
csharp_new_line_before_members_in_object_initializers = false
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# C# Format – Braces (Backup, falls CSharpier nicht läuft)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Allman Style: Klammern auf neue Zeile
|
||||||
|
csharp_new_line_before_open_brace = all
|
||||||
|
csharp_new_line_before_else = true
|
||||||
|
csharp_new_line_before_catch = true
|
||||||
|
csharp_new_line_before_finally = true
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# C# Format – Switch-Einrückung
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
csharp_indent_case_contents = true
|
||||||
|
csharp_indent_switch_labels = true
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# .NET Style – Qualification (kein "this." nötig)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
dotnet_style_qualification_for_field = false:suggestion
|
||||||
|
dotnet_style_qualification_for_property = false:suggestion
|
||||||
|
dotnet_style_qualification_for_method = false:suggestion
|
||||||
|
dotnet_style_qualification_for_event = false:suggestion
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# .NET Style – Predefined Types (int statt Int32 etc.)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
|
||||||
|
dotnet_style_predefined_type_for_member_access = true:suggestion
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# .NET Style – Parentheses
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
|
||||||
|
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
|
||||||
|
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# .NET Style – Accessibility-Modifier erzwingen
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
|
||||||
|
|
||||||
|
|
||||||
|
# ##############################################################
|
||||||
|
# #
|
||||||
|
# # Naming Conventions (.NET-Standard)
|
||||||
|
# #
|
||||||
|
# # Private Instance Fields: _camelCase
|
||||||
|
# # Private Static Fields: _camelCase
|
||||||
|
# # Private Constants: PascalCase
|
||||||
|
# # Private Static Readonly: PascalCase
|
||||||
|
# #
|
||||||
|
# ##############################################################
|
||||||
|
|
||||||
|
# === Style: Underscore + camelCase ===
|
||||||
|
dotnet_naming_style.underscore_camel_case_style.capitalization = camel_case
|
||||||
|
dotnet_naming_style.underscore_camel_case_style.required_prefix = _
|
||||||
|
|
||||||
|
# === Style: PascalCase ===
|
||||||
|
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
|
||||||
|
|
||||||
|
|
||||||
|
# === Rule: Private Instance Fields → _camelCase ===
|
||||||
|
dotnet_naming_rule.private_instance_fields.severity = warning
|
||||||
|
dotnet_naming_rule.private_instance_fields.symbols = private_instance_fields_symbols
|
||||||
|
dotnet_naming_rule.private_instance_fields.style = underscore_camel_case_style
|
||||||
|
|
||||||
|
dotnet_naming_symbols.private_instance_fields_symbols.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_instance_fields_symbols.applicable_accessibilities = private
|
||||||
|
|
||||||
|
|
||||||
|
# === Rule: Private Static Fields → _camelCase ===
|
||||||
|
dotnet_naming_rule.private_static_fields.severity = warning
|
||||||
|
dotnet_naming_rule.private_static_fields.symbols = private_static_fields_symbols
|
||||||
|
dotnet_naming_rule.private_static_fields.style = underscore_camel_case_style
|
||||||
|
|
||||||
|
dotnet_naming_symbols.private_static_fields_symbols.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_static_fields_symbols.applicable_accessibilities = private
|
||||||
|
dotnet_naming_symbols.private_static_fields_symbols.required_modifiers = static
|
||||||
|
|
||||||
|
|
||||||
|
# === Rule: Private Constants → PascalCase ===
|
||||||
|
dotnet_naming_rule.private_constants.severity = warning
|
||||||
|
dotnet_naming_rule.private_constants.symbols = private_constants_symbols
|
||||||
|
dotnet_naming_rule.private_constants.style = pascal_case_style
|
||||||
|
|
||||||
|
dotnet_naming_symbols.private_constants_symbols.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_constants_symbols.applicable_accessibilities = private
|
||||||
|
dotnet_naming_symbols.private_constants_symbols.required_modifiers = const
|
||||||
|
|
||||||
|
|
||||||
|
# === Rule: Private Static Readonly → PascalCase ===
|
||||||
|
dotnet_naming_rule.private_static_readonly.severity = warning
|
||||||
|
dotnet_naming_rule.private_static_readonly.symbols = private_static_readonly_symbols
|
||||||
|
dotnet_naming_rule.private_static_readonly.style = pascal_case_style
|
||||||
|
|
||||||
|
dotnet_naming_symbols.private_static_readonly_symbols.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_static_readonly_symbols.applicable_accessibilities = private
|
||||||
|
dotnet_naming_symbols.private_static_readonly_symbols.required_modifiers = static, readonly
|
||||||
|
|
||||||
|
|
||||||
|
# ##############################################################
|
||||||
|
# #
|
||||||
|
# # JetBrains Rider / ReSharper Settings
|
||||||
|
# #
|
||||||
|
# ##############################################################
|
||||||
|
|
||||||
|
# === Brace-Style (für ReSharper-spezifische Formatierung) ===
|
||||||
|
resharper_csharp_brace_style = next_line
|
||||||
|
|
||||||
|
# Kurze Statements ohne Klammern erlaubt (für 1-Zeiler)
|
||||||
|
resharper_csharp_braces_for_foreach = not_required
|
||||||
|
resharper_csharp_braces_for_for = not_required
|
||||||
|
resharper_csharp_braces_for_while = not_required
|
||||||
|
|
||||||
|
# === Auto-Detection und Formatter-Tags ===
|
||||||
|
resharper_autodetect_indent_settings = true
|
||||||
|
resharper_use_indent_from_vs = false
|
||||||
|
|
||||||
|
# Erlaubt @formatter:off / @formatter:on Kommentare im Code
|
||||||
|
resharper_formatter_off_tag = @formatter:off
|
||||||
|
resharper_formatter_on_tag = @formatter:on
|
||||||
|
resharper_formatter_tags_enabled = true
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# ReSharper Inspection Severities
|
||||||
|
# (Hints = blaue Wellen, Warnings = gelb, Errors = rot)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Style-Suggestions: nur als Hint anzeigen
|
||||||
|
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_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
|
||||||
|
|
||||||
|
# Echte Probleme: als Warning
|
||||||
|
resharper_redundant_base_qualifier_highlighting = warning
|
||||||
+47
-16
@@ -1,19 +1,50 @@
|
|||||||
# Local development environment template
|
##############################################################
|
||||||
#
|
##
|
||||||
# Copy this file to `.env` and adjust paths to your setup,
|
## .env.example – Hellion Forge / Hellion Media
|
||||||
# or run: bash scripts/setup-dev-env.sh
|
##
|
||||||
#
|
## Template für lokale Entwicklungsumgebung.
|
||||||
# `.env` is gitignored — never commit your local paths.
|
## Kopiere diese Datei nach `.env` und passe die Pfade
|
||||||
#
|
## an dein Setup an.
|
||||||
# Activate in shell:
|
##
|
||||||
# set -a; source .env; set +a
|
## ⚠️ `.env` ist gitignored – niemals lokale Pfade committen!
|
||||||
#
|
##
|
||||||
# Or use direnv (recommended):
|
##############################################################
|
||||||
# echo 'dotenv .env' > .envrc && direnv allow
|
##
|
||||||
|
## SETUP
|
||||||
|
##
|
||||||
|
## 1) Manuell:
|
||||||
|
## cp .env.example .env
|
||||||
|
## # Pfade in .env anpassen
|
||||||
|
##
|
||||||
|
## 2) Automatisch:
|
||||||
|
## bash scripts/setup-dev-env.sh
|
||||||
|
##
|
||||||
|
## AKTIVIERUNG IN DER SHELL
|
||||||
|
##
|
||||||
|
## Variante A – einmalig pro Shell:
|
||||||
|
## set -a; source .env; set +a
|
||||||
|
##
|
||||||
|
## Variante B – mit direnv (empfohlen):
|
||||||
|
## echo 'dotenv .env' > .envrc
|
||||||
|
## direnv allow
|
||||||
|
##
|
||||||
|
##############################################################
|
||||||
|
|
||||||
# Path to Dalamud development DLLs (Dalamud.dll, FFXIVClientStructs.dll,
|
|
||||||
# Lumina.dll, Lumina.Excel.dll). Required for building ChatTwo.Tests project.
|
# =====================================================
|
||||||
|
# Build & Development Paths
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Pfad zu den Dalamud-Development-DLLs:
|
||||||
|
# - Dalamud.dll
|
||||||
|
# - FFXIVClientStructs.dll
|
||||||
|
# - Lumina.dll
|
||||||
|
# - Lumina.Excel.dll
|
||||||
#
|
#
|
||||||
# XIVLauncher Core (Linux): ~/.xlcore/dalamud/Hooks/dev
|
# Wird zum Bauen des HellionChat.Tests-Projekts benötigt.
|
||||||
# XIVLauncher (Windows): %AppData%\XIVLauncher\addon\Hooks\dev
|
#
|
||||||
|
# Standardpfade je nach Plattform:
|
||||||
|
# XIVLauncher Core (Linux): ~/.xlcore/dalamud/Hooks/dev
|
||||||
|
# XIVLauncher (Windows): %AppData%\XIVLauncher\addon\Hooks\dev
|
||||||
|
# XIVLauncher (macOS): ~/Library/Application Support/XIV on Mac/dalamud/Hooks/dev
|
||||||
DALAMUD_HOME=/path/to/dalamud/dev/dlls
|
DALAMUD_HOME=/path/to/dalamud/dev/dlls
|
||||||
|
|||||||
+178
-2
@@ -1,2 +1,178 @@
|
|||||||
# Generated files
|
##############################################################
|
||||||
ChatTwo/Resources/Language.*.resx linguist-generated=true
|
##
|
||||||
|
## .gitattributes – Hellion Forge / Hellion Media
|
||||||
|
##
|
||||||
|
## Setup: Linux-First Development
|
||||||
|
## (Hauptentwicklung auf Linux, Target = Dalamud/Windows)
|
||||||
|
## Überarbeitet: Mai 2026
|
||||||
|
##
|
||||||
|
## Strategie:
|
||||||
|
## - Default: Alles LF (Linux-Konvention)
|
||||||
|
## - Windows-Batch-Scripts: CRLF (technische Pflicht!)
|
||||||
|
## - PowerShell: CRLF (Sicherheit für Windows PS 5.1)
|
||||||
|
## - Binärdateien: explizit markiert (gegen Korruption)
|
||||||
|
##
|
||||||
|
## Hinweis:
|
||||||
|
## Moderne Visual-Studio- und MSBuild-Versionen kommen
|
||||||
|
## problemlos mit LF in .sln/.csproj klar.
|
||||||
|
## Falls jemals Probleme auftauchen: hier umstellen.
|
||||||
|
##
|
||||||
|
##############################################################
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Default: Auto-Detect, alles auf LF normalisieren
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
* text=auto eol=lf
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Source Code (LF)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
*.cs text eol=lf
|
||||||
|
*.csx text eol=lf
|
||||||
|
*.vb text eol=lf
|
||||||
|
*.fs text eol=lf
|
||||||
|
*.fsx text eol=lf
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Configs & Daten (LF)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
*.json text eol=lf
|
||||||
|
*.yml text eol=lf
|
||||||
|
*.yaml text eol=lf
|
||||||
|
*.xml text eol=lf
|
||||||
|
*.md text eol=lf
|
||||||
|
*.txt text eol=lf
|
||||||
|
*.config text eol=lf
|
||||||
|
*.editorconfig text eol=lf
|
||||||
|
.gitignore text eol=lf
|
||||||
|
.gitattributes text eol=lf
|
||||||
|
.env.example text eol=lf
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Visual Studio / MSBuild Project Files (LF)
|
||||||
|
# Linux-first: moderne Tools kommen mit LF zurecht
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
*.sln text eol=lf
|
||||||
|
*.csproj text eol=lf
|
||||||
|
*.vbproj text eol=lf
|
||||||
|
*.fsproj text eol=lf
|
||||||
|
*.props text eol=lf
|
||||||
|
*.targets text eol=lf
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Resources & Lokalisierung (LF)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Linguist soll generierte Sprachdateien nicht mitzählen
|
||||||
|
HellionChat/Resources/Language.*.resx linguist-generated=true
|
||||||
|
|
||||||
|
*.resx text eol=lf
|
||||||
|
*.resw text eol=lf
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Linux/Mac-Scripts (LF – Pflicht)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
*.sh text eol=lf
|
||||||
|
*.bash text eol=lf
|
||||||
|
*.zsh text eol=lf
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# >>> AUSNAHMEN <<<
|
||||||
|
# Windows-Scripts brauchen ZWINGEND CRLF.
|
||||||
|
# Mit LF werden diese auf Windows nicht ausgeführt!
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Batch-Scripts (cmd.exe braucht CRLF)
|
||||||
|
*.bat text eol=crlf
|
||||||
|
*.cmd text eol=crlf
|
||||||
|
|
||||||
|
# PowerShell (PS 7+ wäre LF-tolerant,
|
||||||
|
# aber Windows PowerShell 5.1 zickt teilweise)
|
||||||
|
*.ps1 text eol=crlf
|
||||||
|
*.psm1 text eol=crlf
|
||||||
|
*.psd1 text eol=crlf
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Binäre Build-Artefakte
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
*.dll binary
|
||||||
|
*.exe binary
|
||||||
|
*.pdb binary
|
||||||
|
*.so binary
|
||||||
|
*.dylib binary
|
||||||
|
*.nupkg binary
|
||||||
|
*.snupkg binary
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Bilder (binary)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
*.png binary
|
||||||
|
*.jpg binary
|
||||||
|
*.jpeg binary
|
||||||
|
*.gif binary
|
||||||
|
*.ico binary
|
||||||
|
*.bmp binary
|
||||||
|
*.tiff binary
|
||||||
|
*.webp binary
|
||||||
|
|
||||||
|
# SVG ist eigentlich XML – als Text behandeln
|
||||||
|
*.svg text eol=lf
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Fonts (binary)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
*.ttf binary
|
||||||
|
*.otf binary
|
||||||
|
*.woff binary
|
||||||
|
*.woff2 binary
|
||||||
|
*.eot binary
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Archive (binary)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
*.zip binary
|
||||||
|
*.7z binary
|
||||||
|
*.tar binary
|
||||||
|
*.gz binary
|
||||||
|
*.rar binary
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Audio / Video (binary)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
*.wav binary
|
||||||
|
*.mp3 binary
|
||||||
|
*.ogg binary
|
||||||
|
*.mp4 binary
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# FFXIV / Dalamud spezifische Binär-Formate
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
*.tex binary
|
||||||
|
*.pap binary
|
||||||
|
*.avfx binary
|
||||||
|
*.shpk binary
|
||||||
|
*.scd binary
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
# Verifies that every push to main and every PR still builds against the
|
||||||
|
# current Dalamud staging branch. Does not produce release artefacts; the
|
||||||
|
# release workflow handles that on tag.
|
||||||
|
#
|
||||||
|
# Linux runner: gitea.com Cloud Actions provides ubuntu-latest. The plugin
|
||||||
|
# csproj targets net10.0-windows, but `dotnet build` cross-compiles on
|
||||||
|
# Linux as long as the Dalamud staging assemblies are present at the
|
||||||
|
# expected lookup path ($(HOME)/.xlcore/dalamud/Hooks/dev/, which the
|
||||||
|
# Dalamud SDK 15 uses on Linux).
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
# Minimum permissions for a build-only workflow: read the repo, nothing
|
||||||
|
# else. Closes the CodeQL "Workflow does not contain permissions" alert
|
||||||
|
# and matches the principle-of-least-privilege the security guide
|
||||||
|
# recommends for workflows that don't push or create releases.
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build (Release)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 15
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
|
||||||
|
- name: Setup .NET 10
|
||||||
|
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5
|
||||||
|
with:
|
||||||
|
dotnet-version: 10.0.x
|
||||||
|
|
||||||
|
- name: Download Dalamud staging
|
||||||
|
run: |
|
||||||
|
hooks="$HOME/.xlcore/dalamud/Hooks/dev"
|
||||||
|
mkdir -p "$hooks"
|
||||||
|
curl -fsSL https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -o dalamud.zip
|
||||||
|
unzip -oq dalamud.zip -d "$hooks"
|
||||||
|
|
||||||
|
- name: Restore
|
||||||
|
run: dotnet restore HellionChat/HellionChat.csproj
|
||||||
|
|
||||||
|
- name: Build (Release)
|
||||||
|
run: dotnet build HellionChat/HellionChat.csproj --configuration Release --no-restore
|
||||||
@@ -0,0 +1,250 @@
|
|||||||
|
name: Forge Announce
|
||||||
|
|
||||||
|
# Triggered when a vX.Y.Z tag is pushed. Reads .github/forge-posts/<tag>.md
|
||||||
|
# (Frontmatter + DE bullet body) and the matching English block from
|
||||||
|
# HellionChat/HellionChat.yaml, builds a Discord-Webhook embed and posts
|
||||||
|
# it to the Hellion Forge #changelog channel.
|
||||||
|
#
|
||||||
|
# Decoupled from release.yml: a fail here does not block the GitHub
|
||||||
|
# release, and a fail there does not block the announce. Spec lives in
|
||||||
|
# the Vault under "Hellion Chat Forge-Auto-Announce Spec".
|
||||||
|
#
|
||||||
|
# Security: the only user-controlled inputs that enter run-steps are the
|
||||||
|
# tag name and the frontmatter values from a repo-internal markdown file.
|
||||||
|
# Tag name is read via env: (TAG_NAME, $env:TAG_NAME) and validated against
|
||||||
|
# ^v\d+\.\d+\.\d+$ before any string interpolation. Frontmatter values are
|
||||||
|
# parsed by regex with explicit length caps. No webhook event payload data
|
||||||
|
# (issue titles, PR bodies, commit messages, etc.) flows into run-steps.
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'Existing tag to (re)post, e.g. v1.1.0'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
announce:
|
||||||
|
name: Post changelog to Hellion Forge
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# The DISCORD_FORGE_WEBHOOK secret is set as a repo-level Actions Secret
|
||||||
|
# on Gitea (Settings → Actions → Secrets). Repo-level secrets are in
|
||||||
|
# scope for every job by default, no environment: declaration needed.
|
||||||
|
timeout-minutes: 5
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# On push:tags github.ref points at the tag commit; on workflow_dispatch
|
||||||
|
# the user supplies the tag explicitly. Always check out that tag so
|
||||||
|
# the yaml + forge-posts file are read from the tagged tree, not main.
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.inputs.tag || github.ref }}
|
||||||
|
|
||||||
|
# Build embed-payload as a JSON file on disk. PowerShell-Core (pwsh)
|
||||||
|
# ships pre-installed on ubuntu-latest so we get the same scripting
|
||||||
|
# patterns release.yml uses on windows-latest. Tag is read via env: to
|
||||||
|
# treat it as a string variable rather than inline shell text, and
|
||||||
|
# validated against the semver regex before any interpolation.
|
||||||
|
- name: Build embed payload
|
||||||
|
id: build
|
||||||
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
TAG_NAME: ${{ github.event.inputs.tag || github.ref_name }}
|
||||||
|
run: |
|
||||||
|
$tag = $env:TAG_NAME
|
||||||
|
if ($tag -notmatch '^v\d+\.\d+\.\d+$') {
|
||||||
|
throw "V1: Refusing to announce non-semver tag: $tag"
|
||||||
|
}
|
||||||
|
$version = $tag.Substring(1)
|
||||||
|
|
||||||
|
# ---------- Forge-Post-Datei lesen ----------
|
||||||
|
$forgePath = ".github/forge-posts/$tag.md"
|
||||||
|
if (-not (Test-Path $forgePath)) {
|
||||||
|
throw "V2: Forge-Post-Datei für $tag fehlt unter .github/forge-posts/. Datei vor dem Tag anlegen, dann Tag re-pushen oder workflow_dispatch."
|
||||||
|
}
|
||||||
|
$forgeRaw = Get-Content -Path $forgePath -Raw
|
||||||
|
|
||||||
|
# Frontmatter (--- … ---) am Datei-Anfang
|
||||||
|
if ($forgeRaw -notmatch '(?s)\A---\s*\r?\n(.*?)\r?\n---\s*\r?\n(.*)\z') {
|
||||||
|
throw "V3: Frontmatter (---) fehlt oder ist defekt in $forgePath"
|
||||||
|
}
|
||||||
|
$fmText = $matches[1]
|
||||||
|
$deBody = $matches[2].Trim()
|
||||||
|
|
||||||
|
$subtitle = $null
|
||||||
|
$versionsnatur = $null
|
||||||
|
foreach ($line in ($fmText -split "`r?`n")) {
|
||||||
|
if ($line -match '^subtitle:\s*"?([^"]*)"?\s*$') { $subtitle = $matches[1] }
|
||||||
|
if ($line -match '^versionsnatur:\s*"?([^"]*)"?\s*$') { $versionsnatur = $matches[1] }
|
||||||
|
}
|
||||||
|
if ([string]::IsNullOrWhiteSpace($subtitle)) { throw "V3: Frontmatter-Feld 'subtitle' fehlt in $forgePath" }
|
||||||
|
if ([string]::IsNullOrWhiteSpace($versionsnatur)) { throw "V3: Frontmatter-Feld 'versionsnatur' fehlt in $forgePath" }
|
||||||
|
if ($subtitle.Length -gt 60) { throw "V4: Frontmatter-Feld 'subtitle' überschreitet Limit ($($subtitle.Length) Char, max 60)" }
|
||||||
|
if ($versionsnatur.Length -gt 40) { throw "V4: Frontmatter-Feld 'versionsnatur' überschreitet Limit ($($versionsnatur.Length) Char, max 40)" }
|
||||||
|
if ([string]::IsNullOrWhiteSpace($deBody)) { throw "V3: DE-Body fehlt in $forgePath" }
|
||||||
|
|
||||||
|
# ---------- EN-Block aus HellionChat.yaml ziehen ----------
|
||||||
|
# 1:1 Pattern aus release.yml — gleicher Header-Marker, gleiches
|
||||||
|
# Trailer-Verhalten. Bei Drift die zwei Workflows synchron halten.
|
||||||
|
$yamlPath = "HellionChat/HellionChat.yaml"
|
||||||
|
$raw = Get-Content -Path $yamlPath -Raw
|
||||||
|
$marker = "changelog: |-"
|
||||||
|
$idx = $raw.IndexOf($marker)
|
||||||
|
if ($idx -lt 0) { throw "V5: changelog-Block nicht gefunden in $yamlPath" }
|
||||||
|
$afterMarker = $raw.Substring($idx + $marker.Length)
|
||||||
|
$changelogBody = (($afterMarker -split "`r?`n") | ForEach-Object {
|
||||||
|
if ($_ -match '^ ') { $_.Substring(4) } else { $_ }
|
||||||
|
}) -join "`n"
|
||||||
|
|
||||||
|
$header = "**v$version "
|
||||||
|
$start = $changelogBody.IndexOf($header)
|
||||||
|
if ($start -lt 0) {
|
||||||
|
throw "V5: No changelog entry for version $version found in $yamlPath. Update the changelog block before tagging."
|
||||||
|
}
|
||||||
|
$rest = $changelogBody.Substring($start)
|
||||||
|
$nextHdr = $rest.IndexOf("`n`n**v", 1)
|
||||||
|
$trailer = $rest.IndexOf("`n`n---")
|
||||||
|
if ($nextHdr -ge 0 -and ($trailer -lt 0 -or $nextHdr -lt $trailer)) {
|
||||||
|
$enBlock = $rest.Substring(0, $nextHdr).TrimEnd()
|
||||||
|
} elseif ($trailer -ge 0) {
|
||||||
|
$enBlock = $rest.Substring(0, $trailer).TrimEnd()
|
||||||
|
} else {
|
||||||
|
$enBlock = $rest.TrimEnd()
|
||||||
|
}
|
||||||
|
|
||||||
|
# ---------- Embed-Felder + Per-Field-Caps (Discord-Hard-Limits) ----------
|
||||||
|
# Discord enforces per-embed-field limits separately from the
|
||||||
|
# combined-total limit. We split the DE and EN blocks into two
|
||||||
|
# embeds that share the same release URL so Discord stitches
|
||||||
|
# them into one visual card. Hard caps per Discord docs:
|
||||||
|
# description: 4096 per embed
|
||||||
|
# title: 256 per embed
|
||||||
|
# footer.text: 2048 per embed
|
||||||
|
# combined sum across all embeds: 6000
|
||||||
|
$title = "Hellion Chat $version — $subtitle"
|
||||||
|
$deDesc = "**Deutsch**`n`n$deBody"
|
||||||
|
$enDesc = "**English**`n`n$enBlock"
|
||||||
|
$footerText = "Hellion Forge · $versionsnatur"
|
||||||
|
$releaseUrl = "https://gitea.hellion-forge.cloud/JonKazama-Hellion/HellionChat/releases/tag/$tag"
|
||||||
|
|
||||||
|
if ($deDesc.Length -gt 4096) {
|
||||||
|
throw "V6a: DE-Body too long for one embed ($($deDesc.Length) chars, max 4096). Trim .github/forge-posts/$tag.md or post the announcement manually (see forge style §8)."
|
||||||
|
}
|
||||||
|
if ($enDesc.Length -gt 4096) {
|
||||||
|
throw "V6b: EN-Block too long for one embed ($($enDesc.Length) chars, max 4096). Trim the changelog entry in HellionChat/HellionChat.yaml or post manually."
|
||||||
|
}
|
||||||
|
$totalChars = $title.Length + $deDesc.Length + $enDesc.Length + $footerText.Length
|
||||||
|
if ($totalChars -gt 6000) {
|
||||||
|
throw "V6c: Combined embed chars $totalChars exceed Discord's 6000-total limit. Major-Release detected — post manually via Bot/Multi-Embed (see forge style §8)."
|
||||||
|
}
|
||||||
|
Write-Host "Embed-Caps OK: de=$($deDesc.Length)/4096, en=$($enDesc.Length)/4096, total=$totalChars/6000"
|
||||||
|
|
||||||
|
# ---------- Embed-Payload bauen (zwei Embeds, gleiche url) ----------
|
||||||
|
# Sharing the same `url` tells Discord to render both embeds as a
|
||||||
|
# single contiguous card block. The title sits on the first embed,
|
||||||
|
# the footer + timestamp on the last so it reads as one post.
|
||||||
|
$payload = [ordered]@{
|
||||||
|
username = "Forge Herald"
|
||||||
|
avatar_url = "https://gitea.hellion-forge.cloud/JonKazama-Hellion/HellionChat/raw/branch/main/HellionChat/images/icon.png"
|
||||||
|
content = "<@&1500489631555260446>"
|
||||||
|
allowed_mentions = [ordered]@{
|
||||||
|
parse = @()
|
||||||
|
roles = @("1500489631555260446")
|
||||||
|
}
|
||||||
|
embeds = @(
|
||||||
|
[ordered]@{
|
||||||
|
title = $title
|
||||||
|
url = $releaseUrl
|
||||||
|
color = 12730636
|
||||||
|
description = $deDesc
|
||||||
|
},
|
||||||
|
[ordered]@{
|
||||||
|
url = $releaseUrl
|
||||||
|
color = 12730636
|
||||||
|
description = $enDesc
|
||||||
|
footer = [ordered]@{ text = $footerText }
|
||||||
|
timestamp = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffZ")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
$payloadJson = $payload | ConvertTo-Json -Depth 8 -Compress
|
||||||
|
# Ausgabe-Datei ohne trailing newline für sauberes curl --data-binary @-
|
||||||
|
[System.IO.File]::WriteAllText("$PWD/embed-payload.json", $payloadJson, [System.Text.UTF8Encoding]::new($false))
|
||||||
|
|
||||||
|
Write-Host "Payload size: $($payloadJson.Length) chars"
|
||||||
|
Write-Host "Embed title: $title"
|
||||||
|
Write-Host "Embed footer: $footerText"
|
||||||
|
|
||||||
|
# POST to the Hellion Forge changelog webhook. curl from PowerShell-Core
|
||||||
|
# so we can pipe the payload via stdin (--data-binary @-) and keep
|
||||||
|
# secrets out of process arg lists. One retry on 5xx, hard fail on 4xx.
|
||||||
|
- name: POST to Hellion Forge webhook
|
||||||
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
DISCORD_FORGE_WEBHOOK: ${{ secrets.DISCORD_FORGE_WEBHOOK }}
|
||||||
|
run: |
|
||||||
|
if ([string]::IsNullOrEmpty($env:DISCORD_FORGE_WEBHOOK)) {
|
||||||
|
throw "V7: DISCORD_FORGE_WEBHOOK secret is empty. Check Settings → Environments → Webhook."
|
||||||
|
}
|
||||||
|
|
||||||
|
$payloadFile = "$PWD/embed-payload.json"
|
||||||
|
if (-not (Test-Path $payloadFile)) {
|
||||||
|
throw "Embed payload file missing — previous step did not produce embed-payload.json"
|
||||||
|
}
|
||||||
|
|
||||||
|
$maxAttempts = 2
|
||||||
|
$attempt = 0
|
||||||
|
while ($attempt -lt $maxAttempts) {
|
||||||
|
$attempt++
|
||||||
|
Write-Host "POST attempt $attempt of $maxAttempts"
|
||||||
|
$tmpResp = "$PWD/.webhook-response"
|
||||||
|
$tmpHeaders = "$PWD/.webhook-headers"
|
||||||
|
# --silent suppresses progress; --show-error prints errors so
|
||||||
|
# the workflow log shows what happened. -w prints HTTP status
|
||||||
|
# to stdout for inspection. -o captures body for diagnosis,
|
||||||
|
# -D captures headers.
|
||||||
|
$rawStatus = Get-Content $payloadFile -Raw |
|
||||||
|
curl --silent --show-error `
|
||||||
|
--header 'Content-Type: application/json' `
|
||||||
|
--data-binary '@-' `
|
||||||
|
-D $tmpHeaders `
|
||||||
|
-o $tmpResp `
|
||||||
|
-w '%{http_code}' `
|
||||||
|
"$env:DISCORD_FORGE_WEBHOOK"
|
||||||
|
$status = [int]$rawStatus
|
||||||
|
Write-Host "HTTP status: $status"
|
||||||
|
|
||||||
|
if ($status -ge 200 -and $status -lt 300) {
|
||||||
|
Write-Host "Forge announce POST succeeded."
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
$bodySnippet = ""
|
||||||
|
if (Test-Path $tmpResp) {
|
||||||
|
$bodySnippet = (Get-Content $tmpResp -Raw -ErrorAction SilentlyContinue)
|
||||||
|
if ($bodySnippet.Length -gt 500) { $bodySnippet = $bodySnippet.Substring(0, 500) + " …" }
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($status -ge 400 -and $status -lt 500) {
|
||||||
|
# E2: 4xx is permanent — webhook revoked, channel deleted,
|
||||||
|
# payload malformed. No retry.
|
||||||
|
throw "E2: Discord-Webhook returned permanent $status. Body: $bodySnippet"
|
||||||
|
}
|
||||||
|
|
||||||
|
# E1: 5xx (or transport-level fail with status 0) — wait + retry once
|
||||||
|
if ($attempt -lt $maxAttempts) {
|
||||||
|
Write-Host "Transient $status — sleeping 30s before retry."
|
||||||
|
Start-Sleep -Seconds 30
|
||||||
|
} else {
|
||||||
|
throw "E1: Discord-Webhook returned transient $status after $maxAttempts attempts. Body: $bodySnippet"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
# Triggered when a vX.Y.Z tag is pushed. Builds the plugin against the
|
||||||
|
# current Dalamud staging branch, locates the latest.zip produced by
|
||||||
|
# DalamudPackager and attaches it to the matching Gitea Release.
|
||||||
|
#
|
||||||
|
# User-controlled inputs touched by this workflow:
|
||||||
|
# - the tag name (filtered by on.tags = v*, validated again at runtime
|
||||||
|
# against ^v\d+\.\d+\.\d+$ before being used in any string)
|
||||||
|
# All other values are either repo-controlled (paths under
|
||||||
|
# HellionChat/bin/Release derived from find / Get-ChildItem) or pinned
|
||||||
|
# URLs to goatcorp / gitea. Nothing from a webhook event payload (issue/PR
|
||||||
|
# titles, commit messages, etc.) flows into a run-step.
|
||||||
|
#
|
||||||
|
# Linux runner: gitea.com Cloud Actions only ships ubuntu-latest. The
|
||||||
|
# plugin csproj targets net10.0-windows, `dotnet build` cross-compiles on
|
||||||
|
# Linux when the Dalamud staging assemblies sit under $(HOME)/.xlcore/...
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
# Manual recovery trigger. Use Gitea's "Run workflow" UI and select the
|
||||||
|
# tag (e.g. v1.4.4) from the Ref dropdown - not main. The Validate tag
|
||||||
|
# ref step below hard-fails if a non-tag ref is selected, because the
|
||||||
|
# release-action reads GITHUB_REF directly and rejects anything that
|
||||||
|
# does not start with refs/tags/.
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Build and attach release ZIP
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 20
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# release-action@main reads GITHUB_REF directly (its action.yml
|
||||||
|
# does not declare a tag_name input). Validate up-front so manual
|
||||||
|
# dispatches from a branch ref fail loud here instead of burning
|
||||||
|
# a full build before the final step errors out with "ref X is
|
||||||
|
# not a tag".
|
||||||
|
- name: Validate tag ref
|
||||||
|
run: |
|
||||||
|
if [[ "${GITHUB_REF}" != refs/tags/v* ]]; then
|
||||||
|
echo "::error::Release workflow must run on a v*.X.Y tag ref, got ${GITHUB_REF}"
|
||||||
|
echo "::error::Push a tag, or pick the tag (not main) in the workflow_dispatch Ref dropdown."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
|
|
||||||
|
- name: Setup .NET 10
|
||||||
|
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5
|
||||||
|
with:
|
||||||
|
dotnet-version: 10.0.x
|
||||||
|
|
||||||
|
- name: Download Dalamud staging
|
||||||
|
run: |
|
||||||
|
hooks="$HOME/.xlcore/dalamud/Hooks/dev"
|
||||||
|
mkdir -p "$hooks"
|
||||||
|
curl -fsSL https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -o dalamud.zip
|
||||||
|
unzip -oq dalamud.zip -d "$hooks"
|
||||||
|
|
||||||
|
- name: Build (Release)
|
||||||
|
run: dotnet build HellionChat/HellionChat.csproj --configuration Release
|
||||||
|
|
||||||
|
- name: Locate latest.zip
|
||||||
|
id: locate
|
||||||
|
run: |
|
||||||
|
zip="$(find HellionChat/bin/Release -name latest.zip -print -quit)"
|
||||||
|
if [ -z "$zip" ]; then
|
||||||
|
echo "latest.zip not found under HellionChat/bin/Release" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Found: $zip"
|
||||||
|
echo "path=$zip" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# Build a release body from the matching changelog block in
|
||||||
|
# HellionChat.yaml plus a static install / docs footer. Fails the
|
||||||
|
# workflow if no block exists for the tagged version, which is the
|
||||||
|
# automated counterpart to the "yaml + repo.json + release body
|
||||||
|
# kept in sync" rule.
|
||||||
|
#
|
||||||
|
# GITHUB_REF_NAME is read via env: (not ${{ }} interpolation) so the
|
||||||
|
# tag value is treated as a PowerShell variable, not as inline shell
|
||||||
|
# text. The strict regex below rejects anything that is not a clean
|
||||||
|
# semver tag before it is used to build a string.
|
||||||
|
- name: Generate release body
|
||||||
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
# github.ref_name is the tag because Validate tag ref above
|
||||||
|
# already enforced refs/tags/v*. Read via env: so the value
|
||||||
|
# is a PowerShell variable, not inline shell text, and gets
|
||||||
|
# re-validated against the semver regex below.
|
||||||
|
TAG_NAME: ${{ github.ref_name }}
|
||||||
|
run: |
|
||||||
|
$tag = $env:TAG_NAME
|
||||||
|
if ($tag -notmatch '^v\d+\.\d+\.\d+$') {
|
||||||
|
throw "Refusing to generate release body for non-semver tag: $tag"
|
||||||
|
}
|
||||||
|
$version = $tag.Substring(1)
|
||||||
|
|
||||||
|
$yamlPath = "HellionChat/HellionChat.yaml"
|
||||||
|
$raw = Get-Content -Path $yamlPath -Raw
|
||||||
|
|
||||||
|
$marker = "changelog: |-"
|
||||||
|
$idx = $raw.IndexOf($marker)
|
||||||
|
if ($idx -lt 0) { throw "changelog block not found in $yamlPath" }
|
||||||
|
|
||||||
|
# changelog: is the last top-level key in the manifest, so
|
||||||
|
# everything after the marker is the literal block. Strip the
|
||||||
|
# 4-space yaml indent (prettier convention) from each line.
|
||||||
|
$afterMarker = $raw.Substring($idx + $marker.Length)
|
||||||
|
$changelogBody = (($afterMarker -split "`r?`n") | ForEach-Object {
|
||||||
|
if ($_ -match '^ ') { $_.Substring(4) } else { $_ }
|
||||||
|
}) -join "`n"
|
||||||
|
|
||||||
|
# Subblock convention: "**vX.Y.Z — <subtitle> (<date>)**"
|
||||||
|
# matches verify-changelog-sync.sh and slim-rule grep.
|
||||||
|
$header = "**v$version "
|
||||||
|
$start = $changelogBody.IndexOf($header)
|
||||||
|
if ($start -lt 0) {
|
||||||
|
throw "No changelog entry for version $version found in $yamlPath. Update the changelog block before tagging a release."
|
||||||
|
}
|
||||||
|
|
||||||
|
$rest = $changelogBody.Substring($start)
|
||||||
|
$nextHdr = $rest.IndexOf("`n`n**v", 1)
|
||||||
|
$trailer = $rest.IndexOf("`n`n---")
|
||||||
|
|
||||||
|
if ($nextHdr -ge 0 -and ($trailer -lt 0 -or $nextHdr -lt $trailer)) {
|
||||||
|
$currentBlock = $rest.Substring(0, $nextHdr).TrimEnd()
|
||||||
|
} elseif ($trailer -ge 0) {
|
||||||
|
$currentBlock = $rest.Substring(0, $trailer).TrimEnd()
|
||||||
|
} else {
|
||||||
|
$currentBlock = $rest.TrimEnd()
|
||||||
|
}
|
||||||
|
|
||||||
|
# Static install / docs / licence footer is maintained as a
|
||||||
|
# separate file so the workflow YAML stays clean (no embedded
|
||||||
|
# heredoc that would have to be indented under the run-block).
|
||||||
|
$footerPath = ".github/release-footer.md"
|
||||||
|
if (-not (Test-Path $footerPath)) {
|
||||||
|
throw "Release footer template not found: $footerPath"
|
||||||
|
}
|
||||||
|
$footer = Get-Content -Path $footerPath -Raw
|
||||||
|
|
||||||
|
$body = $currentBlock + "`n" + $footer
|
||||||
|
$body | Out-File -FilePath release-body.md -Encoding utf8 -NoNewline
|
||||||
|
|
||||||
|
Write-Host "Generated release body for $tag :"
|
||||||
|
Write-Host "----------------------------------------"
|
||||||
|
Write-Host $body
|
||||||
|
Write-Host "----------------------------------------"
|
||||||
|
|
||||||
|
# release-action@main only declares files/title/body/pre_release/
|
||||||
|
# draft/api_key/insecure as inputs (see its action.yml). It silently
|
||||||
|
# ignores anything else, including body_path and tag_name. The tag
|
||||||
|
# itself comes from GITHUB_REF, the body must be passed inline via
|
||||||
|
# body:, so we re-emit release-body.md as a step output first.
|
||||||
|
- name: Expose release body for release-action
|
||||||
|
id: body
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
{
|
||||||
|
echo 'content<<RELEASE_BODY_EOF'
|
||||||
|
cat release-body.md
|
||||||
|
echo 'RELEASE_BODY_EOF'
|
||||||
|
} >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# Gitea-native release action. Creates the release if the tag has no
|
||||||
|
# release yet, or updates the existing one with latest.zip attached
|
||||||
|
# and the generated body. The auto-injected GITHUB_TOKEN on Gitea
|
||||||
|
# Actions has Gitea-API scope and is sufficient for release write.
|
||||||
|
- name: Attach to Gitea release
|
||||||
|
uses: https://gitea.com/actions/release-action@main
|
||||||
|
with:
|
||||||
|
files: ${{ steps.locate.outputs.path }}
|
||||||
|
body: ${{ steps.body.outputs.content }}
|
||||||
|
api_key: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
name: Security
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, master]
|
||||||
|
pull_request:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 6 * * 1'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
scan:
|
||||||
|
uses: JonKazama-Hellion/security-workflows/.gitea/workflows/security-scan.yml@main
|
||||||
|
with:
|
||||||
|
# MessageStore.cs uses string-interpolation in CommandText for table
|
||||||
|
# names and clause-joins that come from internal code constants, not
|
||||||
|
# user input. Values are bound via SqlParameter, the SQL surface is
|
||||||
|
# local-only inside a Dalamud plugin. Semgrep matches the pattern
|
||||||
|
# without dataflow, so it flags those eight call sites; CodeQL
|
||||||
|
# would not. Suppressed for this repo only.
|
||||||
|
semgrep-exclude-rules: 'csharp.lang.security.sqli.csharp-sqli.csharp-sqli'
|
||||||
Executable
+3
@@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# .githooks/pre-push — invokes preflight.sh (A/B/C/D=build).
|
||||||
|
exec scripts/preflight.sh
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# HellionChat is a hobby project and does not solicit funding.
|
||||||
|
#
|
||||||
|
# If you want to support the work that made HellionChat possible,
|
||||||
|
# please consider supporting the upstream Chat 2 maintainers:
|
||||||
|
#
|
||||||
|
# Infiziert90 (Infi): https://ko-fi.com/infiii
|
||||||
|
# Anna Clemens: https://ko-fi.com/lojewalo
|
||||||
|
#
|
||||||
|
# Both Ko-fi pages are also linked in the plugin's settings panel.
|
||||||
|
|
||||||
|
# No platforms enabled — keep this file present so GitHub recognises
|
||||||
|
# the project as having considered funding without showing a Sponsor
|
||||||
|
# button on the repository page.
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
name: Bug report
|
||||||
|
description: Something in HellionChat is broken or behaves wrong
|
||||||
|
labels:
|
||||||
|
- bug
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Thanks for reporting. Please fill in the fields below so I can
|
||||||
|
reproduce the issue. If this is a security issue, stop here and
|
||||||
|
report it privately to [kontakt@hellion-media.de](mailto:kontakt@hellion-media.de?subject=%5BHellionChat%20Security%5D)
|
||||||
|
instead.
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: version
|
||||||
|
attributes:
|
||||||
|
label: HellionChat version
|
||||||
|
description: From Settings → Information → Version
|
||||||
|
placeholder: '0.5.4'
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: dropdown
|
||||||
|
id: platform
|
||||||
|
attributes:
|
||||||
|
label: Platform
|
||||||
|
options:
|
||||||
|
- Windows (XIVLauncher)
|
||||||
|
- Linux (XIVLauncher Core)
|
||||||
|
- macOS (XIVLauncher Core / wine)
|
||||||
|
- Other
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: what-happened
|
||||||
|
attributes:
|
||||||
|
label: What happened
|
||||||
|
description: Plain description, no log dumps yet
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: expected
|
||||||
|
attributes:
|
||||||
|
label: What you expected
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: steps
|
||||||
|
attributes:
|
||||||
|
label: How to reproduce
|
||||||
|
description: Step-by-step from "open settings" or "log in" through to the broken behaviour
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: log
|
||||||
|
attributes:
|
||||||
|
label: Relevant /xllog excerpt
|
||||||
|
description: Filter for "HellionChat" if the log is huge
|
||||||
|
render: text
|
||||||
|
|
||||||
|
- type: checkboxes
|
||||||
|
id: confirm
|
||||||
|
attributes:
|
||||||
|
label: Pre-flight
|
||||||
|
options:
|
||||||
|
- label: I am running the latest version of HellionChat
|
||||||
|
required: true
|
||||||
|
- label: I have searched existing issues for duplicates
|
||||||
|
required: true
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
|
|
||||||
|
contact_links:
|
||||||
|
- name: Security vulnerability
|
||||||
|
url: mailto:kontakt@hellion-media.de?subject=%5BHellionChat%20Security%5D
|
||||||
|
about: Do not open a public issue for security problems. Report by e-mail instead.
|
||||||
|
|
||||||
|
- name: Upstream Chat 2 issue
|
||||||
|
url: https://github.com/Infiziert90/ChatTwo/issues
|
||||||
|
about:
|
||||||
|
If the issue exists in upstream Chat 2 too, please report it there so the original maintainers see it as well.
|
||||||
|
|
||||||
|
- name: Discord
|
||||||
|
url: https://discord.com/users/j.j_kazama
|
||||||
|
about: Quick questions, casual feedback. Bug reports still go through the issue tracker for tracking.
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
name: Feature request
|
||||||
|
description: Suggest a feature or enhancement for HellionChat
|
||||||
|
labels:
|
||||||
|
- enhancement
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Thanks for the suggestion. HellionChat focuses on privacy by
|
||||||
|
default and a small, well-scoped feature set. Suggestions that
|
||||||
|
align with that scope are easier to accept than ones that pull
|
||||||
|
the plugin toward "do everything".
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: problem
|
||||||
|
attributes:
|
||||||
|
label: What problem are you trying to solve
|
||||||
|
description: The user-side problem, not the proposed solution yet
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: solution
|
||||||
|
attributes:
|
||||||
|
label: What you would like HellionChat to do
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: alternatives
|
||||||
|
attributes:
|
||||||
|
label: Alternatives you have considered
|
||||||
|
description: Other plugins, manual workarounds, settings combinations
|
||||||
|
|
||||||
|
- type: dropdown
|
||||||
|
id: scope
|
||||||
|
attributes:
|
||||||
|
label: Scope estimate from your side
|
||||||
|
options:
|
||||||
|
- 'Small (one tab, one toggle, one filter)'
|
||||||
|
- 'Medium (a settings section, persistent state, one new file)'
|
||||||
|
- 'Large (architectural, touches the message pipeline or the database)'
|
||||||
|
- "I don't know"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: checkboxes
|
||||||
|
id: confirm
|
||||||
|
attributes:
|
||||||
|
label: Pre-flight
|
||||||
|
options:
|
||||||
|
- label: I have searched existing issues for similar requests
|
||||||
|
required: true
|
||||||
|
- label: I understand HellionChat is a privacy-focused fork and not a feature parity tool with upstream Chat 2
|
||||||
|
required: true
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
<!--
|
||||||
|
Thanks for contributing to HellionChat. Please fill in the sections
|
||||||
|
below so the review goes quickly. Delete sections that genuinely do
|
||||||
|
not apply, but do not delete the whole template.
|
||||||
|
|
||||||
|
If this is a security fix, stop here and report it privately by
|
||||||
|
e-mail instead of opening a public PR:
|
||||||
|
mailto:kontakt@hellion-media.de?subject=%5BHellionChat%20Security%5D
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
<!-- One or two sentences. What does this PR change and why. -->
|
||||||
|
|
||||||
|
## Type of change
|
||||||
|
|
||||||
|
<!-- Tick all that apply. -->
|
||||||
|
|
||||||
|
- [ ] Bug fix (non-breaking change that fixes an issue)
|
||||||
|
- [ ] New feature (non-breaking change that adds behaviour)
|
||||||
|
- [ ] Breaking change (config migration, removed feature, or behaviour change that user-visible
|
||||||
|
defaults rely on)
|
||||||
|
- [ ] Documentation only
|
||||||
|
- [ ] Translation update
|
||||||
|
- [ ] Build, CI or tooling change
|
||||||
|
|
||||||
|
## Linked issue
|
||||||
|
|
||||||
|
<!-- e.g. "Closes #42" or "Refs #42". For trivial typo fixes, "n/a". -->
|
||||||
|
|
||||||
|
## How I tested this
|
||||||
|
|
||||||
|
<!--
|
||||||
|
- Built locally with `dotnet build -c Release`
|
||||||
|
- Ran `dotnet test`
|
||||||
|
- Loaded the plugin in-game on Windows / Linux / macOS via XIVLauncher
|
||||||
|
- Specific scenarios I exercised in-game
|
||||||
|
-->
|
||||||
|
|
||||||
|
## User-visible changes
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Anything the end user will notice. New settings, changed defaults,
|
||||||
|
new commands, new translations, removed behaviour. If none, write
|
||||||
|
"none".
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Compatibility notes
|
||||||
|
|
||||||
|
<!--
|
||||||
|
- Does this require a configuration migration? If yes, which version
|
||||||
|
bump and is it covered by the existing migration tests?
|
||||||
|
- Does this change the schema in MessageStore?
|
||||||
|
- Does this change the repo.json or HellionChat.yaml manifest fields?
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
|
||||||
|
- [ ] I have read [CONTRIBUTING.md](../CONTRIBUTING.md) and
|
||||||
|
[CODE_OF_CONDUCT.md](../CODE_OF_CONDUCT.md).
|
||||||
|
- [ ] My change matches the existing code style (`.editorconfig`).
|
||||||
|
- [ ] I added or updated tests where the existing test infrastructure made that practical, or I have
|
||||||
|
explained why tests are not applicable.
|
||||||
|
- [ ] I updated the README, in-plugin strings or documentation if my change is user-visible.
|
||||||
|
- [ ] I did not include any AI-generated code without disclosing it in the PR description (see
|
||||||
|
[AI_DISCLOSURE.md](../docs/AI_DISCLOSURE.md)).
|
||||||
|
- [ ] I confirm my contribution is released under the [EUPL-1.2](../LICENSE).
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
version: 2
|
||||||
|
|
||||||
|
updates:
|
||||||
|
# NuGet package updates for the plugin project. Weekly cadence keeps the
|
||||||
|
# noise down while still catching transitive security advisories within
|
||||||
|
# a few days of disclosure.
|
||||||
|
- package-ecosystem: nuget
|
||||||
|
directory: /HellionChat
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
day: monday
|
||||||
|
time: '07:00'
|
||||||
|
timezone: Europe/Berlin
|
||||||
|
open-pull-requests-limit: 5
|
||||||
|
labels:
|
||||||
|
- dependencies
|
||||||
|
- nuget
|
||||||
|
commit-message:
|
||||||
|
prefix: 'chore(deps)'
|
||||||
|
groups:
|
||||||
|
patches:
|
||||||
|
update-types:
|
||||||
|
- patch
|
||||||
|
minor:
|
||||||
|
update-types:
|
||||||
|
- minor
|
||||||
|
|
||||||
|
# GitHub Actions versions in .github/workflows. Lower cadence because
|
||||||
|
# Action releases ship less frequently and are usually safe to defer
|
||||||
|
# for a month.
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
||||||
|
time: '07:00'
|
||||||
|
timezone: Europe/Berlin
|
||||||
|
open-pull-requests-limit: 3
|
||||||
|
labels:
|
||||||
|
- dependencies
|
||||||
|
- github-actions
|
||||||
|
commit-message:
|
||||||
|
prefix: 'chore(actions)'
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
subtitle: "Theme Foundation"
|
||||||
|
versionsnatur: "Major-UI-Cycle"
|
||||||
|
---
|
||||||
|
|
||||||
|
- Theme-Engine mit fünf Built-In-Themes: Hellion Arctic (Default), Chat 2 Klassik, Event Horizon,
|
||||||
|
Moonlit Bloom, Mint Grove
|
||||||
|
- Settings öffnet jetzt eine Card-Grid-Übersicht — Klick auf eine Card führt in den Detail-View,
|
||||||
|
Breadcrumb und ESC zurück zur Übersicht
|
||||||
|
- Themes-Tab mit Mini-Mockup pro Theme, Live-Switch beim Klick
|
||||||
|
- Eigene Themes als JSON in `pluginConfigs/HellionChat/themes/` — Beispiel-Vorlage wird beim ersten
|
||||||
|
Start automatisch abgelegt
|
||||||
|
- Optional pro Theme eigene Chat-Channel-Farben mit Übernehmen/Behalten-Banner — niemals automatisch
|
||||||
|
überschrieben
|
||||||
|
- Plugin-Icon zum Hellion-Forge-Hammer gewechselt
|
||||||
|
- Migration v13 → v14: alle User landen auf Hellion Arctic. Wer den Upstream-Look will, wählt Chat 2
|
||||||
|
Klassik in Settings → Themes
|
||||||
|
- Anleitung zum Schreiben eigener Themes: `docs/THEME-AUTHORING.md`
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
subtitle: "Layout Refresh"
|
||||||
|
versionsnatur: "Major-UI-Cycle"
|
||||||
|
---
|
||||||
|
|
||||||
|
- Sidebar im neuen Look: fix 44 px breit, nur Icons, Tab-Name als Tooltip beim Hover, vertikale
|
||||||
|
Akzent-Pill markiert den aktiven Tab
|
||||||
|
- Top-Tabs bekommen eine Akzent-Underline statt Background-Fill am aktiven Tab
|
||||||
|
- Pro Tab eigenes Icon wählbar in Einstellungen → Tabs (FontAwesome-Pool)
|
||||||
|
- Auto-Tell-Tabs sind jetzt visuell unterscheidbar: jeder Tell-Partner bekommt ein eigenes Icon
|
||||||
|
(envelope/star/heart/bell/bookmark/flag/fire) plus eigene Farbe aus 12-Farb-Palette — 84
|
||||||
|
Kombinationen, gleicher Partner ergibt konsistent dieselbe
|
||||||
|
- Pulsierender roter Dot oben rechts am Sidebar-Icon zeigt ungelesene Nachrichten an. Sanft,
|
||||||
|
2-Sekunden-Cycle, deaktivierbar über `Configuration.ReduceMotion` (UI-Toggle in v1.3.0)
|
||||||
|
- Bottom-Status-Bar (22 px) mit fünf Live-Slots: aktiver Channel + Color-Dot, Privacy-Badge,
|
||||||
|
Tab/Message-Counter, Auto-Tell-Counter, Plugin-Version. Update 1×/Sek
|
||||||
|
- Card-Rows als Default-Message-Render: Sender-Header in Channel-Farbe, Body neue Zeile, dezenter
|
||||||
|
Trenner. `Compact Density`-Toggle in Aussehen schaltet zurück auf den Einzeiler
|
||||||
|
- Bug-Fix: Settings speichern löscht den Chat-Verlauf nicht mehr. Refilter läuft jetzt nur wenn
|
||||||
|
Filter-relevante Settings geändert wurden — Cosmetic-Änderungen lassen den Chat unverändert.
|
||||||
|
Persistente und Auto-Tell-Tabs überleben beide
|
||||||
|
- Bug-Fix: Hellion-Schrift (Exo 2) blockt die Schriftgröße nicht mehr — 4K-User können hochskalieren
|
||||||
|
- Migration v14 → v15: alte Theme-Felder entfernt, alle anderen Settings bleiben
|
||||||
|
|
||||||
|
Animation-Polish (Lerps, Theme-Crossfade, Quick-Picker) folgt in v1.3.0.
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
subtitle: "Settings Cleanup"
|
||||||
|
versionsnatur: "UX-Polish-Cycle"
|
||||||
|
---
|
||||||
|
|
||||||
|
- Settings-Übersicht thematisch re-sortiert: zusammenhängende Optionen wohnen jetzt zusammen, jede
|
||||||
|
Card hat einen kurzen Untertitel — kein Raten mehr wo eine Setting steckt
|
||||||
|
- Drei neue Cards: **Theme & Layout** (Theme-Picker, Fenster-Style, Zeitstempel-Style), **Schriften
|
||||||
|
& Farben** (Schriftart, Schriftgröße, Chat-Farben pro Channel), **Daten-Verwaltung**
|
||||||
|
(Aufbewahrung, Cleanup, Export, DB-Viewer, Advanced-Tools — vorher zwischen Datenschutz und
|
||||||
|
Datenbank verteilt)
|
||||||
|
- Datenschutz fokussiert sich jetzt auf eine Aufgabe: den Privacy-Filter
|
||||||
|
- Der Auto-Tell-Tabs-History-Preload-Slider ist von Datenschutz nach Chat → Auto-Tell-Tabs umgezogen
|
||||||
|
- KeybindMode wohnt jetzt unter Allgemein → Eingabe statt unter Sprache
|
||||||
|
- Vier tote Schema-Felder entfernt (alle obsolet seit der Theme-Engine in v1.1.0):
|
||||||
|
`Stilüberschreiben`-Toggle, `Stilname`-Auswahl, alter `WindowAlpha`-Slider, ungenutztes
|
||||||
|
`ShowThemeQuickPicker`
|
||||||
|
- Migration v15 → v16: alter `WindowAlpha`-Wert wird automatisch nach
|
||||||
|
`Theme & Layout → Fenster-Style → Fenster-Transparenz` gemappt (nur wenn der Slider noch auf
|
||||||
|
Default 0.85 stand, sonst gewinnt der User-Wert). Backup der Pre-v16-Config liegt unter
|
||||||
|
`pluginConfigs/HellionChat.json.pre-v16-backup`. User die `Stilüberschreiben` aktiv hatten sehen
|
||||||
|
einen einmaligen Hinweis-Toast
|
||||||
|
- UX-Default-Bumps für Bestand-User mit Default-Werten: Card-Rows-Layout zurück auf Single-Line, NG+
|
||||||
|
standardmäßig hidden, gleiche Zeitstempel werden zusammengefasst, MaxLinesToRender auf
|
||||||
|
konservativere 2500
|
||||||
|
- Frische Installs starten mit dem Hellion-Brand-Chat-Color-Preset out-of-the-box (der
|
||||||
|
First-Run-Wizard hat keine Preset-Wahl)
|
||||||
|
- Hinweis zum Window-Transparenz-Slider in der Beschreibung: Dalamud's per-Window-Hamburger-Menü
|
||||||
|
(oben rechts in der Titelleiste) bietet eigene Overrides für Deckkraft, Hintergrund-Blur, Anpinnen
|
||||||
|
und Durchklick — die haben Vorrang über unseren Slider für das jeweilige Fenster
|
||||||
|
|
||||||
|
Pure UX-Polish, keine neuen Features. Nächster Cycle (v1.3.0): Animation-Polish (Lerps,
|
||||||
|
Theme-Crossfade, Quick-Picker) wie ursprünglich geplant.
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
subtitle: "Theme Expansion"
|
||||||
|
versionsnatur: "Theme-Pack-Patch"
|
||||||
|
---
|
||||||
|
|
||||||
|
- Vier neue Built-in-Themes verlängern die Auswahl im Picker — keine Engine-Änderung, keine Settings
|
||||||
|
angefasst, einfach mehr Farboptionen
|
||||||
|
- **Night Blue** — Royal Blue auf tiefem Marineblau. Kühles Tech-Dashboard-Mood, bewusst neutral
|
||||||
|
gehalten damit es sich nicht mit den Brand-Themes beißt
|
||||||
|
- **Indigo Violet** — Royal Violet auf Deep Indigo mit Türkis-Mint-Counter für
|
||||||
|
Aurora-Glitter-Stimmung. Schwester von Event Horizon, aber dunkler und dichter; der Türkis-Akzent
|
||||||
|
hält die beiden klar auseinander
|
||||||
|
- **Forge Merchantman** — Patina-Bronze auf Workshop-Slate mit warmem Bernstein-Counter. Hellion
|
||||||
|
Forge bekommt ein eigenes Theme im Plugin selbst — Schwester von Hellion Arctic, aber grüner und
|
||||||
|
wärmer statt kaltem Cyan
|
||||||
|
- **Hellion Spectrum** — Farbenblind-sichere Channel-Farben (Deuteranopie/Protanopie) auf Basis der
|
||||||
|
Wong/Okabe-Ito-Palette. Channel-Identität bleibt erhalten (Tell pink, Yell gelb, Shout orange,
|
||||||
|
Party blau, FC grün); die Töne sind so gewählt dass jeder Channel auch unter Rot-Grün-Schwäche
|
||||||
|
klar trennbar bleibt. Deckt rund 99 % aller CVD-Fälle ab
|
||||||
|
- Kein Schema-Bump, keine Migration. Das Default-Theme bleibt **Hellion Arctic**, eigene
|
||||||
|
Custom-Themes laufen unverändert weiter
|
||||||
|
- Theme-Katalog wächst damit von fünf auf neun Built-ins
|
||||||
|
|
||||||
|
Reines Theme-Pack zwischen v1.2.1 und dem nächsten Polish-Cycle. Eine Tritan-Variante (Spectrum für
|
||||||
|
Blau-Gelb-Schwäche) kann später nachgeliefert werden, falls Bedarf kommt.
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
subtitle: "Plugin Integrations: Honorific"
|
||||||
|
versionsnatur: "Plugin-Integration-Cycle 1"
|
||||||
|
---
|
||||||
|
|
||||||
|
- Erste Plugin-Integration eingebaut, Cycle 1 von 6 auf der Roadmap
|
||||||
|
- **Honorific-Custom-Titles im Chat-Header** — der Titel den du in Honorific gesetzt hast erscheint
|
||||||
|
jetzt links über dem Message-Log mit der von dir gewählten Farbe, Auto-Hide wenn Honorific nicht
|
||||||
|
installiert ist oder kein Custom-Titel aktiv ist
|
||||||
|
- **Krone-Icon plus Tooltip** vor dem Titel-Text, damit klar ist woher der Slot kommt ohne dass der
|
||||||
|
User raten muss
|
||||||
|
- **Neuer Integrations-Settings-Tab** mit Status-Indikator (erkannt, nicht installiert,
|
||||||
|
inkompatibel) und Toggle. Plus Vorschau-Block der die fünf weiteren geplanten Cycles ankündigt:
|
||||||
|
Kontextmenü-Aktionen, Smart Notifications (NotificationMaster), RP-Status-Block (Moodles und
|
||||||
|
LightlessClient), ExtraChat-Channels, Quick-DM-Button (XIVInstantMessenger)
|
||||||
|
- **Maintainer-Attribution** im Tab als Höflichkeits-Geste, zwei Buttons zum Honorific-Repo und zum
|
||||||
|
Caraxi-Profil. Plus Hellion-Forge-Discord-Button für Community-Vorschläge zu künftigen
|
||||||
|
Integrationen
|
||||||
|
- Keine Migration, keine Schema-Änderung. Wer Honorific eh schon nutzt sieht den Custom-Titel
|
||||||
|
automatisch sobald HellionChat aktualisiert
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
subtitle: Critical Lifecycle Fixes
|
||||||
|
versionsnatur: Stability-Hotfix
|
||||||
|
---
|
||||||
|
|
||||||
|
**Hellion Chat 1.4.0 — Critical Lifecycle Fixes**
|
||||||
|
|
||||||
|
Erster Sub-Patch der v1.4.x Polish-Sweep-Serie. Sieben bekannte Lifecycle- und Race-Bugs aus den
|
||||||
|
Audit-Pässen abgearbeitet, bevor Performance- und Architektur-Refactors draufkommen.
|
||||||
|
|
||||||
|
- **SQLite-Dispose** lehnt sich nicht mehr an GC-Druck zur Datei-Freigabe an, Pooling=false auf der
|
||||||
|
Connection macht den manuellen GC.Collect überflüssig
|
||||||
|
- **Worker-Threads** (PendingMessage, RetentionSweep) sind jetzt explizit IsBackground=true, das
|
||||||
|
Plugin-Domain kann sauber unloaden bei XIVLauncher-Reload ohne darauf zu warten
|
||||||
|
- **EmoteCache-Loader** von async-void auf async-Task mit shared Task-Tracker, drain-on-Dispose.
|
||||||
|
Kein Schreib-Risiko mehr auf disposed EmoteImages-Einträge nach Plugin-Reload
|
||||||
|
- **DisposeAsync-Timeout** (10s) warnt jetzt laut statt silent zu failen
|
||||||
|
- **Plugin-Dispose** flushed pending DeferredSave bevor Services abgebaut werden,
|
||||||
|
Settings-Änderungen aus den letzten Frames vor Disable überleben jetzt zuverlässig
|
||||||
|
- **v13→v14 Config-Migration** liest pre-v13-Backup und überträgt HellionThemeWindowOpacity in das
|
||||||
|
neue WindowOpacity-Feld statt auf 0.85 zurückzufallen
|
||||||
|
|
||||||
|
Keine Schema-Bumps, keine User-sichtbaren Funktions-Änderungen außer dass Reload und Shutdown
|
||||||
|
spürbar sauberer laufen.
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
subtitle: Theme Engine Performance
|
||||||
|
versionsnatur: Performance-Patch
|
||||||
|
---
|
||||||
|
|
||||||
|
**Hellion Chat 1.4.1 — Theme Engine Performance**
|
||||||
|
|
||||||
|
Zweiter Sub-Patch der v1.4.x Polish-Sweep-Serie. Heap-Pressure aus dem Theme-Engine-Render-Pfad
|
||||||
|
eliminiert, Custom-Theme- Hot-Reload überlebt transiente File-Locks beim Editor-Save. Plus zehnter
|
||||||
|
Built-In und überarbeitete Author-Credits.
|
||||||
|
|
||||||
|
- **ABGR-Cache auf den Theme-Records.** Beim Theme-Register (Built-In oder Custom) werden alle
|
||||||
|
Color-Slots einmalig in ABGR-Pack-Form vor-konvertiert. HellionStyle.PushGlobal liest aus dem
|
||||||
|
Cache statt pro Slot pro Frame durch ColourUtil.RgbaToAbgr zu jagen. Real gemessene
|
||||||
|
Frame-Time-Recovery: **~13 %** in typischer Render-Szene (Plan-Erwartung war 2-6 % konservativ,
|
||||||
|
real ~10-15 %)
|
||||||
|
- **Custom-Theme File-Lock-Härtung.** Wenn der User ein Theme-JSON gerade speichert während
|
||||||
|
HellionChat reloaden will, fängt der Loader jetzt explizit Sharing-Violation und Lock-Violation
|
||||||
|
ab. Last-Known-Good-Snapshot bleibt im Picker, beim nächsten Tick wird automatisch retry'd —
|
||||||
|
vorher fiel das Theme aus der Liste bis zum Plugin-Reload
|
||||||
|
- **Defensive Cache-Refresh beim Theme-Switch.** Falls ein Theme auf einem alten Pfad ohne
|
||||||
|
Cache-Fill in den Speicher gekommen ist, holt Switch() das beim Anwenden nach
|
||||||
|
- **Synthwave Sunset als zehnter Built-In.** Hot Magenta + Cyan auf Mitternachts-Violett,
|
||||||
|
80s-Neon-Grid-Vibes für Late-Night-Raids
|
||||||
|
- **Author-Credits konsolidiert.** Brand-Themes laufen jetzt unter „Hellion Forge". Mint Grove und
|
||||||
|
Forge Merchantman werden Carla Beleandis als Community-Geste zugeschrieben.
|
||||||
|
|
||||||
|
Keine Schema-Bumps, keine User-sichtbaren Funktions- Änderungen außer dass die Frames in
|
||||||
|
Theme-getrieben rendernden Szenen merklich glatter laufen und ein neues Theme im Picker steht.
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
subtitle: Symbol-Picker und Tell-History Fix
|
||||||
|
versionsnatur: Feature-Patch + Hotfix
|
||||||
|
---
|
||||||
|
|
||||||
|
- Symbol-Picker im Chat-Eingang: ein kleiner Smile-Button links neben dem Kanal-Indikator öffnet ein
|
||||||
|
Popup mit zwei Tabs. Der erste listet alle 161 FFXIV-PUA-Glyphen (Dalamuds SeIconChar); der zweite
|
||||||
|
trägt 97 verifizierte BMP-Symbole (Latin-Marken, Währungen, das ganze griechische Alphabet,
|
||||||
|
Geometrie, Spielkarten, Noten) — jedes davon über `/echo` und `/say` in einer vierrundigen
|
||||||
|
Whitelist-Probe durchgereicht, damit der Channel-Render dem entspricht, was der Picker anzeigt.
|
||||||
|
Klick fügt das Symbol an der Cursor-Position ein, Multi-Insert lässt das Popup offen, eine
|
||||||
|
Recent-Used-Leiste zeigt die letzten sechzehn Picks über beide Tabs. Toggle in Settings → Chat →
|
||||||
|
Nachrichten-Verhalten, Default an.
|
||||||
|
- Verlauf in angepinnten Tell-Tabs lädt wieder vollständig: ein versteckter 500-Zeilen-Scan-Cap in
|
||||||
|
PreloadHistory hat das User-Setting `AutoTellTabsHistoryPreload` überschrieben, wodurch
|
||||||
|
weniger-frequente Tell-Partner ihren Backlog verloren haben sobald die Scan-Schicht mit anderen
|
||||||
|
Chat-Partnern voll lief. Cap ist raus, der Index auf `(Receiver, Date)` hält die Query schnell.
|
||||||
|
- Slash-Command-Teardown: /hellion, /hellionView, /hellionDebugger (und im Debug-Build
|
||||||
|
/hellionSeString) sind als private Felder gecached. Plugin-Dispose detached die echte
|
||||||
|
Registrierung, statt mit identischen Args neu zu registrieren — schließt eine latente
|
||||||
|
Wartungs-Falle aus v1.4.9.
|
||||||
|
- v1.4.x-Polish-Sweep endet hier. Der ImGuiListClipper-Refactor von der v1.4.10-Reserve-Liste wurde
|
||||||
|
gecancelt, nachdem der Cross- Plattform-Smoke gezeigt hat dass das Scroll-Gummi ein Wine/Linux-
|
||||||
|
Quirk ist — Windows-User haben es nie gesehen. Spike dafür kommt in einem späteren Patch. Nächster
|
||||||
|
Major-Cycle ist v1.5.0 mit der DI-Container-Adoption (`Microsoft.Extensions.Hosting` +
|
||||||
|
`ILogger<T>`) nach dem Lightless-Vorbild.
|
||||||
|
- Migration v17 unverändert: kein Schema-Bump, kein Config-Migrations-Aufwand.
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
subtitle: ChatLog Frame-Hot-Path
|
||||||
|
versionsnatur: Performance-Patch
|
||||||
|
---
|
||||||
|
|
||||||
|
**Hellion Chat 1.4.2 — ChatLog Frame-Hot-Path**
|
||||||
|
|
||||||
|
Dritter Sub-Patch der v1.4.x Polish-Sweep-Serie. Drei Per-Frame-Allokations-Quellen aus dem
|
||||||
|
ChatLogWindow-Render- Pfad und der Settings-StatusBar eliminiert.
|
||||||
|
|
||||||
|
- **Card-Mode-Border-Loop entlastet.** DrawMessages hebt Theme, DrawList, Window-Left, Window-Right
|
||||||
|
und die ABGR- Border-Color einmalig vor den Per-Message-Loop. Bei 100 sichtbaren Messages sind das
|
||||||
|
gut 500 redundante P/Invokes und Property-Reads, die der Hoist eliminiert. Pop-Out- Heavy-Setups
|
||||||
|
(mehrere parallele Chat-Windows) profitieren proportional, weil der Hoist pro DrawMessages-Call
|
||||||
|
greift, also pro Window
|
||||||
|
- **Auto-Tell Tab-Tint und Icon gecached.** Die Hash-Color- Berechnung für Auto-Tell-Tabs lief pro
|
||||||
|
Tab pro Frame, mit zwei String-Allokationen pro Tab (eine für Tint-Hash, eine für Icon-Hash). Der
|
||||||
|
neue TabTintCache liest pre-computed Werte aus dem Tab und rechnet nur neu wenn das Tell-Target
|
||||||
|
drifted. Beide Caches haben separate Validation-Keys, also keine Cross-Invalidation zwischen Tint-
|
||||||
|
und Icon-Pfad. AutoTellTabTint selbst bleibt pure Hash-Helper, weiterhin ohne Tab-Awareness
|
||||||
|
- **StatusBar-Aggregation hinter Cache-Gate.** Die Status- Leiste am unteren Window-Rand summiert
|
||||||
|
die Tab-Message- Counts und zählt die Auto-Tell-Tabs pro Frame. Der Cache- Gate (1 Sekunde) lag
|
||||||
|
bisher hinter den LINQ-Pfaden, also liefen Sum und Count trotzdem pro Frame. Jetzt vor dem Gate,
|
||||||
|
plus die LINQ-Pfade durch eine Single-Pass-Foreach ersetzt. Die Aggregation läuft auf etwa 1 % der
|
||||||
|
Frames
|
||||||
|
|
||||||
|
Realistische Frame-Time-Recovery: 2-5 % in typischen Szenen, Pop-Out-Heavy-Setups potenziell mehr
|
||||||
|
durch die Card-Border- Multiplikation pro Window.
|
||||||
|
|
||||||
|
Keine Schema-Bumps, keine User-sichtbaren Funktions- Änderungen außer dass die Frames im Chat-Log
|
||||||
|
und in der Settings-Statusleiste merklich glatter laufen.
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
subtitle: Async-Lifecycle + Gitea-Cutover
|
||||||
|
versionsnatur: Architecture-Refactor
|
||||||
|
---
|
||||||
|
|
||||||
|
**Hellion Chat 1.4.3 — Plugin-Load Async-Init + Repo-Cutover**
|
||||||
|
|
||||||
|
Vierter Sub-Patch der v1.4.x Polish-Sweep-Serie. Plugin- Lifecycle auf Dalamud's
|
||||||
|
`IAsyncDalamudPlugin`-API migriert und das Custom-Repo zieht von GitHub auf Gitea um.
|
||||||
|
|
||||||
|
- **Async-Plugin-Architektur.** Konstruktor übernimmt nur noch die Bootstrap-Essentials
|
||||||
|
(Config-Load, Language-Init, Conflict-Detection). Migrationen, Service-Allokationen,
|
||||||
|
Window-Konstruktion und Hook-Subscription wandern in LoadAsync, sodass Dalamud die UI während der
|
||||||
|
schweren Arbeit responsive halten kann. Per-Line-CaptureFailure in DisposeAsync mirrort
|
||||||
|
LightlessSync's Pattern, plus Idempotency-Guard gegen Reload-Races
|
||||||
|
- **Custom-Repo-URL umgezogen auf Gitea.** Bestehende Tester müssen einmalig in XIVLauncher die
|
||||||
|
Custom-Repo-URL auf
|
||||||
|
`https://gitea.hellion-forge.cloud/JonKazama-Hellion/HellionChat/raw/branch/main/repo.json`
|
||||||
|
umstellen, dann XIVLauncher neu starten. Das alte GitHub-Repo bleibt als eingefrorener
|
||||||
|
v1.4.2-Snapshot stehen und wird nicht mehr aktualisiert
|
||||||
|
- **Schema-Gate statt Migrations-Kette.** Die v9 → v16 Migrationen sind raus, ersetzt durch einen
|
||||||
|
harten Schema-Check in Phase 1. Configs auf Schema v16+ laden direkt; ältere Configs (vor v1.2.1)
|
||||||
|
bekommen jetzt eine klare „install v1.4.2 first"-Fehlermeldung statt eines impliziten
|
||||||
|
Migrations-Pfads
|
||||||
|
- **AutoTranslate-Cache läuft im Hintergrund.** Der Cache füllt sich jetzt fire-and-forget statt
|
||||||
|
blockierend im Plugin-Load. Trade-off: die erste Auto-Translate-Nutzung einer Session kann einen
|
||||||
|
kurzen Hitch haben, dafür kein 300-ms-Block beim Plugin-Start
|
||||||
|
- **Plugin-Load-Zeit ehrlich.** Median 3,7 s über fünf Reloads, vergleichbar mit v1.4.2. Der
|
||||||
|
Async-Refactor ist Foundation für künftige Lazy-Init-Optimierungen (v1.4.4) und
|
||||||
|
Code-Architektur-Hygiene, kein direkter User-spürbarer Speed-Win in dieser Release
|
||||||
|
|
||||||
|
Keine User-sichtbaren Funktions-Änderungen außer dem Repo-URL-Update. Settings, Themes und Tabs
|
||||||
|
bleiben unangetastet.
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
subtitle: Threading- und IPC-Sicherheits-Politur
|
||||||
|
versionsnatur: Wartung und Robustheit
|
||||||
|
---
|
||||||
|
|
||||||
|
**Hellion Chat 1.4.4 — Threading- und IPC-Sicherheits-Politur**
|
||||||
|
|
||||||
|
Fünfter Sub-Patch der v1.4.x Polish-Sweep-Serie. Threading-Annahmen werden explizit pro Methode
|
||||||
|
dokumentiert, ein Hot-Path-Lock im Auto-Tell-Tab-Counter fällt weg, IPC-Cleanup wird sichtbar wenn
|
||||||
|
er fehlschlägt und der Privacy-Filter spricht jetzt bei unbekannten ChatTypes.
|
||||||
|
|
||||||
|
- **AutoTellTabsService Hot-Path-Lock entfernt.** `ActiveTempTabCount` hat bisher pro Render-Frame
|
||||||
|
ein LINQ-Count unter einem Lock gemacht. Jetzt läuft das über einen Interlocked-Counter der
|
||||||
|
parallel zur Tabs-Liste mitgeführt wird, inklusive Resync-Hook für den Snapshot-Restore-Pfad in
|
||||||
|
`SaveConfig`. Plus Pure-Helper-Test-Mirror in der Build-Suite damit die Atomicity-Semantik nicht
|
||||||
|
versehentlich wegrefactored wird
|
||||||
|
- **HonorificService selbst-dokumentierende Threading-Banner.** Statt eines Block-Comments am
|
||||||
|
Klassen-Ende hat jede IPC-Callback-Methode jetzt einen 1-Zeilen-Banner darüber, der den
|
||||||
|
Thread-Kontext direkt am Call-Site benennt (framework only, framework scheduled, any). Mehr Hilfe
|
||||||
|
für künftige Reviews als ein abstraktes Threading-Kapitel
|
||||||
|
- **Unsubscribe-Failure ist jetzt sichtbar.** `TryUnsubscribe` hat ein Honorific-Unsubscribe-Failure
|
||||||
|
bisher als Debug geloggt, was bei Standard-Loglevel verschluckt wurde. Eine geleakte Subscription
|
||||||
|
kann den Service über Plugin-Reloads hinweg leben lassen, also läuft der Log jetzt auf Warning
|
||||||
|
- **AutoTranslate-Warmup blockiert den Plugin-Unload nicht mehr.** Der Cache-Warmup-Thread war ohne
|
||||||
|
`IsBackground=true` unterwegs, was den Unload um 100-300 ms verzögern konnte. Pattern-Match zu
|
||||||
|
MessageManager und RetentionSweep (beide seit v1.4.0)
|
||||||
|
- **Privacy-Filter loggt unbekannte ChatTypes.** Wenn FFXIV durch einen Patch einen neuen ChatType
|
||||||
|
einführt der weder in der Whitelist noch in den Defaults steht, wird er bisher silent durch den
|
||||||
|
Failsafe geleitet. Jetzt loggt der Filter einmalig pro Runtime eine Warning mit dem Type und dem
|
||||||
|
Failsafe-Wert. Dedup über ein NonSerialized-HashSet, also kein Log-Spam
|
||||||
|
- **Default-Flip für neue Installationen.** `PrivacyPersistUnknownChannels` startet bei neuen
|
||||||
|
Configs jetzt auf `true`, damit ein Patch-bedingt neuer ChatType nicht stillschweigend gedroppt
|
||||||
|
wird bevor der User entscheiden kann. Bestehende Configs behalten ihre Wahl, weil der Deserializer
|
||||||
|
den Initializer überschreibt. Keine Migration, kein Schema-Bump
|
||||||
|
|
||||||
|
Keine User-sichtbaren Funktions-Änderungen außer dem Default-Flip für neue Installationen. Settings,
|
||||||
|
Themes, Tabs und das Privacy-Verhalten für Bestand bleiben unangetastet.
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
subtitle: UX und Robustheit
|
||||||
|
versionsnatur: UX-Polish-Cycle
|
||||||
|
---
|
||||||
|
|
||||||
|
**Hellion Chat 1.4.5 — UX und Robustheit**
|
||||||
|
|
||||||
|
Sechster Sub-Patch der v1.4.x Polish-Sweep-Serie. Render-Fehler im Chat-Fenster werden jetzt
|
||||||
|
sichtbar, der First-Run-Wizard hat eine explizite Cancel-Schaltfläche, der Eingabe-Verlauf bleibt
|
||||||
|
nicht mehr über Plugin-Reloads hinweg liegen, und die Statusleiste klippt in schmalen Fenstern nicht
|
||||||
|
mehr.
|
||||||
|
|
||||||
|
- **Fehler-Benachrichtigung im Chat-Fenster.** Wenn ein Render-Fehler in `DrawChatLog` auftritt,
|
||||||
|
zeigt das Plugin jetzt eine einmalige Warning-Notification mit Verweis aufs `/xllog`, statt das
|
||||||
|
Fenster stillschweigend leer zu lassen. Der Stack-Trace selbst geht weiter via `Plugin.Log.Error`
|
||||||
|
ins Logfile. De-Dup über Per-Session-Bool, damit ein wiederkehrender Fehler die Notification-Stack
|
||||||
|
nicht pro Frame neu vollkippt
|
||||||
|
- **First-Run-Wizard trennt Accept und Close.** `OnClose` setzt nicht mehr stillschweigend
|
||||||
|
`FirstRunCompleted=true`, also lässt das X den Wizard schwebend zurück und er kommt beim nächsten
|
||||||
|
Plugin-Reload wieder. Eine neue „Später — Defaults behalten"-Schaltfläche im Footer ist der
|
||||||
|
explizite Weg, ohne Profil-Auswahl rauszukommen. Strings bilingual EN+DE plus Tooltip
|
||||||
|
- **Eingabe-Verlauf wird beim Plugin-Reload geleert.** `InputHistoryService.Reset` hängt jetzt in
|
||||||
|
`Plugin.DisposeAsync` neben den anderen Pure-Memory-Cleanups, damit der statische Zustand aus der
|
||||||
|
vorigen Session den nächsten Load nicht mehr erbt
|
||||||
|
- **Statusleiste klippt nicht mehr.** Der rechtsbündige Versions-Slot wird ausgeblendet wenn die
|
||||||
|
Chat-Window-Breite abzüglich Versions-Text unter 200 px fällt — vorher überlappte er die vier
|
||||||
|
linken Slots. Ab ausreichender Breite taucht der Slot wieder auf
|
||||||
|
- **Intern:** `FontManager` fällt auf System-Font zurück wenn die eingebettete Hellion-Font-Resource
|
||||||
|
fehlt (Broken-csproj-Pfad, nie ein Produktions-Build), plus expliziter
|
||||||
|
Session-Only-Invariant-Kommentar für Auto-Tell-Tabs in `Plugin.cs:167-168` mit einem
|
||||||
|
TempTabCounter-Init-Pin in der Build-Suite. Kein Schema-Bump, keine Migration
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
subtitle: Code Hygiene and Refactor
|
||||||
|
versionsnatur: Maintenance-Cycle
|
||||||
|
---
|
||||||
|
|
||||||
|
Wartungs-Patch ohne User-sichtbare Änderungen. Saubere Code-Basis als Vorbereitung auf das
|
||||||
|
v1.4.7-Backlog-Cleanup, plus zwei geerbte Bugfixes aus dem ChatTwo-Upstream `f35b7d3`.
|
||||||
|
|
||||||
|
- **preflight.sh härter**: csharpier-Reflow-Check (Block E) und markdownlint (Block F) laufen jetzt
|
||||||
|
im Pre-Push-Gate, statt erst beim Pre-Merge-Review aufzufallen.
|
||||||
|
- **FontManager-Fallback robuster**: Atlas-Toolkit-Throws aus kaputten Font-Configs (IO,
|
||||||
|
InvalidOperation, ArgumentException) fallen jetzt zuverlässig auf NotoSansCjkRegular, statt den
|
||||||
|
Atlas-Build mitzureißen. Der Exception-Typ wird im Log mitgegeben für die Diagnose.
|
||||||
|
- **URL-Validation beim Plugin-Load**: BrandingLinks (5 URLs) und IntegrationLinks (2 URLs) werden
|
||||||
|
via `[ModuleInitializer]` geprüft. Ein Tippfehler bei einer künftigen URL-Rotation wirft jetzt
|
||||||
|
sofort beim Plugin-Load, statt still beim Klick zu scheitern.
|
||||||
|
- **Cherry-Pick aus ChatTwo `f35b7d3`** — Memory-Leak in `Chat.SetChannel`: der native `Utf8String`
|
||||||
|
wird jetzt auch dann freigegeben, wenn der Linkshell-Check den Channel ablehnt (vorher gefangen im
|
||||||
|
early-return).
|
||||||
|
- **Cherry-Pick aus ChatTwo `f35b7d3`** — `Tab.Clone()` Deep-cloned jetzt `UsedChannel` und
|
||||||
|
`TellTarget`. Vorher Reference-Share-Bug: PopOut- und Temp-Tabs mutierten sich gegenseitig.
|
||||||
|
- **Aktive-Tab-Underline pixel-perfect bei DPI-Scaling**: Die Underline-Pill skaliert jetzt mit
|
||||||
|
`ImGuiHelpers.GlobalScale` und rundet die DrawList-Koordinaten auf physische Pixel. Kein
|
||||||
|
Sub-Pixel-Blur mehr auf 125/150%-Setups.
|
||||||
|
- **IconButton-Width-Fix**: der manuelle `width - 2 * CellPadding.X`-Subtract verlor den HUD-Scale
|
||||||
|
(Padding skaliert, der raw int nicht). Gemessene Breite läuft jetzt unverändert durch.
|
||||||
|
- **Test-Isolation für MessageStore**: `Dalamud.Utility.Util`-Surface (IsWine, OpenLink) läuft jetzt
|
||||||
|
durch eine `IPlatformUtil`-Indirektion. MessageStores `IsWine`-Probe ist isoliert testbar in der
|
||||||
|
Build-Suite. Plus: HellionStyle-ChildBgAlpha als Pure-Helper extrahiert, Plugin.SaveConfig kopiert
|
||||||
|
nur Session-Tabs statt der ganzen Tab-Liste, SettingsOverview cached den DrawList einmal pro
|
||||||
|
Frame.
|
||||||
|
- **Built-in-Theme-Roster**: Crystal Nocturne (Royal Sapphire + Electric Magenta auf Obsidian, von
|
||||||
|
CRYSTALLITE) ersetzt Moonlit Bloom. User mit Moonlit Bloom als aktivem Theme fallen beim ersten
|
||||||
|
Plugin-Load auf Hellion Arctic zurück.
|
||||||
|
|
||||||
|
Based on Chat 2 1.35.3 (upstream Infiziert90/ChatTwo, EUPL-1.2).
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
subtitle: Backlog Cleanup and Mid-Features
|
||||||
|
versionsnatur: Mid-Feature-Patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Achter Sub-Patch der v1.4.x Polish-Sweep-Serie. Erstes User-sichtbares Feature-Bundle seit v1.4.5 —
|
||||||
|
angepinnte Tell-Tabs die Relog überleben, opt-in Honorific-Glow, plus eine konfigurierbare Sidebar.
|
||||||
|
|
||||||
|
- **TempTell anpinnen**: Rechtsklick auf einen TempTell-Tab in der Sidebar → „Tab anpinnen".
|
||||||
|
Angepinnte Tabs überleben Plugin-Reload und Char-Logout, behalten ihre Konversations-Historie
|
||||||
|
(wird beim Rehydrate aus dem MessageStore nachgeladen) und bleiben an die gleiche /tell-Person
|
||||||
|
gebunden. Hard-Cap 5 angepinnte Tabs in einem separaten Pool — die normalen Auto-Tell-Tabs (15er
|
||||||
|
Cap) sind davon entkoppelt, Gesamt-Decke 20. Die Sidebar gruppiert angepinnte Tabs in einer
|
||||||
|
eigenen „Angepinnt"-Sektion mit eigenem Trenner.
|
||||||
|
- **Honorific Glow-Outline**: rendert jetzt eine 8-Richtungs-DrawList-Outline wenn der
|
||||||
|
Honorific-Titel eine Glow-Farbe trägt. Opt-in via **Settings → Integrationen → Glow-Outline
|
||||||
|
rendern (Honorific)** (Default OFF). Gradient (Color3 / GradientColourSet / Wave / Pulse) wird
|
||||||
|
geparst und im DTO weitergereicht, rendert aktuell aber statisch als Primärfarbe — der volle
|
||||||
|
Gradient-Port (Animations-Algorithmus + Pride-Palette) kommt als eigener Cycle nach.
|
||||||
|
- **Sidebar-Breite konfigurierbar**: in **Theme & Layout** ein Slider 44–160 px. Default bleibt 44
|
||||||
|
px (icon-only), aber breiter machen damit Sektion-Header wie „Aktive Tells (3)" oder „Angepinnt
|
||||||
|
(2)" nicht abgeschnitten werden.
|
||||||
|
- **Settings-Save Channel-Fix**: ein Save mit aktivem Party- oder Linkshell-Tab konnte den
|
||||||
|
Chat-Input zurück auf `/tell <angepinnte Person>` springen lassen. `Configuration.UpdateFrom`
|
||||||
|
bewahrt jetzt den Runtime-`CurrentChannel` über den persistent-Tab-Merge hinweg, und `TabSwitched`
|
||||||
|
deep-cloned den Seed-Channel statt sich den `UsedChannel` mit dem vorigen Tab zu teilen.
|
||||||
|
- **Internal**: `IPluginLogProxy`-Indirektion vor Dalamud's `IPluginLog` über alle ~91
|
||||||
|
`Plugin.Log`-Call-Sites. Damit läuft `MessageStore.Migrate0` voll-isoliert in xUnit (F12.1-Lücke
|
||||||
|
aus v1.4.6 geschlossen). Plus: TempTab-Counter als abgeleitete Property statt gecachtes
|
||||||
|
Interlocked-Feld — die neuen Pin/Unpin-Übergänge sind Cold-Path, kein Lock-Free-Vorteil mehr.
|
||||||
|
Migration v16 → v17 ist rein additiv (neues `Tab.IsPinned`-Bool, Default false).
|
||||||
|
|
||||||
|
Based on Chat 2 1.35.3 (upstream Infiziert90/ChatTwo, EUPL-1.2).
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
subtitle: Hook-Layer und Polish-Quick-Wins
|
||||||
|
versionsnatur: Polish-Patch
|
||||||
|
---
|
||||||
|
|
||||||
|
- DbViewer Volltext-Suche: optionaler FTS5-Index über die ganze Chat-Historie. Wird beim ersten
|
||||||
|
v1.4.8-Start asynchron im Hintergrund gebaut, Progress als Toast. Lokale Page-Suche bleibt
|
||||||
|
Default. Such-Eingaben werden als exakte Wortfolge gematcht; mehrere Wörter werden nur gefunden,
|
||||||
|
wenn sie zusammen und in der Reihenfolge stehen. Wer rohe FTS5-MATCH-Syntax nutzen will, setzt
|
||||||
|
eigene Anführungszeichen um den Suchbegriff.
|
||||||
|
- Custom-Theme-Files laden sich beim Speichern automatisch neu, wenn das Theme aktiv ist. Kein
|
||||||
|
Picker-Klick mehr nötig.
|
||||||
|
- Retention-Sweep blockt nicht mehr den Framework-Thread. Der Mini-Hitch von ~194ms pro Sweep ist
|
||||||
|
weg.
|
||||||
|
- Statusleiste rendert sauber bei Windows-Skalierung über 100%.
|
||||||
|
- Receive-Suppressed-Tells-Routing wurde in diesem Cycle untersucht und auf v1.5.x verschoben: wenn
|
||||||
|
andere Plugins Tells via CheckMessageHandled unterdrücken, überspringt FFXIVs Chat-Pipeline den
|
||||||
|
RaptureLogModule-Resolver und HellionChats Tab-Routing verliert den Tell-Partner. Der Fix liegt
|
||||||
|
architektonisch neben dem geplanten Ad-Block-Hook-Layer und kommt dort mit.
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
subtitle: Plugin-Load Render Polish
|
||||||
|
versionsnatur: Performance-Patch
|
||||||
|
---
|
||||||
|
|
||||||
|
- First-Frame-HITCH unter 100 ms: der erste Render-Frame des Plugins liegt jetzt bei ~76 ms Median
|
||||||
|
(vorher ~127 ms), die Dalamud-Warnung „UiBuilder(Hellion Chat) > 100ms" beim Plugin-Start ist
|
||||||
|
damit weg. Erreicht durch das Verlagern von sechs nicht-essentiellen Render- Sektionen
|
||||||
|
(Statusleiste, Kanalname-Chunks, Fenster-Bounds-Check, Hinweis-Banner, Autocomplete,
|
||||||
|
Input-Preview) auf den zweiten Frame. Bei 60 fps sieht man die deferred-Sektionen ~17 ms später,
|
||||||
|
was im Atlas-Build-Fenster nach einem Reload unsichtbar bleibt.
|
||||||
|
- Slash-Commands zentral registriert: /hellion, /hellionView, /hellionSeString und /hellionDebugger
|
||||||
|
werden jetzt im Plugin-Load zentral registriert statt erst beim ersten Öffnen ihres Ziel-Fensters.
|
||||||
|
Heißt: die Befehle funktionieren ab dem ersten Tick, auch wenn das jeweilige Fenster nie geöffnet
|
||||||
|
wurde. Der „Einstellungen"-Button im Plugin-Manager hängt am selben Pfad.
|
||||||
|
- Plugin-Load-Diagnose-Logs als Tripwire: die Profiling-Logs für MessageStore.Connect,
|
||||||
|
MessageStore.Migrate, FilterAllTabs und den Auto-Translate-Warmup bleiben auf Information-Level
|
||||||
|
eingeschaltet. Falls eine zukünftige Änderung die Lade-Zeit wieder über 100 ms drückt, taucht der
|
||||||
|
Mehrverbrauch direkt im /xllog auf, ohne dass jemand erst den Debug-Filter einschalten muss.
|
||||||
|
- ChatTwo-IPC-Kompatibilitäts-Layer: HellionChat spiegelt jetzt die komplette ChatTwo-IPC-Surface
|
||||||
|
(`GetChatInputState`, `ChatInputStateChanged`, `Register`, `Unregister`, `Available`, `Invoke`)
|
||||||
|
zusätzlich zu unseren eigenen `HellionChat.*`-Gates unter dem `ChatTwo.*`-Namensraum. Drittseitige
|
||||||
|
Integrationen die nur auf ChatTwo's IPC reagieren, etwa die Kontextmenü-Hooks von Artisan und
|
||||||
|
AllaganTools, funktionieren damit weiter ohne Code-Änderung auf ihrer Seite. Die
|
||||||
|
Conflict-Detection blockiert das parallele Laden von ChatTwo, daher kein Namensraum-Konflikt im
|
||||||
|
Live-Betrieb.
|
||||||
|
- Migration v17 unverändert: kein Schema-Bump, kein Config-Migrations- Aufwand. Nach dem Update
|
||||||
|
läuft das Plugin gegen die bestehende v17-Datenbank weiter.
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
subtitle: DI Foundation und Service-Refactor
|
||||||
|
versionsnatur: Architektur-Cycle
|
||||||
|
---
|
||||||
|
|
||||||
|
- **Architektur-Umbau ohne User-spürbare Verhaltens-Änderung:** der Plugin-Bootstrap wechselt auf
|
||||||
|
einen Generic-Host DI-Container (`Microsoft.Extensions.Hosting` + `IServiceCollection`) nach dem
|
||||||
|
Lightless-Sync-Muster. 18 Service-Klassen wandern von einem statischen `Plugin.LogProxy`-Locator
|
||||||
|
auf typisierte `ILogger<T>`-Constructor-Injection. `DalamudLogger` brückt
|
||||||
|
`Microsoft.Extensions.Logging` über auf Dalamuds `IPluginLog` — im xllog erscheinen jetzt
|
||||||
|
Service-spezifische Spalten wie `[ MessageManager]` und `[Honori...ervice]`.
|
||||||
|
- **Plugin.LogProxy bleibt für die acht Buckets erhalten,** die Constructor-Injection nicht
|
||||||
|
erreicht: Static-Helper (EmoteCache, AutoTranslate, MemoryUtil, WrapperUtil), Dalamud-Reflektion
|
||||||
|
(Configuration), Data-Class mit Massen-Instanziierung (Message) und Instanz-Klassen die nur aus
|
||||||
|
Static-Methods loggen (FontManager, eine GameFunctions-Stelle).
|
||||||
|
- **Performance bestätigt durch Cross-Plugin-Baseline:** HellionChat First-Frame-HITCH 77 ms Median,
|
||||||
|
Chat 2 v1.40.2 74 ms Median — kein DI-Penalty gegenüber dem Upstream-Fork-Origin. Lightless und
|
||||||
|
XIVInstantMessenger liegen bei ~7 ms weil sie ihren FontAtlas-Build deferren; das wird das
|
||||||
|
v1.5.1-Item.
|
||||||
|
- **User-sichtbarer Bug-Fix nebenbei:** Slash-Command-Einfügen in das Chat-Eingabefeld (Friend-List
|
||||||
|
"/tell"-Action plus Plugin-Inserts von Artisan, AllaganTools und ähnlichen) ersetzt jetzt den
|
||||||
|
vorhandenen Input, statt anzukonkatenieren. Cherry-Pick aus ChatTwo upstream `ee7768ac` mit
|
||||||
|
Namespace-Anpassung.
|
||||||
|
- **Foundation für die Plugin-Integrations-Wave:** v1.5.7-11 (Context-Menu, NotificationMaster,
|
||||||
|
Moodles, ExtraChat, XIVIM Quick-DM) werden ab jetzt strukturell handhabbar — neue Services sind
|
||||||
|
ein `services.AddSingleton<T>` plus ein paar Factory-Lambda- Zeilen, kein Plugin.cs-Anflanschen
|
||||||
|
mehr.
|
||||||
|
- Migration v17 unverändert: kein Schema-Bump, kein Config-Migrations-Aufwand.
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
subtitle: "FontAtlas Refactor and Forge Signature"
|
||||||
|
versionsnatur: "Architecture + Closure + Branding"
|
||||||
|
---
|
||||||
|
|
||||||
|
- **FontManager-Refactor.** Der FontAtlas baut jetzt nur noch einmal pro Plugin-Load statt vier- bis
|
||||||
|
fünfmal. Weniger CPU- und GPU-Druck in den ersten Sekunden nach einem Reload, weniger
|
||||||
|
Atlas-Texture-Memory-Churn. Die acht Font-Einstellungen können live über den neuen
|
||||||
|
`RebuildDelegateFonts`-Pfad geändert werden, ohne dass das Plugin neu geladen werden muss.
|
||||||
|
- **Hellion Forge Signatur.** Das Plugin trägt jetzt eine ASCII-Fuchs-Signatur. Im `/xllog`
|
||||||
|
erscheint beim Plugin-Load ein kleiner Fuchs-Kopf, im First-Run-Wizard und unter Settings →
|
||||||
|
Information taucht eine eingeklappte „Hellion Forge"-Sektion mit dem vollen Fuchs auf. Gezeichnet
|
||||||
|
von Julia Moon, fest in der Plugin-DLL eingebettet.
|
||||||
|
- **Honorific-Integration bleibt unverändert.** Der ursprünglich geplante Gradient-Render-Pfad
|
||||||
|
(Wave/Pulse-Animation) entfällt. Honorific 3.2 stellt keine IPC für den fertig gerenderten
|
||||||
|
Gradient-Frame zur Verfügung, und ein eigener Port der Pride-Palette wurde verworfen. Die
|
||||||
|
Honorific-Anzeige bleibt wie in v1.4.7 etabliert (statischer Glow plus Title).
|
||||||
|
- **Hinweis zum HITCH-Win.** Der ursprünglich angepeilte 10×-First-Frame-Sprung
|
||||||
|
(Lightless/XIVIM-Pattern, ~7 ms statt ~75 ms) ist in diesem Cycle nicht eingetreten. Die
|
||||||
|
Render-Kosten liegen im UiBuilder-First-Frame-Pfad, nicht im FontAtlas-Build. Investigation kommt
|
||||||
|
als eigener späterer Cycle. Keine User-sichtbare Disruption, keine Migration.
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
subtitle: "First-Run Wizard — neu in 4 Steps, Roleplay-Profil neu"
|
||||||
|
versionsnatur: "UX-Patch"
|
||||||
|
---
|
||||||
|
- **Vier Steps statt Single-Page.** Der First-Run-Wizard öffnet jetzt in vier Bühnen: Willkommen → Privacy-Profil → Power-Settings → Fertig. Pagination-Dots in Forge-Bronze oben rechts, Back/Skip/Next im Footer. Standardgröße 720×480 (Min 600×400) und der Fuchs-Banner sitzt als zugeklappter TreeNode oben in Step 1, damit die Einleitung im Fokus bleibt.
|
||||||
|
- **Neues Privacy-Profil „Roleplay".** Datensparsamkeit plus Sagen und beide Emote-Typen für Story-Logs. Schreien und Rufen bleiben außen vor, Public-Distance-Lärm von Fremden ist kein Story-Inhalt. Aufbewahrung: Sagen 30 Tage, Emotes 90 Tage. Privacy-Picker wird zum 2×2-Grid, Casual bleibt mit ★-Marker als Empfehlung.
|
||||||
|
- **Power-Settings sichtbar.** Bislang versteckte Defaults bekommen eine eigene Bühne: Vorherige Session laden, Filter inkl. alter Messages, N Tell-Messages vorladen, Compact-Density, Prettier-Timestamps und Theme-Picker für die 10 Built-in-Themes. Keine neuen Settings, nur das Bestehende sauber sichtbar.
|
||||||
|
- **Staged-Commit und Test-Hint auf der Fertig-Bühne.** Auswahl wird erst beim Klick auf „Fertig ✓" geschrieben. „Später entscheiden" oder X-Close lässt die bestehende Config unangetastet, ein nicht angefasster Step behält die alten Werte. Direkt darunter sichtbar: „Tipp /tell <Spielername>", plus die aktuelle Preload-Zahl aus Step 3 als Hinweis auf den Auto-Tell-Tab-Spawn.
|
||||||
|
- **Bestehende User sehen den neuen Wizard einmal.** Wer schon v1.5.1 hatte, bekommt den Multi-Step-Flow beim ersten v1.5.2-Boot aufgepoppt. Neues Config-Feld `WizardLastShownVersion` triggert das einmalig pro Wizard-Rework; Skip oder Finish reicht und danach öffnet er nicht mehr automatisch.
|
||||||
|
- **Unter der Haube.** Pure-Helper-Tests für alle vier Profile-Sets in der Build-Suite (zwölf neue Facts), plus ein WizardStateSmokeStep für `/xlperf`. Migration v17 bleibt, nur ein optionales Config-Feld kommt dazu.
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
## How to install
|
||||||
|
|
||||||
|
This release is distributed via the HellionChat custom repository, not the Dalamud main plugin repo.
|
||||||
|
To install:
|
||||||
|
|
||||||
|
1. In XIVLauncher: **Settings → Experimental → Custom Plugin Repositories**
|
||||||
|
2. Add the URL:
|
||||||
|
`https://gitea.hellion-forge.cloud/JonKazama-Hellion/HellionChat/raw/branch/main/repo.json`
|
||||||
|
3. Enable, save, then `/xlplugins` → search **Hellion Chat** → install
|
||||||
|
|
||||||
|
## Project documents
|
||||||
|
|
||||||
|
- [README](https://gitea.hellion-forge.cloud/JonKazama-Hellion/HellionChat/src/branch/main/README.md)
|
||||||
|
— features, architecture, build
|
||||||
|
- [Privacy notice](https://gitea.hellion-forge.cloud/JonKazama-Hellion/HellionChat/src/branch/main/PRIVACY.md)
|
||||||
|
— what the plugin stores and sends
|
||||||
|
- [Third-party notices](https://gitea.hellion-forge.cloud/JonKazama-Hellion/HellionChat/src/branch/main/docs/THIRD_PARTY_NOTICES.md)
|
||||||
|
— dependencies and licences
|
||||||
|
- [Security policy](https://gitea.hellion-forge.cloud/JonKazama-Hellion/HellionChat/src/branch/main/SECURITY.md)
|
||||||
|
— vulnerability reporting
|
||||||
|
- [Support](https://gitea.hellion-forge.cloud/JonKazama-Hellion/HellionChat/src/branch/main/SUPPORT.md)
|
||||||
|
— bug reports, questions, contact paths
|
||||||
|
|
||||||
|
## Licence
|
||||||
|
|
||||||
|
[EUPL-1.2](https://gitea.hellion-forge.cloud/JonKazama-Hellion/HellionChat/src/branch/main/LICENSE).
|
||||||
|
Based on [Chat 2](https://github.com/Infiziert90/ChatTwo) by Infi and Anna, also EUPL-1.2.
|
||||||
+459
-221
@@ -1,33 +1,193 @@
|
|||||||
## 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
|
## .gitignore – Hellion Forge / Hellion Media
|
||||||
|
##
|
||||||
|
## Basis: github/gitignore VisualStudio.gitignore
|
||||||
|
## Überarbeitet: Mai 2026
|
||||||
|
## Status: Original-Patterns vollständig erhalten,
|
||||||
|
## neu sortiert in logische Sektionen,
|
||||||
|
## Sicherheits- & Tooling-Sektionen ergänzt.
|
||||||
|
##
|
||||||
|
## Markierungen:
|
||||||
|
## [!! OBSOLET 2026 !!] → Tool offiziell eingestellt,
|
||||||
|
## Pattern bleibt aus Vorsicht drin.
|
||||||
|
##
|
||||||
|
##############################################################
|
||||||
|
|
||||||
# Local development environment (HellionChat fork)
|
|
||||||
|
# =====================================================
|
||||||
|
# [!! KRITISCH !!] Secrets, Keys & Credentials
|
||||||
|
# Diese Sachen dürfen NIEMALS im Repo landen!
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Environment Files
|
||||||
.env
|
.env
|
||||||
|
.env.*
|
||||||
.env.bak*
|
.env.bak*
|
||||||
.envrc
|
.envrc
|
||||||
!.env.example
|
!.env.example
|
||||||
|
!.env.sample
|
||||||
|
|
||||||
|
# Private Keys & Zertifikate
|
||||||
|
*.pem
|
||||||
|
*.key
|
||||||
|
*.p12
|
||||||
|
*.pfx
|
||||||
|
*.cer
|
||||||
|
*.crt
|
||||||
|
*.csr
|
||||||
|
*.gpg
|
||||||
|
*.asc
|
||||||
|
|
||||||
|
# SSH Keys (falls jemand die ins Repo legt)
|
||||||
|
id_rsa
|
||||||
|
id_ed25519
|
||||||
|
id_ecdsa
|
||||||
|
known_hosts
|
||||||
|
|
||||||
|
# Auth-/Token-Files
|
||||||
|
auth.json
|
||||||
|
.npmrc
|
||||||
|
.pypirc
|
||||||
|
secrets.json
|
||||||
|
|
||||||
|
# ASP.NET / .NET App-Configs mit lokalen Secrets
|
||||||
|
appsettings.*.local.json
|
||||||
|
appsettings.Local.json
|
||||||
|
local.settings.json
|
||||||
|
|
||||||
|
# Memory Dumps (können Credentials im Heap enthalten!)
|
||||||
|
*.dmp
|
||||||
|
*.mdmp
|
||||||
|
crash.log
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Projekt-spezifisch (HellionChat Fork)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Lokale Entwicklungsumgebung
|
||||||
.vscode/
|
.vscode/
|
||||||
scripts/
|
scripts/setup-dev-env.sh
|
||||||
|
|
||||||
|
# Lokales Test-Projekt (bleibt aus dem Plugin-Repo raus;
|
||||||
|
# pure-function safety net für Refactor-Cycles)
|
||||||
|
HellionChat.Tests/
|
||||||
|
ChatTwo.Tests
|
||||||
|
TestResults
|
||||||
|
*.db-shm
|
||||||
|
*.db-wal
|
||||||
|
|
||||||
# Packaging
|
# Packaging
|
||||||
pack/
|
pack/
|
||||||
|
|
||||||
# User-specific files
|
# Specs und Plan-Dateien
|
||||||
|
/.superpowers/
|
||||||
|
|
||||||
|
# Claude Code lokales Setup (nicht committed)
|
||||||
|
/.claude/
|
||||||
|
/CLAUDE.md
|
||||||
|
|
||||||
|
# Cycle-Working-Notes (im Vault gepflegt, lokales Repo-Pad bei Bedarf)
|
||||||
|
/docs/cycle-notes/
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# OS-spezifische Files
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# macOS
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
Desktop.ini
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Linux
|
||||||
|
.directory
|
||||||
|
.Trash-*
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# AI / LLM Tooling (2026 era)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Cursor IDE
|
||||||
|
.cursor/
|
||||||
|
.cursorignore
|
||||||
|
|
||||||
|
# Aider
|
||||||
|
.aider*
|
||||||
|
|
||||||
|
# Continue.dev
|
||||||
|
.continue/
|
||||||
|
.continuerc.json
|
||||||
|
|
||||||
|
# Windsurf
|
||||||
|
.windsurf/
|
||||||
|
|
||||||
|
# Sourcegraph Cody
|
||||||
|
.cody/
|
||||||
|
|
||||||
|
# Lokale Prompt-Sammlungen / Scratch-Pads
|
||||||
|
prompts/local/
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Editor & IDE (neben Visual Studio)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# JetBrains (IntelliJ, Rider, etc.)
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# Vim / Neovim
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*.swn
|
||||||
|
|
||||||
|
# Sublime Text
|
||||||
|
*.sublime-workspace
|
||||||
|
*.sublime-project
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# IDE & Editor – User-spezifische Files (VS)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Visual Studio User Files
|
||||||
*.rsuser
|
*.rsuser
|
||||||
*.suo
|
*.suo
|
||||||
*.user
|
*.user
|
||||||
*.userosscache
|
*.userosscache
|
||||||
*.sln.docstates
|
*.sln.docstates
|
||||||
|
|
||||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
# MonoDevelop/Xamarin Studio
|
||||||
*.userprefs
|
*.userprefs
|
||||||
|
|
||||||
# Mono auto generated files
|
# Visual Studio Cache/Options Directory
|
||||||
mono_crash.*
|
.vs/
|
||||||
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
|
#wwwroot/
|
||||||
|
|
||||||
|
# Visual Studio 2017 auto-generated files
|
||||||
|
Generated\ Files/
|
||||||
|
|
||||||
|
# Local History
|
||||||
|
.localhistory/
|
||||||
|
|
||||||
|
# CodeRush personal settings
|
||||||
|
.cr/personal
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Build Output
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
# Build results
|
|
||||||
[Dd]ebug/
|
[Dd]ebug/
|
||||||
[Dd]ebugPublic/
|
[Dd]ebugPublic/
|
||||||
[Rr]elease/
|
[Rr]elease/
|
||||||
@@ -43,43 +203,24 @@ bld/
|
|||||||
[Ll]og/
|
[Ll]og/
|
||||||
[Ll]ogs/
|
[Ll]ogs/
|
||||||
|
|
||||||
# Visual Studio 2015/2017 cache/options directory
|
# ATL Project Build Output
|
||||||
.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/
|
[Dd]ebugPS/
|
||||||
[Rr]eleasePS/
|
[Rr]eleasePS/
|
||||||
dlldata.c
|
dlldata.c
|
||||||
|
|
||||||
# Benchmark Results
|
|
||||||
BenchmarkDotNet.Artifacts/
|
|
||||||
|
|
||||||
# .NET Core
|
# .NET Core
|
||||||
project.lock.json
|
project.lock.json
|
||||||
project.fragment.lock.json
|
project.fragment.lock.json
|
||||||
artifacts/
|
artifacts/
|
||||||
|
|
||||||
# ASP.NET Scaffolding
|
# MigrationBackup (Package Reference Convert Tool)
|
||||||
ScaffoldingReadMe.txt
|
MigrationBackup/
|
||||||
|
|
||||||
# StyleCop
|
|
||||||
StyleCopReport.xml
|
|
||||||
|
|
||||||
# Files built by Visual Studio
|
# =====================================================
|
||||||
|
# Build-Artefakte (Files built by Visual Studio)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
*_i.c
|
*_i.c
|
||||||
*_p.c
|
*_p.c
|
||||||
*_h.h
|
*_h.h
|
||||||
@@ -101,6 +242,7 @@ StyleCopReport.xml
|
|||||||
*.tmp_proj
|
*.tmp_proj
|
||||||
*_wpftmp.csproj
|
*_wpftmp.csproj
|
||||||
*.log
|
*.log
|
||||||
|
*.binlog
|
||||||
*.vspscc
|
*.vspscc
|
||||||
*.vssscc
|
*.vssscc
|
||||||
.builds
|
.builds
|
||||||
@@ -108,10 +250,87 @@ StyleCopReport.xml
|
|||||||
*.svclog
|
*.svclog
|
||||||
*.scc
|
*.scc
|
||||||
|
|
||||||
# Chutzpah Test files
|
|
||||||
|
# =====================================================
|
||||||
|
# Test Results
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# MSTest
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
# NUnit
|
||||||
|
*.VisualState.xml
|
||||||
|
TestResult.xml
|
||||||
|
nunit-*.xml
|
||||||
|
|
||||||
|
# Benchmark Results
|
||||||
|
BenchmarkDotNet.Artifacts/
|
||||||
|
|
||||||
|
# Verify / Snapshot Testing (modern .NET, Spotty Wisdom)
|
||||||
|
*.received.*
|
||||||
|
*.received.txt
|
||||||
|
|
||||||
|
# [!! OBSOLET 2026 !!] Chutzpah – Repository auf GitHub archiviert
|
||||||
_Chutzpah*
|
_Chutzpah*
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Code Coverage
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Coverlet
|
||||||
|
coverage*.json
|
||||||
|
coverage*.xml
|
||||||
|
coverage*.info
|
||||||
|
|
||||||
|
# Visual Studio code coverage
|
||||||
|
*.coverage
|
||||||
|
*.coveragexml
|
||||||
|
|
||||||
|
# DotCover (JetBrains)
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# AxoCover
|
||||||
|
.axoCover/*
|
||||||
|
!.axoCover/settings.json
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
_NCrunch_*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
nCrunchTemp_*
|
||||||
|
|
||||||
|
# OpenCover UI Analysis
|
||||||
|
OpenCover/
|
||||||
|
|
||||||
|
# [!! OBSOLET 2026 !!] MightyMoose / AutoTest.Net – seit >10 Jahren nicht mehr gepflegt
|
||||||
|
*.mm.*
|
||||||
|
AutoTest.Net/
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Profiler & Trace
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Visual Studio Profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
*.sap
|
||||||
|
|
||||||
|
# Visual Studio Trace Files
|
||||||
|
*.e2e
|
||||||
|
|
||||||
|
# NVidia Nsight GPU Debugger
|
||||||
|
*.nvuser
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Cache Files (VS, C++, Sass)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
# Visual C++ cache files
|
# Visual C++ cache files
|
||||||
|
# Hinweis: Manche Patterns hier werden auch vom C#-Linter genutzt (z. B. *.lscache)
|
||||||
ipch/
|
ipch/
|
||||||
*.aps
|
*.aps
|
||||||
*.ncb
|
*.ncb
|
||||||
@@ -121,101 +340,80 @@ ipch/
|
|||||||
*.cachefile
|
*.cachefile
|
||||||
*.VC.db
|
*.VC.db
|
||||||
*.VC.VC.opendb
|
*.VC.VC.opendb
|
||||||
|
*.lscache
|
||||||
|
|
||||||
# Visual Studio profiler
|
# Visual Studio cache (.cache files allgemein, .cache directories behalten)
|
||||||
*.psess
|
*.[Cc]ache
|
||||||
*.vsp
|
!?*.[Cc]ache/
|
||||||
*.vspx
|
|
||||||
*.sap
|
|
||||||
|
|
||||||
# Visual Studio Trace Files
|
# Web Workbench Sass
|
||||||
*.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/
|
.sass-cache/
|
||||||
|
|
||||||
# Installshield output folder
|
|
||||||
[Ee]xpress/
|
|
||||||
|
|
||||||
# DocProject is a documentation generator add-in
|
# =====================================================
|
||||||
DocProject/buildhelp/
|
# NuGet & Dependencies
|
||||||
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
|
# NuGet Packages
|
||||||
*.nupkg
|
*.nupkg
|
||||||
# NuGet Symbol Packages
|
|
||||||
*.snupkg
|
*.snupkg
|
||||||
# The packages folder can be ignored because of Package Restore
|
|
||||||
**/[Pp]ackages/*
|
**/[Pp]ackages/*
|
||||||
# except build/, which is used as an MSBuild target.
|
|
||||||
!**/[Pp]ackages/build/
|
!**/[Pp]ackages/build/
|
||||||
# Uncomment if necessary however generally it will be regenerated when needed
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
#!**/[Pp]ackages/repositories.config
|
#!**/[Pp]ackages/repositories.config
|
||||||
# NuGet v3's project.json files produces more ignorable files
|
|
||||||
*.nuget.props
|
*.nuget.props
|
||||||
*.nuget.targets
|
*.nuget.targets
|
||||||
|
|
||||||
|
# Paket dependency manager
|
||||||
|
.paket/paket.exe
|
||||||
|
paket-files/
|
||||||
|
|
||||||
|
# FAKE - F# Make
|
||||||
|
.fake/
|
||||||
|
|
||||||
|
# Cake - Uncomment if you are using it
|
||||||
|
# tools/**
|
||||||
|
# !tools/packages.config
|
||||||
|
|
||||||
|
# Fody – auto-generated XML schema
|
||||||
|
FodyWeavers.xsd
|
||||||
|
|
||||||
|
# Node (falls JS-Tooling im Build genutzt wird)
|
||||||
|
.ntvs_analysis.dat
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Python Tools für Visual Studio (PTVS)
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Mono
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
mono_crash.*
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Publish & Deploy
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Click-Once
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||||
|
# but database connection strings (with potential passwords) will be unencrypted
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.azurePubxml
|
||||||
|
*.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/
|
||||||
|
|
||||||
# Microsoft Azure Build Output
|
# Microsoft Azure Build Output
|
||||||
csx/
|
csx/
|
||||||
*.build.csdef
|
*.build.csdef
|
||||||
@@ -224,7 +422,35 @@ csx/
|
|||||||
ecf/
|
ecf/
|
||||||
rcf/
|
rcf/
|
||||||
|
|
||||||
# Windows Store app package directories and files
|
# Service Fabric Backup
|
||||||
|
ServiceFabricBackup/
|
||||||
|
|
||||||
|
# Installshield
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Container / Infrastructure-as-Code (Vorsicht: Tokens!)
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Docker
|
||||||
|
docker-compose.override.yml
|
||||||
|
|
||||||
|
# Terraform
|
||||||
|
.terraform/
|
||||||
|
*.tfstate
|
||||||
|
*.tfstate.*
|
||||||
|
*.tfvars
|
||||||
|
!example.tfvars
|
||||||
|
|
||||||
|
# Serverless Framework
|
||||||
|
.serverless/
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Windows Store / AppX
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
AppPackages/
|
AppPackages/
|
||||||
BundleArtifacts/
|
BundleArtifacts/
|
||||||
Package.StoreAssociation.xml
|
Package.StoreAssociation.xml
|
||||||
@@ -233,50 +459,29 @@ _pkginfo.txt
|
|||||||
*.appxbundle
|
*.appxbundle
|
||||||
*.appxupload
|
*.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/
|
# Datenbanken & SQL
|
||||||
~$*
|
# =====================================================
|
||||||
*~
|
|
||||||
*.dbmdl
|
|
||||||
*.dbproj.schemaview
|
|
||||||
*.jfm
|
|
||||||
*.pfx
|
|
||||||
*.publishsettings
|
|
||||||
orleans.codegen.cs
|
|
||||||
|
|
||||||
# Including strong name files can present a security risk
|
# SQL Server
|
||||||
# (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
|
*.mdf
|
||||||
*.ldf
|
*.ldf
|
||||||
*.ndf
|
*.ndf
|
||||||
|
|
||||||
# Business Intelligence projects
|
# Andere DB-bezogene
|
||||||
|
*.dbmdl
|
||||||
|
*.dbproj.schemaview
|
||||||
|
*.jfm
|
||||||
|
|
||||||
|
# [!! OBSOLET 2026 !!] BeatPulse – wurde 2019 umbenannt zu AspNetCore.Diagnostics.HealthChecks
|
||||||
|
healthchecksdb
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Business Intelligence / Reporting
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
*.rdl.data
|
*.rdl.data
|
||||||
*.bim.layout
|
*.bim.layout
|
||||||
*.bim_*.settings
|
*.bim_*.settings
|
||||||
@@ -284,27 +489,97 @@ ServiceFabricBackup/
|
|||||||
*- [Bb]ackup.rdl
|
*- [Bb]ackup.rdl
|
||||||
*- [Bb]ackup ([0-9]).rdl
|
*- [Bb]ackup ([0-9]).rdl
|
||||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||||
|
*.rptproj.bak
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Add-ins & Analyzer Tools
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# ReSharper
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
*.DotSettings.user
|
||||||
|
|
||||||
|
# TeamCity
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# StyleCop
|
||||||
|
StyleCopReport.xml
|
||||||
|
|
||||||
|
# ASP.NET Scaffolding
|
||||||
|
ScaffoldingReadMe.txt
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
# Microsoft Fakes
|
# Microsoft Fakes
|
||||||
FakesAssemblies/
|
FakesAssemblies/
|
||||||
|
|
||||||
# GhostDoc plugin setting file
|
# [!! OBSOLET 2026 !!] GhostDoc Plugin – Submain hat das Tool eingestellt
|
||||||
*.GhostDoc.xml
|
*.GhostDoc.xml
|
||||||
|
|
||||||
# Node.js Tools for Visual Studio
|
# Tabs Studio
|
||||||
.ntvs_analysis.dat
|
*.tss
|
||||||
node_modules/
|
|
||||||
|
|
||||||
# Visual Studio 6 build log
|
# Telerik JustMock
|
||||||
|
*.jmconfig
|
||||||
|
|
||||||
|
# MFractors (Xamarin productivity tool)
|
||||||
|
.mfractor/
|
||||||
|
|
||||||
|
# DocProject Documentation Generator
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# Sonstige Sprachen & Tooling
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# Ionide (F# VS Code Tools)
|
||||||
|
.ionide/
|
||||||
|
|
||||||
|
# Azure Stream Analytics Local Run
|
||||||
|
ASALocalRun/
|
||||||
|
|
||||||
|
# BizTalk Build Output
|
||||||
|
*.btp.cs
|
||||||
|
*.btm.cs
|
||||||
|
*.odx.cs
|
||||||
|
*.xsd.cs
|
||||||
|
|
||||||
|
# Orleans
|
||||||
|
orleans.codegen.cs
|
||||||
|
|
||||||
|
|
||||||
|
# =====================================================
|
||||||
|
# [!! OBSOLET 2026 !!] Legacy-Tooling (eingestellt)
|
||||||
|
# Patterns bleiben aus Vorsicht drin.
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
|
# [!! OBSOLET 2026 !!] TFS 2012 Local Workspace – ersetzt durch Azure DevOps
|
||||||
|
$tf/
|
||||||
|
|
||||||
|
# [!! OBSOLET 2026 !!] Visual Studio 6 Build Log – VS6 ist von 1998
|
||||||
*.plg
|
*.plg
|
||||||
|
|
||||||
# Visual Studio 6 workspace options file
|
# [!! OBSOLET 2026 !!] Visual Studio 6 Workspace Options
|
||||||
*.opt
|
*.opt
|
||||||
|
|
||||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
# [!! OBSOLET 2026 !!] Visual Studio 6 Workspace File
|
||||||
*.vbw
|
*.vbw
|
||||||
|
|
||||||
# Visual Studio LightSwitch build output
|
# [!! OBSOLET 2026 !!] RIA / Silverlight – Microsoft hat das Okt. 2021 eingestellt
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# [!! OBSOLET 2026 !!] Visual Studio LightSwitch – von Microsoft eingestellt
|
||||||
**/*.HTMLClient/GeneratedArtifacts
|
**/*.HTMLClient/GeneratedArtifacts
|
||||||
**/*.DesktopClient/GeneratedArtifacts
|
**/*.DesktopClient/GeneratedArtifacts
|
||||||
**/*.DesktopClient/ModelManifest.xml
|
**/*.DesktopClient/ModelManifest.xml
|
||||||
@@ -312,68 +587,31 @@ node_modules/
|
|||||||
**/*.Server/ModelManifest.xml
|
**/*.Server/ModelManifest.xml
|
||||||
_Pvt_Extensions
|
_Pvt_Extensions
|
||||||
|
|
||||||
# Paket dependency manager
|
|
||||||
.paket/paket.exe
|
|
||||||
paket-files/
|
|
||||||
|
|
||||||
# FAKE - F# Make
|
# =====================================================
|
||||||
.fake/
|
# Upgrade / Backup-Reports
|
||||||
|
# =====================================================
|
||||||
|
|
||||||
# CodeRush personal settings
|
# Backup-Files vom Konvertieren alter VS-Projekte (wir haben ja git ;-))
|
||||||
.cr/personal
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
|
||||||
# Python Tools for Visual Studio (PTVS)
|
|
||||||
__pycache__/
|
|
||||||
*.pyc
|
|
||||||
|
|
||||||
# Cake - Uncomment if you are using it
|
# =====================================================
|
||||||
# tools/**
|
# Misc / Temp / Backup
|
||||||
# !tools/packages.config
|
# =====================================================
|
||||||
|
|
||||||
# Tabs Studio
|
ClientBin/
|
||||||
*.tss
|
~$*
|
||||||
|
*~
|
||||||
|
*.publishsettings
|
||||||
|
|
||||||
# Telerik's JustMock configuration file
|
# Including strong name files can present a security risk
|
||||||
*.jmconfig
|
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||||
|
#*.snk
|
||||||
|
|
||||||
# BizTalk build output
|
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||||
*.btp.cs
|
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||||
*.btm.cs
|
#bower_components/
|
||||||
*.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
|
|
||||||
|
|
||||||
#Specs und Plan datein
|
|
||||||
/.superpowers/
|
|
||||||
TestResults
|
|
||||||
*.db-shm
|
|
||||||
*.db-wal
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"MD003": { "style": "atx" },
|
||||||
|
"MD004": { "style": "dash" },
|
||||||
|
"MD007": { "indent": 2 },
|
||||||
|
"MD009": { "br_spaces": 2, "strict": false, "list_item_empty_lines": false },
|
||||||
|
"MD013": false,
|
||||||
|
"MD024": { "siblings_only": true },
|
||||||
|
"MD029": false,
|
||||||
|
"MD033": false,
|
||||||
|
"MD036": false,
|
||||||
|
"MD040": true,
|
||||||
|
"MD041": false,
|
||||||
|
"MD046": { "style": "fenced" },
|
||||||
|
"MD048": { "style": "backtick" },
|
||||||
|
"MD049": { "style": "underscore" },
|
||||||
|
"MD050": { "style": "asterisk" }
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
# ##############################################################
|
||||||
|
# #
|
||||||
|
# # .prettierignore – Hellion Forge / Hellion Media
|
||||||
|
# #
|
||||||
|
# # Files die Prettier NICHT anfassen soll.
|
||||||
|
# # Überarbeitet: Mai 2026
|
||||||
|
# #
|
||||||
|
# # Hinweis: Prettier liest auch .gitignore automatisch mit.
|
||||||
|
# # Hier nur Sachen die zusätzlich ignoriert werden müssen
|
||||||
|
# # oder die im Repo liegen aber nicht formatiert werden dürfen.
|
||||||
|
# #
|
||||||
|
# ##############################################################
|
||||||
|
|
||||||
|
|
||||||
|
# === .NET Build Output ===
|
||||||
|
bin/
|
||||||
|
obj/
|
||||||
|
|
||||||
|
# === JS / Web Build Output ===
|
||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
out/
|
||||||
|
build/
|
||||||
|
coverage/
|
||||||
|
|
||||||
|
# === Generierte C#-Files (Designer, Source Generators) ===
|
||||||
|
*.Designer.cs
|
||||||
|
*.g.cs
|
||||||
|
*.g.i.cs
|
||||||
|
*.generated.cs
|
||||||
|
*.AssemblyInfo.cs
|
||||||
|
*.AssemblyAttributes.cs
|
||||||
|
|
||||||
|
# === Lock-Files (NIE umformatieren – zerschießt den Hash) ===
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
|
pnpm-lock.yaml
|
||||||
|
packages.lock.json
|
||||||
|
|
||||||
|
# === Minified Files (bewusst kompakt, niemals anfassen) ===
|
||||||
|
*.min.js
|
||||||
|
*.min.css
|
||||||
|
|
||||||
|
# === Test-Snapshots (z. B. Verify) ===
|
||||||
|
*.received.*
|
||||||
|
*.verified.*
|
||||||
|
**/__snapshots__/
|
||||||
|
|
||||||
|
# === Plugin-Manifest (DalamudPackager-Schema, fix lassen) ===
|
||||||
|
HellionChat/HellionChat.yaml
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 120,
|
||||||
|
"tabWidth": 4,
|
||||||
|
"useTabs": false,
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": false,
|
||||||
|
"trailingComma": "all",
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"arrowParens": "always",
|
||||||
|
"proseWrap": "always",
|
||||||
|
"endOfLine": "lf",
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": "*.md",
|
||||||
|
"options": {
|
||||||
|
"printWidth": 100,
|
||||||
|
"tabWidth": 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.yml", "*.yaml"],
|
||||||
|
"options": {
|
||||||
|
"tabWidth": 2,
|
||||||
|
"singleQuote": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": "*.json",
|
||||||
|
"options": {
|
||||||
|
"tabWidth": 4,
|
||||||
|
"trailingComma": "none"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
# ##############################################################
|
||||||
|
# #
|
||||||
|
# # .yamllint.yaml – Hellion Forge / Hellion Media
|
||||||
|
# #
|
||||||
|
# # YAML-Linting Konfiguration.
|
||||||
|
# # Überarbeitet: Mai 2026
|
||||||
|
# #
|
||||||
|
# # Regel-Doku:
|
||||||
|
# # https://yamllint.readthedocs.io/en/stable/rules.html
|
||||||
|
# #
|
||||||
|
# ##############################################################
|
||||||
|
|
||||||
|
extends: default
|
||||||
|
|
||||||
|
# Plugin-Manifest folgt DalamudPackager-Konvention (4-space-indent für
|
||||||
|
# image_urls + tags). yamllint-Default verlangt 2 — Konflikt, daher
|
||||||
|
# ignorieren statt das Manifest zu reformatieren.
|
||||||
|
ignore: |
|
||||||
|
HellionChat/HellionChat.yaml
|
||||||
|
|
||||||
|
rules:
|
||||||
|
# Zeilenlängen-Check aus (konsistent mit markdownlint MD013)
|
||||||
|
line-length: disable
|
||||||
|
|
||||||
|
# YAML ohne führendes "---" erlaubt
|
||||||
|
document-start: disable
|
||||||
|
|
||||||
|
# GitHub Actions nutzt "on:" als Trigger-Key.
|
||||||
|
# Ohne diesen Override würde yamllint das als boolean "on" beklagen.
|
||||||
|
truthy:
|
||||||
|
allowed-values: ['true', 'false', 'on']
|
||||||
|
|
||||||
|
# Maximal 1 Leerzeile in Folge (saubere Files)
|
||||||
|
empty-lines:
|
||||||
|
max: 1
|
||||||
|
|
||||||
|
# YAML-Standard ist 2 Spaces (auch GitHub Actions erwartet das).
|
||||||
|
# Explizit setzen, um Konsistenz im Repo zu erzwingen.
|
||||||
|
indentation:
|
||||||
|
spaces: 2
|
||||||
|
indent-sequences: true
|
||||||
|
check-multi-line-strings: false
|
||||||
|
|
||||||
|
# Kommentare brauchen Space nach #, müssen mit Content beginnen
|
||||||
|
comments:
|
||||||
|
require-starting-space: true
|
||||||
|
min-spaces-from-content: 1
|
||||||
|
|
||||||
|
# Kein Whitespace am Zeilenende
|
||||||
|
trailing-spaces: enable
|
||||||
|
|
||||||
|
# Datei muss mit Newline enden
|
||||||
|
new-line-at-end-of-file: enable
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
# AI assistance disclosure
|
|
||||||
|
|
||||||
This fork uses AI assistance per the [Dalamud Plugin AI Usage Policy](https://github.com/goatcorp/DalamudPluginsD17/)
|
|
||||||
at the **Pair** level.
|
|
||||||
|
|
||||||
A note up front: Hellion Chat is currently in a rebuild and adjustment
|
|
||||||
phase, and there are no plans to submit it to the Dalamud team for review
|
|
||||||
while it stays standalone. If the plugin stays out of the official repo I
|
|
||||||
technically wouldn't need to disclose any of this, but I'd rather be
|
|
||||||
upfront about how it's built.
|
|
||||||
|
|
||||||
Hellion Chat is my entry point into game modding and plugin development. I
|
|
||||||
have never written a plugin for a game before. I work alone, so I get help
|
|
||||||
where I need it. That's not something I want to hide.
|
|
||||||
|
|
||||||
## How I actually work
|
|
||||||
|
|
||||||
I plan the architecture, decide what gets built, and own every design
|
|
||||||
decision. For each change I:
|
|
||||||
|
|
||||||
- Read the code Claude drafts before I integrate it
|
|
||||||
- Test with my own tooling and in the running game
|
|
||||||
- Read the Dalamud log output to verify behaviour
|
|
||||||
- Run security and privacy audits on anything that touches user data
|
|
||||||
|
|
||||||
One of the main reasons I use AI is consistency. I want the Hellion code to
|
|
||||||
match the style of the upstream Chat 2 codebase and stay readable for
|
|
||||||
anyone who opens the repo, not just for me. Claude helps me catch when I'm
|
|
||||||
drifting from upstream conventions or writing something that only makes
|
|
||||||
sense in my own head.
|
|
||||||
|
|
||||||
The balance is shifting toward more hand-written work as I get more
|
|
||||||
comfortable with Dalamud and plugin development in general.
|
|
||||||
|
|
||||||
## What AI is used for
|
|
||||||
|
|
||||||
- API explanations (Dalamud, ImGui, .NET specifics I haven't worked with before)
|
|
||||||
- Code drafts that I read, edit, and integrate
|
|
||||||
- Pattern suggestions and code review
|
|
||||||
- Keeping the style aligned with the upstream Chat 2 codebase
|
|
||||||
|
|
||||||
## What AI isn't used for
|
|
||||||
|
|
||||||
- **Visual assets.** Logos, icons, banners, and screenshots are human-drawn
|
|
||||||
or taken from the running game.
|
|
||||||
- **German translations.** Written by me as a native speaker.
|
|
||||||
|
|
||||||
## What's where
|
|
||||||
|
|
||||||
Upstream Chat 2 (by Infi & Anna, EUPL-1.2) is the foundation and was not
|
|
||||||
produced with AI assistance. Hellion-specific code lives in
|
|
||||||
`ChatTwo/Privacy/`, `ChatTwo/Export/`, `Resources/HellionStrings*`,
|
|
||||||
`Ui/SettingsTabs/Privacy.cs`, `Ui/FirstRunWizard.cs`, `Ui/HellionStyle.cs`,
|
|
||||||
plus the Migrate3 recovery and plugin layout migration in `MessageStore.cs`
|
|
||||||
and `Plugin.cs`. These were developed with Pair-level assistance as
|
|
||||||
described above.
|
|
||||||
|
|
||||||
## If AI-assisted development is a dealbreaker for you
|
|
||||||
|
|
||||||
Fair enough. There are solid alternatives that don't rely on AI in their
|
|
||||||
development:
|
|
||||||
|
|
||||||
- [Chat 2](https://github.com/Infiziert90/ChatTwo), the original upstream
|
|
||||||
this fork is based on
|
|
||||||
- [XIV Instant Messenger](https://github.com/NightmareXIV/XIVInstantMessenger),
|
|
||||||
a different approach to chat in FFXIV
|
|
||||||
|
|
||||||
Both are good projects. Use what fits you best.
|
|
||||||
|
|
||||||
## Tooling
|
|
||||||
|
|
||||||
- Claude (Anthropic) via Claude Code CLI
|
|
||||||
- Context7 / Microsoft Learn for current Dalamud and .NET documentation
|
|
||||||
|
|
||||||
## Contact
|
|
||||||
|
|
||||||
Questions about this disclosure: <https://github.com/JonKazama-Hellion/HellionChat/issues>.
|
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
# Code of Conduct
|
||||||
|
|
||||||
|
## A Note on This Project
|
||||||
|
|
||||||
|
HellionChat is a one-person side project developed under Hellion Forge. I maintain this in my spare
|
||||||
|
time, which means replies can take a few days. Please do not escalate just because a thread is
|
||||||
|
quiet.
|
||||||
|
|
||||||
|
When in doubt, assume good intent. Contributors come from different backgrounds, time zones and
|
||||||
|
skill levels. A clarifying question is almost always a better first move than an accusation.
|
||||||
|
|
||||||
|
Please also keep discussions on topic. This project is about a Dalamud chat plugin. Off-topic
|
||||||
|
arguments belong elsewhere.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
We pledge to make our community welcoming, safe, and equitable for all.
|
||||||
|
|
||||||
|
We are committed to fostering an environment that respects and promotes the dignity, rights, and
|
||||||
|
contributions of all individuals, regardless of characteristics including race, ethnicity, caste,
|
||||||
|
color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or
|
||||||
|
expression, sexual orientation, language, philosophy or religion, national or social origin,
|
||||||
|
socio-economic position, level of education, or other status. The same privileges of participation
|
||||||
|
are extended to everyone who participates in good faith and in accordance with this Covenant.
|
||||||
|
|
||||||
|
## Encouraged Behaviors
|
||||||
|
|
||||||
|
While acknowledging differences in social norms, we all strive to meet our community's expectations
|
||||||
|
for positive behavior. We also understand that our words and actions may be interpreted differently
|
||||||
|
than we intend based on culture, background, or native language.
|
||||||
|
|
||||||
|
With these considerations in mind, we agree to behave mindfully toward each other and act in ways
|
||||||
|
that center our shared values, including:
|
||||||
|
|
||||||
|
1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
|
||||||
|
2. Engaging **kindly and honestly** with others.
|
||||||
|
3. Respecting **different viewpoints** and experiences.
|
||||||
|
4. **Taking responsibility** for our actions and contributions.
|
||||||
|
5. Gracefully giving and accepting **constructive feedback**.
|
||||||
|
6. Committing to **repairing harm** when it occurs.
|
||||||
|
7. Behaving in other ways that promote and sustain the **well-being of our community**.
|
||||||
|
|
||||||
|
## Restricted Behaviors
|
||||||
|
|
||||||
|
We agree to restrict the following behaviors in our community. Instances, threats, and promotion of
|
||||||
|
these behaviors are violations of this Code of Conduct.
|
||||||
|
|
||||||
|
1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal
|
||||||
|
attention after any clear request to stop.
|
||||||
|
2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a
|
||||||
|
community member or group of people.
|
||||||
|
3. **Stereotyping or discrimination.** Characterizing anyone's personality or behavior on the basis
|
||||||
|
of immutable identities or traits.
|
||||||
|
4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate
|
||||||
|
in the context or purpose of the community.
|
||||||
|
5. **Violating confidentiality.** Sharing or acting on someone's personal or private information
|
||||||
|
without their permission.
|
||||||
|
6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person
|
||||||
|
or group.
|
||||||
|
7. Behaving in other ways that **threaten the well-being** of our community.
|
||||||
|
|
||||||
|
### Other Restrictions
|
||||||
|
|
||||||
|
1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone
|
||||||
|
else to evade enforcement actions.
|
||||||
|
2. **Failing to credit sources.** Not properly crediting the sources of content you contribute.
|
||||||
|
3. **Promotional materials.** Sharing marketing or other commercial content in a way that is outside
|
||||||
|
the norms of the community.
|
||||||
|
4. **Irresponsible communication.** Failing to responsibly present content which includes, links to,
|
||||||
|
or describes any other restricted behaviors.
|
||||||
|
|
||||||
|
## Reporting
|
||||||
|
|
||||||
|
If something here is being broken, contact me directly. Do not open a public issue.
|
||||||
|
|
||||||
|
| Channel | Address |
|
||||||
|
| ---------- | -------------------------- |
|
||||||
|
| Email | `kontakt@hellion-media.de` |
|
||||||
|
| Discord DM | `@j.j_kazama` |
|
||||||
|
|
||||||
|
Reports stay private. I will acknowledge within a few weekdays (European business hours) and tell
|
||||||
|
you what I plan to do.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
I am the sole maintainer, so enforcement is a single-person process. I will pick the lightest
|
||||||
|
measure that actually resolves the situation:
|
||||||
|
|
||||||
|
1. Private note asking the behaviour to stop.
|
||||||
|
2. Public correction in the affected thread.
|
||||||
|
3. Edit or removal of the offending content.
|
||||||
|
4. Private written warning with a cooldown period.
|
||||||
|
5. Temporary block from the repository or related spaces.
|
||||||
|
6. Permanent block.
|
||||||
|
|
||||||
|
Severe cases skip the lower steps. I will not negotiate over harassment or threats.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies to all spaces the project owns or that I run on its behalf: the GitHub
|
||||||
|
repository, GitHub Discussions, project-related Discord conversations, and the maintainer contact
|
||||||
|
listed in [`SECURITY.md`](SECURITY.md). It also applies when someone is identifiably representing
|
||||||
|
HellionChat elsewhere, for example when posting as a HellionChat maintainer in the Dalamud Discord.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the Contributor Covenant, version 3.0, available at
|
||||||
|
[https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).
|
||||||
|
|
||||||
|
Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA
|
||||||
|
4.0. To view a copy of this license, visit
|
||||||
|
[https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/).
|
||||||
+150
@@ -0,0 +1,150 @@
|
|||||||
|
# Contributing to HellionChat
|
||||||
|
|
||||||
|
Thanks for taking a look. HellionChat is a one-person side project developed under Hellion Forge. It
|
||||||
|
started as a fork of [Chat 2](https://github.com/Infiziert90/ChatTwo) and has since become a
|
||||||
|
standalone plugin under its own namespace, IPC channels and source tree (standalone-cut completed in
|
||||||
|
v1.0.0). Forking HellionChat itself is explicitly permitted under the EUPL-1.2.
|
||||||
|
|
||||||
|
This document explains what I am looking for, what I am not, and how to make a contribution land
|
||||||
|
smoothly.
|
||||||
|
|
||||||
|
## Before You Open Anything
|
||||||
|
|
||||||
|
- Read the [README](README.md) so you understand the scope: a privacy-focused, EUPL-1.2-licensed
|
||||||
|
Dalamud plugin that intentionally removes the upstream webinterface and ships privacy-first
|
||||||
|
defaults.
|
||||||
|
- Read [`docs/UPSTREAM_SYNC.md`](docs/UPSTREAM_SYNC.md). Active cherry-picking from upstream Chat 2
|
||||||
|
has ended in the v1.4.x cycle; HellionChat continues as an independent codebase. Existing
|
||||||
|
upstream-derived code keeps its attribution. New contributions stand on their own and do not need
|
||||||
|
to be cherry-pick-compatible.
|
||||||
|
- Read [`SECURITY.md`](SECURITY.md). Anything security-sensitive goes through a private advisory,
|
||||||
|
never a public issue or PR.
|
||||||
|
- Read the [Code of Conduct](CODE_OF_CONDUCT.md).
|
||||||
|
|
||||||
|
## What I Will Accept
|
||||||
|
|
||||||
|
- Bug fixes for behaviour documented in the README, the in-plugin settings or the changelog.
|
||||||
|
- Translation contributions for Hellion-specific strings via direct pull requests against
|
||||||
|
`HellionChat/Resources/HellionStrings.*.resx`. Translations for upstream Chat 2 strings
|
||||||
|
(`Language.*.resx`) are not handled here; those go to the upstream Chat 2 project.
|
||||||
|
- Documentation improvements (README, comments, this file).
|
||||||
|
- Performance fixes with a measurable before/after.
|
||||||
|
- New features that fit the privacy-first scope and do not duplicate what an existing Dalamud plugin
|
||||||
|
already does well.
|
||||||
|
|
||||||
|
## What I Will Probably Decline
|
||||||
|
|
||||||
|
- Re-introducing the webinterface or any remote-access feature. It was removed in v0.2.0 on purpose.
|
||||||
|
See the README section "Was gegenüber Chat 2 fehlt".
|
||||||
|
- Features that bypass the privacy filter or weaken the default retention behaviour without an
|
||||||
|
explicit, documented opt-in.
|
||||||
|
- Sweeping refactors that touch large parts of the codebase. The maintenance cost outweighs the
|
||||||
|
benefit for a one-person project. (This used to be doubly important because of the upstream
|
||||||
|
cherry-pick path; that path is closed now, but the rule still holds on its own merits.)
|
||||||
|
- AI-generated code dropped in without disclosure or human review. See
|
||||||
|
[`docs/AI_DISCLOSURE.md`](docs/AI_DISCLOSURE.md) for how I handle AI assistance on my side; I
|
||||||
|
expect comparable transparency from contributors.
|
||||||
|
|
||||||
|
If you are unsure whether an idea fits, open a feature-request issue first and ask before writing
|
||||||
|
code. I would rather say "no" to a proposal than to a finished pull request.
|
||||||
|
|
||||||
|
## Workflow
|
||||||
|
|
||||||
|
1. Open an issue (bug or feature request) using the templates under `.github/ISSUE_TEMPLATE/`. Skip
|
||||||
|
this for trivial typos.
|
||||||
|
2. Fork the repository and branch off `main`. Branch naming is informal; something like
|
||||||
|
`fix/auto-tell-history-empty` or `feat/theme-export` is fine.
|
||||||
|
3. Match the existing code style. The repository ships an `.editorconfig` that VS Code and Rider
|
||||||
|
pick up automatically.
|
||||||
|
4. Keep commits focused. Several small commits with clear messages are easier to review than one
|
||||||
|
large one. Squash-on-merge happens at the PR level if needed.
|
||||||
|
5. If your change touches user-visible behaviour, update the README and/or the changelog block in
|
||||||
|
`HellionChat/HellionChat.yaml` and `repo.json`. I bump the version number myself at release time.
|
||||||
|
6. Open the pull request against `main`. The PR template will ask you to summarise the change, the
|
||||||
|
testing you did and any compatibility notes.
|
||||||
|
|
||||||
|
## Build and Test
|
||||||
|
|
||||||
|
The project targets `net10.0-windows` against Dalamud SDK 15. To build locally you need:
|
||||||
|
|
||||||
|
- .NET 10 SDK
|
||||||
|
- A working Dalamud dev environment with `DALAMUD_HOME` set (XIVLauncher installed and launched once
|
||||||
|
is the simplest path)
|
||||||
|
- VS Code with the C# Dev Kit, Rider, or Visual Studio
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dotnet restore
|
||||||
|
dotnet build HellionChat.sln -c Release
|
||||||
|
```
|
||||||
|
|
||||||
|
There are currently no tests in `HellionChat.sln`. If you add a test project, point it at the
|
||||||
|
relevant subsystems (privacy filter, configuration migration, message store) and mention it in the
|
||||||
|
PR.
|
||||||
|
|
||||||
|
For a smoke test in-game: build, copy the output into your Dalamud `devPlugins/HellionChat/`
|
||||||
|
directory and load it via `/xlplugins`.
|
||||||
|
|
||||||
|
## Continuous Integration
|
||||||
|
|
||||||
|
Every push and every pull request runs:
|
||||||
|
|
||||||
|
| Workflow | What it checks |
|
||||||
|
| ------------ | -------------------------------- |
|
||||||
|
| `build.yml` | `dotnet build` and `dotnet test` |
|
||||||
|
| `codeql.yml` | CodeQL security analysis |
|
||||||
|
|
||||||
|
A pull request will not be merged while either of these is failing. CodeQL findings on changed code
|
||||||
|
need to be addressed; pre-existing findings on untouched code are tracked separately.
|
||||||
|
|
||||||
|
## Translations
|
||||||
|
|
||||||
|
Hellion-specific strings live in `HellionChat/Resources/HellionStrings.resx` (English source) and
|
||||||
|
`HellionStrings.<lang>.resx` (per-language). These are accepted as direct pull requests.
|
||||||
|
|
||||||
|
The upstream Chat 2 strings in `HellionChat/Resources/Language.*.resx` are **not** translated here.
|
||||||
|
They are kept as-is from the last upstream sync and remain the work of the Chat 2 Crowdin community.
|
||||||
|
Active cherry-picking from upstream ended in the v1.4.x cycle (see
|
||||||
|
[`docs/UPSTREAM_SYNC.md`](docs/UPSTREAM_SYNC.md)), so future translation improvements to those
|
||||||
|
upstream strings will not flow into HellionChat automatically anymore. If you have improvements for
|
||||||
|
the original Chat 2 strings, please contribute them to
|
||||||
|
[Infiziert90/ChatTwo](https://github.com/Infiziert90/ChatTwo) directly.
|
||||||
|
|
||||||
|
## Licensing
|
||||||
|
|
||||||
|
By submitting a pull request you confirm that:
|
||||||
|
|
||||||
|
- Your contribution is your own work, or you have the right to contribute it under the project
|
||||||
|
licence.
|
||||||
|
- You agree that your contribution will be released under the [EUPL-1.2](LICENSE), the same licence
|
||||||
|
as the rest of the project.
|
||||||
|
|
||||||
|
There is no separate CLA. Forking HellionChat is explicitly permitted under the EUPL-1.2, as with
|
||||||
|
any EUPL-licensed project.
|
||||||
|
|
||||||
|
## Response Times
|
||||||
|
|
||||||
|
| Channel | Address |
|
||||||
|
| ------------- | --------------------------------------- |
|
||||||
|
| GitHub Issues | Preferred for bugs and feature requests |
|
||||||
|
| Discord DM | `@j.j_kazama` |
|
||||||
|
| Email | `kontakt@hellion-media.de` |
|
||||||
|
|
||||||
|
I respond on weekdays during European business hours and take weekends and FFXIV patch days off. A
|
||||||
|
pull request that sits for a few days has not been ignored. Pinging once after a week is fine;
|
||||||
|
please do not ping daily.
|
||||||
|
|
||||||
|
## First-time setup
|
||||||
|
|
||||||
|
After cloning, run once:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./scripts/setup-hooks.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
This wires `core.hooksPath` to `.githooks/`. The pre-push hook runs preflight
|
||||||
|
(versions/manifest/changelog/build).
|
||||||
|
|
||||||
|
### Test suite
|
||||||
|
|
||||||
|
The plugin's test suite lives in a separate local repository and is not part of this codebase. If
|
||||||
|
you need access for development, contact the maintainer.
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
HellionChat — a privacy-focused fork of ChatTwo for FINAL FANTASY XIV
|
||||||
|
|
||||||
|
═══════════════════════════════════════════════════════════════════
|
||||||
|
Source code
|
||||||
|
═══════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
|
Copyright (c) 2022-2026 **[Infiziert90 (Infi)](https://github.com/Infiziert90)** and **[Anna](https://github.com/anna-is-cute)**
|
||||||
|
Original ChatTwo authors and copyright holders of the upstream
|
||||||
|
plugin this fork is built on. Their work covers the message store,
|
||||||
|
the channel filtering, the sidebar tab system, the FFXIV chat
|
||||||
|
hooks, the localisation infrastructure and most of the
|
||||||
|
architecture HellionChat still relies on.
|
||||||
|
|
||||||
|
Copyright (c) 2025-2026 Florian Wathling / Hellion Online Media
|
||||||
|
HellionChat-specific modifications, including the privacy filter,
|
||||||
|
per-channel retention sweep, export pipeline, Auto-Tell-Tabs,
|
||||||
|
German localisation and the EUPL-1.2 fork maintenance.
|
||||||
|
|
||||||
|
Source code is licensed under the European Union Public Licence
|
||||||
|
(EUPL), Version 1.2 only. The full Licence text lives in the LICENSE
|
||||||
|
file at the root of this repository. The official Licence website is
|
||||||
|
at: <https://eupl.eu/1.2/en/>
|
||||||
|
|
||||||
|
This Work is provided "AS IS" without warranties of any kind. See
|
||||||
|
Article 7 (Disclaimer of Warranty) and Article 8 (Disclaimer of
|
||||||
|
Liability) of the Licence for the legally binding wording.
|
||||||
|
|
||||||
|
═══════════════════════════════════════════════════════════════════
|
||||||
|
Visual assets
|
||||||
|
═══════════════════════════════════════════════════════════════════
|
||||||
|
Copyright (c) 2026 Florian Eck
|
||||||
|
|
||||||
|
Designer of the Hellion Forge logo and Hellion Online Media logo
|
||||||
|
(variants located in docs/images and HellionChat/images).
|
||||||
|
Exclusive usage and marketing rights licensed to Hellion Online
|
||||||
|
Media. These assets are NOT covered by the EUPL-1.2 source code
|
||||||
|
licence above and may not be reused, modified, or redistributed
|
||||||
|
without separate permission from the copyright holder.
|
||||||
|
|
||||||
|
═══════════════════════════════════════════════════════════════════
|
||||||
|
Bundled assets
|
||||||
|
═══════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
|
Exo 2 font (HellionChat/Resources/HellionFont.ttf)
|
||||||
|
SIL Open Font License 1.1, full text in HellionFont-OFL.txt.
|
||||||
|
Bundled with permission per the OFL terms.
|
||||||
|
|
||||||
|
═══════════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
|
Acknowledgements directed at the upstream ChatTwo authors live in
|
||||||
|
NOTICE.md. The manual upstream-sync workflow lives in UPSTREAM_SYNC.md.
|
||||||
@@ -1,167 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using ChatTwo.Code;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Game.Text;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
||||||
|
|
||||||
namespace ChatTwo.Tests;
|
|
||||||
|
|
||||||
// Hellion Chat — Auto-Tell-Tabs history-preload coverage.
|
|
||||||
//
|
|
||||||
// These tests exercise MessageStore.GetTellHistoryWithSender, the query the
|
|
||||||
// AutoTellTabsService uses to populate a freshly spawned temp tab with the
|
|
||||||
// last conversations with that player.
|
|
||||||
//
|
|
||||||
// NOTE: like the rest of ChatTwo.Tests today, these will fail at runtime
|
|
||||||
// until the project's Dalamud.dll runtime dependency is sorted out (see
|
|
||||||
// Phase-2 backlog item "Test-Projekt fixen"). Compile-time the suite builds
|
|
||||||
// fine via DALAMUD_HOME, so the tests guard against API drift even before
|
|
||||||
// they can be executed locally.
|
|
||||||
[TestClass]
|
|
||||||
[TestSubject(typeof(MessageStore))]
|
|
||||||
public class AutoTellTabsHistoryTest
|
|
||||||
{
|
|
||||||
public TestContext TestContext { get; set; }
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
[Timeout(5000)]
|
|
||||||
public void GetTellHistoryWithSender_FiltersByNameAndWorld()
|
|
||||||
{
|
|
||||||
var tempDir = Directory.CreateTempSubdirectory("ChatTwo_test_");
|
|
||||||
var dbPath = Path.Join(tempDir.FullName, "test.db");
|
|
||||||
TestContext.WriteLine("Using database path: " + dbPath);
|
|
||||||
using var store = new MessageStore(dbPath);
|
|
||||||
|
|
||||||
const ulong receiver = 99001;
|
|
||||||
var now = DateTimeOffset.UtcNow;
|
|
||||||
|
|
||||||
// Two tells with the target sender, one with a different sender on
|
|
||||||
// the same world, one with the same name on a different world. Only
|
|
||||||
// the first two should make it into the result.
|
|
||||||
var asukaLichIn = TellMessage("Asuka", 76, receiver, now.AddMinutes(-30), ChatType.TellIncoming);
|
|
||||||
var asukaLichOut = TellMessage("Asuka", 76, receiver, now.AddMinutes(-20), ChatType.TellOutgoing);
|
|
||||||
var broboLich = TellMessage("Brobo", 76, receiver, now.AddMinutes(-10), ChatType.TellIncoming);
|
|
||||||
var asukaOmega = TellMessage("Asuka", 90, receiver, now.AddMinutes(-5), ChatType.TellIncoming);
|
|
||||||
|
|
||||||
store.UpsertMessage(asukaLichIn);
|
|
||||||
store.UpsertMessage(asukaLichOut);
|
|
||||||
store.UpsertMessage(broboLich);
|
|
||||||
store.UpsertMessage(asukaOmega);
|
|
||||||
|
|
||||||
var result = store.GetTellHistoryWithSender(receiver, "Asuka", 76, limit: 50);
|
|
||||||
|
|
||||||
Assert.AreEqual(2, result.Count);
|
|
||||||
// Result is oldest-first so a tab can append messages chronologically.
|
|
||||||
Assert.AreEqual(asukaLichIn.Id, result[0].Id);
|
|
||||||
Assert.AreEqual(asukaLichOut.Id, result[1].Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
[Timeout(5000)]
|
|
||||||
public void GetTellHistoryWithSender_RespectsLimit()
|
|
||||||
{
|
|
||||||
var tempDir = Directory.CreateTempSubdirectory("ChatTwo_test_");
|
|
||||||
var dbPath = Path.Join(tempDir.FullName, "test.db");
|
|
||||||
TestContext.WriteLine("Using database path: " + dbPath);
|
|
||||||
using var store = new MessageStore(dbPath);
|
|
||||||
|
|
||||||
const ulong receiver = 99002;
|
|
||||||
var now = DateTimeOffset.UtcNow;
|
|
||||||
|
|
||||||
for (var i = 0; i < 30; i++)
|
|
||||||
{
|
|
||||||
var msg = TellMessage("Asuka", 76, receiver, now.AddMinutes(-i - 1), ChatType.TellIncoming);
|
|
||||||
store.UpsertMessage(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
var result = store.GetTellHistoryWithSender(receiver, "Asuka", 76, limit: 5);
|
|
||||||
|
|
||||||
Assert.AreEqual(5, result.Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
[Timeout(5000)]
|
|
||||||
public void GetTellHistoryWithSender_ZeroLimitReturnsEmpty()
|
|
||||||
{
|
|
||||||
var tempDir = Directory.CreateTempSubdirectory("ChatTwo_test_");
|
|
||||||
var dbPath = Path.Join(tempDir.FullName, "test.db");
|
|
||||||
TestContext.WriteLine("Using database path: " + dbPath);
|
|
||||||
using var store = new MessageStore(dbPath);
|
|
||||||
|
|
||||||
const ulong receiver = 99003;
|
|
||||||
|
|
||||||
var msg = TellMessage("Asuka", 76, receiver, DateTimeOffset.UtcNow, ChatType.TellIncoming);
|
|
||||||
store.UpsertMessage(msg);
|
|
||||||
|
|
||||||
var result = store.GetTellHistoryWithSender(receiver, "Asuka", 76, limit: 0);
|
|
||||||
|
|
||||||
Assert.AreEqual(0, result.Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
[Timeout(5000)]
|
|
||||||
public void GetTellHistoryWithSender_IgnoresOtherReceivers()
|
|
||||||
{
|
|
||||||
var tempDir = Directory.CreateTempSubdirectory("ChatTwo_test_");
|
|
||||||
var dbPath = Path.Join(tempDir.FullName, "test.db");
|
|
||||||
TestContext.WriteLine("Using database path: " + dbPath);
|
|
||||||
using var store = new MessageStore(dbPath);
|
|
||||||
|
|
||||||
const ulong ourReceiver = 99004;
|
|
||||||
const ulong otherReceiver = 99005;
|
|
||||||
var now = DateTimeOffset.UtcNow;
|
|
||||||
|
|
||||||
// Tell on the local player's account.
|
|
||||||
var ours = TellMessage("Asuka", 76, ourReceiver, now.AddMinutes(-1), ChatType.TellIncoming);
|
|
||||||
// Same sender, but logged against a different local character —
|
|
||||||
// common when the user has alts. Must not surface.
|
|
||||||
var foreign = TellMessage("Asuka", 76, otherReceiver, now, ChatType.TellIncoming);
|
|
||||||
|
|
||||||
store.UpsertMessage(ours);
|
|
||||||
store.UpsertMessage(foreign);
|
|
||||||
|
|
||||||
var result = store.GetTellHistoryWithSender(ourReceiver, "Asuka", 76, limit: 50);
|
|
||||||
|
|
||||||
Assert.AreEqual(1, result.Count);
|
|
||||||
Assert.AreEqual(ours.Id, result[0].Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Message TellMessage(
|
|
||||||
string senderName,
|
|
||||||
uint senderWorld,
|
|
||||||
ulong receiver,
|
|
||||||
DateTimeOffset dateTime,
|
|
||||||
ChatType chatType)
|
|
||||||
{
|
|
||||||
var senderSeString = new SeStringBuilder()
|
|
||||||
.Add(new PlayerPayload(senderName, senderWorld))
|
|
||||||
.AddText(senderName)
|
|
||||||
.Add(RawPayload.LinkTerminator)
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
var contentSeString = new SeStringBuilder()
|
|
||||||
.AddText("test message")
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
var senderChunks = ChunkUtil.ToChunks(senderSeString, ChunkSource.Sender, chatType).ToList();
|
|
||||||
var contentChunks = ChunkUtil.ToChunks(contentSeString, ChunkSource.Content, chatType).ToList();
|
|
||||||
|
|
||||||
var chatCode = new ChatCode((XivChatType)chatType, XivChatRelationKind.LocalPlayer, XivChatRelationKind.LocalPlayer);
|
|
||||||
return new Message(
|
|
||||||
Guid.NewGuid(),
|
|
||||||
receiver,
|
|
||||||
0,
|
|
||||||
dateTime,
|
|
||||||
chatCode,
|
|
||||||
senderChunks,
|
|
||||||
contentChunks,
|
|
||||||
senderSeString,
|
|
||||||
contentSeString,
|
|
||||||
Guid.Empty);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFrameworks>net10.0-windows</TargetFrameworks>
|
|
||||||
|
|
||||||
<IsPackable>false</IsPackable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="JetBrains.Annotations" Version="2025.2.2" />
|
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
|
||||||
<PackageReference Include="morelinq" Version="4.4.0" />
|
|
||||||
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
|
|
||||||
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\ChatTwo\ChatTwo.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<DalamudLibPath>$(AppData)\XIVLauncher\addon\Hooks\dev</DalamudLibPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">
|
|
||||||
<DalamudLibPath>$(DALAMUD_HOME)</DalamudLibPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(IsCI)' == 'true'">
|
|
||||||
<DalamudLibPath>$(HOME)/dalamud</DalamudLibPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Dalamud">
|
|
||||||
<HintPath>$(DalamudLibPath)\Dalamud.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="FFXIVClientStructs">
|
|
||||||
<HintPath>$(DalamudLibPath)\FFXIVClientStructs.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Lumina">
|
|
||||||
<HintPath>$(DalamudLibPath)\Lumina.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Lumina.Excel">
|
|
||||||
<HintPath>$(DalamudLibPath)\Lumina.Excel.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -1,293 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using ChatTwo.Code;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Game.Text;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
||||||
using Chat2PartyFinderPayload = ChatTwo.Util.PartyFinderPayload;
|
|
||||||
|
|
||||||
namespace ChatTwo.Tests;
|
|
||||||
|
|
||||||
[TestClass]
|
|
||||||
[TestSubject(typeof(MessageStore))]
|
|
||||||
public class MessageStoreTest {
|
|
||||||
// From Message.cs
|
|
||||||
private static readonly byte[] ExtraChatChannelPayloadBytes = [0, 0x27, 18, 0x20];
|
|
||||||
|
|
||||||
public TestContext TestContext { get; set; }
|
|
||||||
|
|
||||||
public static string GetImportPath() {
|
|
||||||
string[] importPaths = [
|
|
||||||
@".\TestData",
|
|
||||||
@"..\TestData",
|
|
||||||
@"..\..\TestData",
|
|
||||||
@"..\..\..\TestData",
|
|
||||||
];
|
|
||||||
var importPath = importPaths.FirstOrDefault(Directory.Exists);
|
|
||||||
if (string.IsNullOrEmpty(importPath)) {
|
|
||||||
throw new DirectoryNotFoundException("Could not find the import path");
|
|
||||||
}
|
|
||||||
return importPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
[Timeout(5000)]
|
|
||||||
public void StoreAndRetrieve() {
|
|
||||||
var tempDir = Directory.CreateTempSubdirectory("ChatTwo_test_");
|
|
||||||
var dbPath = Path.Join(tempDir.FullName, "test.db");
|
|
||||||
TestContext.WriteLine("Using database path: " + dbPath);
|
|
||||||
using var store = new MessageStore(dbPath);
|
|
||||||
|
|
||||||
// Write the message.
|
|
||||||
var input = BigMessage();
|
|
||||||
store.UpsertMessage(input);
|
|
||||||
|
|
||||||
// Read the message back.
|
|
||||||
using var messageEnumerator = store.GetMostRecentMessages();
|
|
||||||
var messages = messageEnumerator.ToList();
|
|
||||||
Assert.AreEqual(1, messages.Count);
|
|
||||||
AssertMessagesEqual(input, messages.First());
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
[Timeout(5000)]
|
|
||||||
public void RetrieveMultiple() {
|
|
||||||
var tempDir = Directory.CreateTempSubdirectory("ChatTwo_test_");
|
|
||||||
var dbPath = Path.Join(tempDir.FullName, "test.db");
|
|
||||||
TestContext.WriteLine("Using database path: " + dbPath);
|
|
||||||
using var store = new MessageStore(dbPath);
|
|
||||||
|
|
||||||
// Insert 10 messages in the wrong order of date.
|
|
||||||
var messages = new List<Message>();
|
|
||||||
const uint receiver = 12345;
|
|
||||||
var now = DateTimeOffset.UtcNow;
|
|
||||||
for (var i = 0; i < 10; i++) {
|
|
||||||
var message = BigMessage(true, receiver, now.AddSeconds(-i));
|
|
||||||
TestContext.WriteLine($"Inserting message {i}: {message.Id}");
|
|
||||||
store.UpsertMessage(message);
|
|
||||||
messages.Add(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Insert a message for a different receiver. This shouldn't be returned
|
|
||||||
// because of the receiver filtering.
|
|
||||||
var otherReceiverMsg = BigMessage(receiver: receiver + 1, dateTime: now.AddSeconds(1));
|
|
||||||
TestContext.WriteLine($"Inserting other receiver message: {otherReceiverMsg.Id}");
|
|
||||||
store.UpsertMessage(otherReceiverMsg);
|
|
||||||
|
|
||||||
// Query the most recent 5 messages. Should return the 4 newest messages
|
|
||||||
// from the list, as well as the different receiver message because we
|
|
||||||
// aren't filtering.
|
|
||||||
using var unfilteredMessageEnumerator = store.GetMostRecentMessages(count: 5);
|
|
||||||
var outputMessages = unfilteredMessageEnumerator.ToList();
|
|
||||||
var gotIds = outputMessages.Select(m => m.Id).ToList();
|
|
||||||
TestContext.WriteLine($"Query 1 got IDs: {string.Join(", ", gotIds)}");
|
|
||||||
AssertGuidsEqual(new List<Guid> {
|
|
||||||
messages[3].Id,
|
|
||||||
messages[2].Id,
|
|
||||||
messages[1].Id,
|
|
||||||
messages[0].Id,
|
|
||||||
otherReceiverMsg.Id
|
|
||||||
}, gotIds);
|
|
||||||
|
|
||||||
// Query the most recent 5 messages but filter by receiver ID.
|
|
||||||
using var filteredByReceiverMessageEnumerator = store.GetMostRecentMessages(receiver: receiver, count: 5);
|
|
||||||
outputMessages = filteredByReceiverMessageEnumerator.ToList();
|
|
||||||
gotIds = outputMessages.Select(m => m.Id).ToList();
|
|
||||||
TestContext.WriteLine($"Query 2 got IDs: {string.Join(", ", gotIds)}");
|
|
||||||
AssertGuidsEqual(new List<Guid> {
|
|
||||||
messages[4].Id,
|
|
||||||
messages[3].Id,
|
|
||||||
messages[2].Id,
|
|
||||||
messages[1].Id,
|
|
||||||
messages[0].Id,
|
|
||||||
}, gotIds);
|
|
||||||
|
|
||||||
// Query the most recent 5 messages but only since a specific date.
|
|
||||||
using var filteredByReceiverAndDateMessageEnumerator = store.GetMostRecentMessages(receiver, since: messages[1].Date, count: 5);
|
|
||||||
outputMessages = filteredByReceiverAndDateMessageEnumerator.ToList();
|
|
||||||
gotIds = outputMessages.Select(m => m.Id).ToList();
|
|
||||||
TestContext.WriteLine($"Query 3 got IDs: {string.Join(", ", gotIds)}");
|
|
||||||
AssertGuidsEqual(new List<Guid> {
|
|
||||||
messages[1].Id,
|
|
||||||
messages[0].Id,
|
|
||||||
}, gotIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
[Timeout(5000)]
|
|
||||||
// This test guards against the data format changing in an incompatible way.
|
|
||||||
public void RetrieveExisting() {
|
|
||||||
var input = BigMessage(uniqId: false);
|
|
||||||
|
|
||||||
var dbPath = Path.Join(GetImportPath(), "existing.db");
|
|
||||||
TestContext.WriteLine($"Using existing database: {dbPath}");
|
|
||||||
Assert.IsTrue(File.Exists(dbPath));
|
|
||||||
|
|
||||||
// Uncomment this section to regenerate the existing database.
|
|
||||||
/*
|
|
||||||
File.Delete(dbPath);
|
|
||||||
using (var newStore = new MessageStore(dbPath)) {
|
|
||||||
newStore.UpsertMessage(input);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
using var store = new MessageStore(dbPath);
|
|
||||||
using var existingMessageEnumerator = store.GetMostRecentMessages();
|
|
||||||
var output = existingMessageEnumerator.ToList();
|
|
||||||
Assert.AreEqual(1, output.Count);
|
|
||||||
AssertMessagesEqual(input, output[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
[Timeout(30_000)]
|
|
||||||
public void ProfileMany() {
|
|
||||||
const int count = 20_000;
|
|
||||||
|
|
||||||
var tempDir = Directory.CreateTempSubdirectory("ChatTwo_test_");
|
|
||||||
var dbPath = Path.Join(tempDir.FullName, "test.db");
|
|
||||||
TestContext.WriteLine("Using database path: " + dbPath);
|
|
||||||
using var store = new MessageStore(dbPath);
|
|
||||||
|
|
||||||
for (var i = 0; i < count; i++) {
|
|
||||||
var message = BigMessage(uniqId: true);
|
|
||||||
store.UpsertMessage(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
using var messageEnumerator = store.GetMostRecentMessages(count: count);
|
|
||||||
var messages = messageEnumerator.ToList();
|
|
||||||
Assert.AreEqual(count, messages.Count);
|
|
||||||
foreach (var message in messages) {
|
|
||||||
// Load the message because they are lazily parsed.
|
|
||||||
Assert.IsTrue(message.Id != Guid.Empty);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static Message BigMessage(bool uniqId = true, uint receiver = 12345, DateTimeOffset? dateTime = null) {
|
|
||||||
// NOTE: These values aren't valid in the game.
|
|
||||||
// NOTE: we can't test UiForeground, UiGlow, or AutoTranslatePayload
|
|
||||||
// because they load data from the game.
|
|
||||||
var senderSeString = new SeStringBuilder()
|
|
||||||
.AddText("<")
|
|
||||||
.Add(new PlayerPayload("Player Name", 12345))
|
|
||||||
.AddItalics("Player Name")
|
|
||||||
.Add(RawPayload.LinkTerminator)
|
|
||||||
.AddText(">: ")
|
|
||||||
.Build();
|
|
||||||
var extraChatId = Guid.Parse("03d9e6d4-dc1a-4005-bbe7-66b8c3529277");
|
|
||||||
var contentSeString = new SeStringBuilder()
|
|
||||||
.Add(new RawPayload(ExtraChatChannelPayloadBytes.Concat(extraChatId.ToByteArray()).ToArray()))
|
|
||||||
.AddIcon(BitmapFontIcon.IslandSanctuary)
|
|
||||||
.AddMapLink(1, 2, 3, 4)
|
|
||||||
.AddText("map")
|
|
||||||
.Add(RawPayload.LinkTerminator)
|
|
||||||
.AddQuestLink(12345)
|
|
||||||
.AddText("quest")
|
|
||||||
.Add(RawPayload.LinkTerminator)
|
|
||||||
.Add(new DalamudLinkPayload())
|
|
||||||
.AddText("dalamud")
|
|
||||||
.Add(RawPayload.LinkTerminator)
|
|
||||||
.AddStatusLink(12345)
|
|
||||||
.AddText("status")
|
|
||||||
.Add(RawPayload.LinkTerminator)
|
|
||||||
.AddPartyFinderLink(12345)
|
|
||||||
.AddText("party finder")
|
|
||||||
.Add(RawPayload.LinkTerminator)
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
// Add Chat 2 specific payloads (that can't be serialized into the
|
|
||||||
// SeString).
|
|
||||||
var contentChunks = ChunkUtil.ToChunks(contentSeString, ChunkSource.Content, ChatType.Say).ToList();
|
|
||||||
contentChunks = contentChunks.Concat([
|
|
||||||
new TextChunk(ChunkSource.Content, new Chat2PartyFinderPayload(12345), "chat 2 party finder"),
|
|
||||||
new TextChunk(ChunkSource.Content, new AchievementPayload(12345), "chat 2 achievement"),
|
|
||||||
new TextChunk(ChunkSource.Content, new UriPayload(new Uri("https://dalamud.dev")), "chat 2 uri"),
|
|
||||||
]).ToList();
|
|
||||||
|
|
||||||
var chatCode = new ChatCode((XivChatType)46, XivChatRelationKind.LocalPlayer, XivChatRelationKind.EngagedEnemy);
|
|
||||||
return new Message(
|
|
||||||
uniqId ? Guid.NewGuid() : Guid.Parse("f011343e-6a21-49e5-a6f9-238f0f1f8c2c"),
|
|
||||||
receiver,
|
|
||||||
54321,
|
|
||||||
dateTime ?? DateTimeOffset.FromUnixTimeMilliseconds(1713520182440),
|
|
||||||
chatCode,
|
|
||||||
ChunkUtil.ToChunks(senderSeString, ChunkSource.Sender, ChatType.Debug).ToList(),
|
|
||||||
contentChunks,
|
|
||||||
senderSeString,
|
|
||||||
contentSeString,
|
|
||||||
extraChatId
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static void AssertMessagesEqual(Message input, Message output) {
|
|
||||||
// Check basic fields.
|
|
||||||
Assert.AreEqual(input.Id, output.Id);
|
|
||||||
Assert.AreEqual(input.Receiver, output.Receiver);
|
|
||||||
Assert.AreEqual(input.ContentId, output.ContentId);
|
|
||||||
// Assert time is within 1 second
|
|
||||||
var timeDifference = Math.Abs(input.Date.ToUniversalTime().Subtract(output.Date.ToUniversalTime()).TotalSeconds);
|
|
||||||
Assert.IsTrue(timeDifference < 1);
|
|
||||||
Assert.AreEqual(input.Code, output.Code);
|
|
||||||
Assert.AreEqual($"{input.SenderSource.Encode():X}", $"{output.SenderSource.Encode():X}");
|
|
||||||
Assert.AreEqual($"{input.ContentSource.Encode():X}", $"{output.ContentSource.Encode():X}");
|
|
||||||
Assert.AreEqual(input.SortCodeV2, output.SortCodeV2);
|
|
||||||
Assert.AreEqual(input.ExtraChatChannel, output.ExtraChatChannel);
|
|
||||||
|
|
||||||
// Check chunks.
|
|
||||||
AssertChunksEqual(input.Sender, output.Sender);
|
|
||||||
AssertChunksEqual(input.Content, output.Content);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void AssertChunksEqual(IReadOnlyList<Chunk> inputChunks, IReadOnlyList<Chunk> outputChunks) {
|
|
||||||
Assert.AreEqual(inputChunks.Count, outputChunks.Count);
|
|
||||||
for (var i = 0; i < inputChunks.Count; i++) {
|
|
||||||
var inputChunk = inputChunks[i];
|
|
||||||
var outputChunk = outputChunks[i];
|
|
||||||
Assert.AreEqual(inputChunk.Source, outputChunk.Source);
|
|
||||||
switch (inputChunk.Link) {
|
|
||||||
case AchievementPayload inputAchievementPayload:
|
|
||||||
Assert.AreEqual(inputAchievementPayload.Id, ((AchievementPayload) outputChunk.Link)!.Id);
|
|
||||||
break;
|
|
||||||
case Chat2PartyFinderPayload inputPartyFinderPayload:
|
|
||||||
Assert.AreEqual(inputPartyFinderPayload.Id, ((Chat2PartyFinderPayload) outputChunk.Link)!.Id);
|
|
||||||
break;
|
|
||||||
case UriPayload inputUriPayload:
|
|
||||||
Assert.AreEqual(inputUriPayload.Uri, ((UriPayload) outputChunk.Link)!.Uri);
|
|
||||||
break;
|
|
||||||
case null:
|
|
||||||
Assert.IsTrue(outputChunk.Link == null);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Assert.AreEqual($"{inputChunk.Link.Encode():X}", $"{outputChunk.Link!.Encode():X}");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (inputChunk) {
|
|
||||||
case TextChunk inputTextChunk:
|
|
||||||
var outputTextChunk = (TextChunk)outputChunk;
|
|
||||||
Assert.AreEqual(inputTextChunk.FallbackColour, outputTextChunk.FallbackColour);
|
|
||||||
Assert.AreEqual(inputTextChunk.Foreground, outputTextChunk.Foreground);
|
|
||||||
Assert.AreEqual(inputTextChunk.Glow, outputTextChunk.Glow);
|
|
||||||
Assert.AreEqual(inputTextChunk.Italic, outputTextChunk.Italic);
|
|
||||||
Assert.AreEqual(inputTextChunk.Content, outputTextChunk.Content);
|
|
||||||
break;
|
|
||||||
case IconChunk inputIconChunk:
|
|
||||||
Assert.AreEqual(inputIconChunk.Icon, ((IconChunk) outputChunk).Icon);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new Exception("Unknown chunk type");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void AssertGuidsEqual(IReadOnlyList<Guid> expected, IReadOnlyList<Guid> got) {
|
|
||||||
Assert.AreEqual(expected.Count, got.Count);
|
|
||||||
for (var i = 0; i < expected.Count; i++) {
|
|
||||||
Assert.AreEqual(expected[i].ToString(), got[i].ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Vendored
BIN
Binary file not shown.
-22
@@ -1,22 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChatTwo", "ChatTwo\ChatTwo.csproj", "{739F75E6-B65F-41EF-9D90-F7BC519E4875}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChatTwo.Tests", "ChatTwo.Tests\ChatTwo.Tests.csproj", "{A9FE423A-240C-4EDA-ACC6-21474B562128}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{A9FE423A-240C-4EDA-ACC6-21474B562128}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{A9FE423A-240C-4EDA-ACC6-21474B562128}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{A9FE423A-240C-4EDA-ACC6-21474B562128}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{A9FE423A-240C-4EDA-ACC6-21474B562128}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
@@ -1,358 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using ChatTwo.Code;
|
|
||||||
using ChatTwo.GameFunctions.Types;
|
|
||||||
using ChatTwo.Resources;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Game.Text;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
|
||||||
|
|
||||||
namespace ChatTwo;
|
|
||||||
|
|
||||||
// Hellion Chat — Auto-Tell-Tabs.
|
|
||||||
//
|
|
||||||
// Spawns a session-only tab per /tell partner so a club greeter can track
|
|
||||||
// multiple parallel conversations without losing context. Subscribes to
|
|
||||||
// MessageManager.MessageProcessed for live tells and to ClientState.Logout
|
|
||||||
// for the cleanup pass; everything else hangs off these two entry points.
|
|
||||||
//
|
|
||||||
// See spec: Hellion Chat Auto-Tell-Tabs Spec (Obsidian vault).
|
|
||||||
internal sealed class AutoTellTabsService : IDisposable
|
|
||||||
{
|
|
||||||
private readonly Plugin _plugin;
|
|
||||||
private readonly MessageManager _messageManager;
|
|
||||||
private readonly MessageStore _store;
|
|
||||||
private readonly object _tempTabsLock = new();
|
|
||||||
|
|
||||||
private bool _initialized;
|
|
||||||
|
|
||||||
internal AutoTellTabsService(Plugin plugin, MessageManager messageManager, MessageStore store)
|
|
||||||
{
|
|
||||||
_plugin = plugin;
|
|
||||||
_messageManager = messageManager;
|
|
||||||
_store = store;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal int ActiveTempTabCount
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
lock (_tempTabsLock)
|
|
||||||
{
|
|
||||||
return Plugin.Config.Tabs.Count(t => t.IsTempTab);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void Initialize()
|
|
||||||
{
|
|
||||||
if (_initialized)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_messageManager.MessageProcessed += HandleTell;
|
|
||||||
Plugin.ClientState.Logout += OnLogout;
|
|
||||||
_initialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
if (!_initialized)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Plugin.ClientState.Logout -= OnLogout;
|
|
||||||
_messageManager.MessageProcessed -= HandleTell;
|
|
||||||
_initialized = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void HandleTell(Message message)
|
|
||||||
{
|
|
||||||
if (!Plugin.Config.EnableAutoTellTabs)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (message.Code.Type != ChatType.TellIncoming && message.Code.Type != ChatType.TellOutgoing)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var partner = ExtractTellPartner(message);
|
|
||||||
if (partner == null)
|
|
||||||
{
|
|
||||||
// Real message without a player payload — e.g. GM tells, which
|
|
||||||
// we deliberately skip. The diagnostics make future regressions
|
|
||||||
// (FFXIV changing tell payload shape, new edge cases) findable
|
|
||||||
// without having to crank up debug logging at the source.
|
|
||||||
Plugin.Log.Warning(
|
|
||||||
$"[AutoTellTabs] Could not extract tell partner. type={message.Code.Type}, " +
|
|
||||||
$"senderChunks={message.Sender.Count}, contentChunks={message.Content.Count}, " +
|
|
||||||
$"senderSourcePayloads={message.SenderSource?.Payloads?.Count ?? 0}, " +
|
|
||||||
$"contentSourcePayloads={message.ContentSource?.Payloads?.Count ?? 0}");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
lock (_tempTabsLock)
|
|
||||||
{
|
|
||||||
var existing = FindTempTab(partner.Value.Name, partner.Value.World);
|
|
||||||
if (existing != null)
|
|
||||||
{
|
|
||||||
// Tab already exists; Tab.Matches has already routed this
|
|
||||||
// message via the MessageManager pipeline (see Task 2 sender
|
|
||||||
// filter).
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ActiveTempTabCount >= Plugin.Config.AutoTellTabsLimit)
|
|
||||||
{
|
|
||||||
DropOldestTempTab();
|
|
||||||
}
|
|
||||||
|
|
||||||
SpawnTempTab(partner.Value, message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private (string Name, uint World)? ExtractTellPartner(Message message)
|
|
||||||
{
|
|
||||||
if (message.Code.Type == ChatType.TellIncoming)
|
|
||||||
{
|
|
||||||
// Incoming tell: the sender is the conversation partner. The
|
|
||||||
// PlayerPayload normally rides on a chunk's Link slot, but for
|
|
||||||
// some tell types FFXIV only puts it in the raw SeString —
|
|
||||||
// fall back to that before giving up.
|
|
||||||
var fromSender = ChunkUtil.TryGetPlayerPayload(message.Sender)
|
|
||||||
?? ChunkUtil.TryGetPlayerPayload(message.SenderSource);
|
|
||||||
if (fromSender != null)
|
|
||||||
{
|
|
||||||
return (fromSender.PlayerName, fromSender.World.RowId);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Outgoing tell: the local player is the sender, the partner shows
|
|
||||||
// up either as a payload in the content (for tells typed via the
|
|
||||||
// Chat 2 input bar) or as the channel's tracked tell target (set by
|
|
||||||
// the SetContextTellTarget game hook). Same SeString fallback.
|
|
||||||
var fromContent = ChunkUtil.TryGetPlayerPayload(message.Content)
|
|
||||||
?? ChunkUtil.TryGetPlayerPayload(message.ContentSource)
|
|
||||||
?? ChunkUtil.TryGetPlayerPayload(message.Sender)
|
|
||||||
?? ChunkUtil.TryGetPlayerPayload(message.SenderSource);
|
|
||||||
if (fromContent != null)
|
|
||||||
{
|
|
||||||
return (fromContent.PlayerName, fromContent.World.RowId);
|
|
||||||
}
|
|
||||||
|
|
||||||
var current = _plugin.CurrentTab.CurrentChannel.TellTarget
|
|
||||||
?? _plugin.CurrentTab.CurrentChannel.TempTellTarget;
|
|
||||||
if (current != null && current.IsSet())
|
|
||||||
{
|
|
||||||
return (current.Name, current.World);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Tab? FindTempTab(string name, uint world)
|
|
||||||
{
|
|
||||||
return Plugin.Config.Tabs.FirstOrDefault(t =>
|
|
||||||
t.IsTempTab
|
|
||||||
&& t.TellTarget != null
|
|
||||||
&& string.Equals(t.TellTarget.Name, name, StringComparison.OrdinalIgnoreCase)
|
|
||||||
&& t.TellTarget.World == world);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DropOldestTempTab()
|
|
||||||
{
|
|
||||||
// Greeted tabs are dropped before un-greeted ones (the user said
|
|
||||||
// "I'm done with that conversation"), and within each bucket we
|
|
||||||
// pick the oldest LastActivity. This protects active conversations
|
|
||||||
// and unfinished greetings while still freeing up a slot.
|
|
||||||
var victim = Plugin.Config.Tabs
|
|
||||||
.Select((tab, idx) => (Tab: tab, Index: idx))
|
|
||||||
.Where(t => t.Tab.IsTempTab)
|
|
||||||
.OrderByDescending(t => t.Tab.IsGreeted)
|
|
||||||
.ThenBy(t => t.Tab.LastActivity)
|
|
||||||
.FirstOrDefault();
|
|
||||||
|
|
||||||
if (victim.Tab == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Plugin.Config.Tabs.RemoveAt(victim.Index);
|
|
||||||
|
|
||||||
// Re-anchor the active tab so the user does not silently end up on
|
|
||||||
// a different conversation when their tab gets dropped or shifted.
|
|
||||||
if (victim.Index <= _plugin.LastTab)
|
|
||||||
{
|
|
||||||
_plugin.WantedTab = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SpawnTempTab((string Name, uint World) partner, Message currentMessage)
|
|
||||||
{
|
|
||||||
var tab = BuildTempTab(partner.Name, partner.World);
|
|
||||||
|
|
||||||
// Preload first so the tab opens with chronological history above
|
|
||||||
// the current message — and so a slow DB query never causes a
|
|
||||||
// visible "empty tab, then history pops in" effect on screen.
|
|
||||||
PreloadHistory(tab, partner.Name, partner.World);
|
|
||||||
|
|
||||||
tab.AddMessage(currentMessage, unread: true);
|
|
||||||
Plugin.Config.Tabs.Add(tab);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Tab BuildTempTab(string playerName, uint worldRowId)
|
|
||||||
{
|
|
||||||
return new Tab
|
|
||||||
{
|
|
||||||
Name = FormatTabName(playerName, worldRowId),
|
|
||||||
IsTempTab = true,
|
|
||||||
AllSenderMessages = true,
|
|
||||||
TellTarget = new TellTarget(playerName, worldRowId, 0, TellReason.Direct),
|
|
||||||
Channel = InputChannel.Tell,
|
|
||||||
DisplayTimestamp = true,
|
|
||||||
UnreadMode = UnreadMode.Unseen,
|
|
||||||
HideWhenInactive = false,
|
|
||||||
SelectedChannels = new Dictionary<ChatType, (ChatSource, ChatSource)>
|
|
||||||
{
|
|
||||||
[ChatType.TellIncoming] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.TellOutgoing] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string FormatTabName(string playerName, uint worldRowId)
|
|
||||||
{
|
|
||||||
if (Sheets.WorldSheet.TryGetRow(worldRowId, out var worldRow))
|
|
||||||
{
|
|
||||||
return $"{playerName}@{worldRow.Name}";
|
|
||||||
}
|
|
||||||
// World sheet lookup miss is rare (only for FFXIV worlds Dalamud has
|
|
||||||
// not yet seen). Fall back to the raw RowId so the user still has a
|
|
||||||
// unique, readable label.
|
|
||||||
return $"{playerName}@World{worldRowId}";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PreloadHistory(Tab tab, string senderName, uint senderWorld)
|
|
||||||
{
|
|
||||||
var preloadCount = Plugin.Config.AutoTellTabsHistoryPreload;
|
|
||||||
if (preloadCount <= 0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var history = _store.GetTellHistoryWithSender(
|
|
||||||
_messageManager.CurrentContentId,
|
|
||||||
senderName,
|
|
||||||
senderWorld,
|
|
||||||
preloadCount);
|
|
||||||
|
|
||||||
if (history.Count == 0)
|
|
||||||
{
|
|
||||||
// No prior tells with this player — leave the tab to start
|
|
||||||
// empty so the user does not see a "history loaded" marker
|
|
||||||
// sitting alone above the very first message.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The history list is already oldest-first, so a plain AddPrune
|
|
||||||
// loop produces the chronological order the user expects to see
|
|
||||||
// when the tab opens.
|
|
||||||
foreach (var message in history)
|
|
||||||
{
|
|
||||||
tab.Messages.AddPrune(message, MessageManager.MessageDisplayLimit);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Visible separator between the loaded history and the live
|
|
||||||
// tell that triggered this spawn. Goes in last so it sorts
|
|
||||||
// after the historical messages but before the current one.
|
|
||||||
tab.Messages.AddPrune(
|
|
||||||
MakeSystemMarker(HellionStrings.AutoTellTabs_HistorySeparator),
|
|
||||||
MessageManager.MessageDisplayLimit);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
// Non-fatal: the tab still spawns, but the user gets a visible
|
|
||||||
// notice instead of silently missing history. The error logs
|
|
||||||
// once with full stack trace for diagnosis.
|
|
||||||
Plugin.Log.Error(ex, "[AutoTellTabs] History preload failed");
|
|
||||||
tab.Messages.AddPrune(
|
|
||||||
MakeSystemMarker(HellionStrings.AutoTellTabs_HistoryLoadError),
|
|
||||||
MessageManager.MessageDisplayLimit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Message MakeSystemMarker(string text)
|
|
||||||
{
|
|
||||||
var seString = new SeStringBuilder().AddText(text).Build();
|
|
||||||
var chunks = ChunkUtil.ToChunks(seString, ChunkSource.Content, ChatType.System).ToList();
|
|
||||||
var code = new ChatCode((XivChatType)ChatType.System, 0, 0);
|
|
||||||
return Message.FakeMessage(chunks, code);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void MarkGreeted(Tab tab)
|
|
||||||
{
|
|
||||||
SetGreeted(tab, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void UnmarkGreeted(Tab tab)
|
|
||||||
{
|
|
||||||
SetGreeted(tab, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal bool IsGreeted(Tab tab)
|
|
||||||
{
|
|
||||||
return tab.IsGreeted;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SetGreeted(Tab tab, bool greeted)
|
|
||||||
{
|
|
||||||
if (tab == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
lock (_tempTabsLock)
|
|
||||||
{
|
|
||||||
// Frame-race guard (E5): the sidebar might still render a tab
|
|
||||||
// that has already been removed by LRU drop or logout cleanup.
|
|
||||||
// Silently skip the toggle so we don't mutate stale state.
|
|
||||||
if (!Plugin.Config.Tabs.Contains(tab))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
tab.IsGreeted = greeted;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnLogout(int type, int code)
|
|
||||||
{
|
|
||||||
lock (_tempTabsLock)
|
|
||||||
{
|
|
||||||
// Snapshot whether the active tab is about to be removed, BEFORE
|
|
||||||
// we mutate the list — index lookups would lie to us afterwards.
|
|
||||||
var lastIndex = _plugin.LastTab;
|
|
||||||
var lastIndexValid = lastIndex >= 0 && lastIndex < Plugin.Config.Tabs.Count;
|
|
||||||
var currentWasTempTab = lastIndexValid && Plugin.Config.Tabs[lastIndex].IsTempTab;
|
|
||||||
|
|
||||||
Plugin.Config.Tabs.RemoveAll(t => t.IsTempTab);
|
|
||||||
|
|
||||||
// Force a switch to tab 0 if the active tab was a temp tab OR
|
|
||||||
// if drops before the active index pushed LastTab out of range.
|
|
||||||
// Otherwise the user keeps their current persistent tab.
|
|
||||||
var stillValid = lastIndex >= 0 && lastIndex < Plugin.Config.Tabs.Count;
|
|
||||||
if (currentWasTempTab || !stillValid)
|
|
||||||
{
|
|
||||||
_plugin.WantedTab = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
<Project Sdk="Dalamud.NET.Sdk/15.0.0">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!-- Hellion Chat versioning runs separately from upstream Chat 2.
|
|
||||||
0.1.0 is our bootstrap release; the underlying Chat 2 base is
|
|
||||||
called out in the yaml changelog so users can see what it
|
|
||||||
derives from. -->
|
|
||||||
<Version>0.5.1</Version>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<!-- HellionChat fork: assembly is renamed so Dalamud uses
|
|
||||||
pluginConfigs/HellionChat instead of pluginConfigs/ChatTwo,
|
|
||||||
keeping our state independent from the upstream plugin.
|
|
||||||
Code namespace stays ChatTwo.* so upstream cherry-picks
|
|
||||||
apply cleanly. -->
|
|
||||||
<AssemblyName>HellionChat</AssemblyName>
|
|
||||||
<RootNamespace>ChatTwo</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="MessagePack" Version="3.1.4" />
|
|
||||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.0" />
|
|
||||||
<PackageReference Include="morelinq" Version="4.4.0" />
|
|
||||||
<PackageReference Include="Pidgin" Version="3.3.0" />
|
|
||||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Update="Resources\Language.Designer.cs">
|
|
||||||
<DesignTime>True</DesignTime>
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DependentUpon>Language.resx</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Update="Resources\Language.resx">
|
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
|
||||||
<LastGenOutput>Language.Designer.cs</LastGenOutput>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<!-- HellionChat — Hellion-specific resource bundle (HellionStrings.resx
|
|
||||||
+ HellionStrings.<lang>.resx) is picked up automatically by the SDK
|
|
||||||
default include. Designer.cs is hand-maintained, no auto-gen needed. -->
|
|
||||||
|
|
||||||
<!-- Bundled Hellion font (Exo 2, OFL-1.1). Embedded as a manifest
|
|
||||||
resource with a fixed LogicalName so FontManager can pull the
|
|
||||||
bytes back at runtime via AddFontFromMemory. The OFL license
|
|
||||||
text travels with it inside the assembly to satisfy the
|
|
||||||
"license must be distributed with the font" clause. -->
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Resources\HellionFont.ttf">
|
|
||||||
<LogicalName>HellionFont.ttf</LogicalName>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="Resources\HellionFont-OFL.txt">
|
|
||||||
<LogicalName>HellionFont-OFL.txt</LogicalName>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="images\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<!-- Copy images/icon.png next to the built DLL so Dalamud's local
|
|
||||||
plugin loader finds it at <plugindir>/images/icon.png. The
|
|
||||||
DalamudPackager.targets file in this directory then includes
|
|
||||||
the same path inside the release ZIP — see that file for the
|
|
||||||
full packaging override. -->
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="images\icon.png">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
using Dalamud.Game.Text;
|
|
||||||
|
|
||||||
namespace ChatTwo.Code;
|
|
||||||
|
|
||||||
[Flags]
|
|
||||||
public enum ChatSource : ushort
|
|
||||||
{
|
|
||||||
None = 0,
|
|
||||||
|
|
||||||
/// <summary>The player currently controlled by the local client.</summary>
|
|
||||||
LocalPlayer = 1 << XivChatRelationKind.LocalPlayer,
|
|
||||||
|
|
||||||
/// <summary>A player in the same 4-man or 8-man party as the local player.</summary>
|
|
||||||
PartyMember = 1 << XivChatRelationKind.PartyMember,
|
|
||||||
|
|
||||||
/// <summary>A player in the same alliance raid.</summary>
|
|
||||||
AllianceMember = 1 << XivChatRelationKind.AllianceMember,
|
|
||||||
|
|
||||||
/// <summary>A player not in the local player's party or alliance.</summary>
|
|
||||||
OtherPlayer = 1 << XivChatRelationKind.OtherPlayer,
|
|
||||||
|
|
||||||
/// <summary>An enemy entity that is currently in combat with the player or party.</summary>
|
|
||||||
EngagedEnemy = 1 << XivChatRelationKind.EngagedEnemy,
|
|
||||||
|
|
||||||
/// <summary>An enemy entity that is not yet in combat or claimed.</summary>
|
|
||||||
UnengagedEnemy = 1 << XivChatRelationKind.UnengagedEnemy,
|
|
||||||
|
|
||||||
/// <summary>An NPC that is friendly or neutral to the player (e.g., EventNPCs).</summary>
|
|
||||||
FriendlyNpc = 1 << XivChatRelationKind.FriendlyNpc,
|
|
||||||
|
|
||||||
/// <summary>A pet (Summoner/Scholar) or companion (Chocobo) belonging to the local player.</summary>
|
|
||||||
PetOrCompanion = 1 << XivChatRelationKind.PetOrCompanion,
|
|
||||||
|
|
||||||
/// <summary>A pet or companion belonging to a member of the local player's party.</summary>
|
|
||||||
PetOrCompanionParty = 1 << XivChatRelationKind.PetOrCompanionParty,
|
|
||||||
|
|
||||||
/// <summary>A pet or companion belonging to a member of the alliance.</summary>
|
|
||||||
PetOrCompanionAlliance = 1 << XivChatRelationKind.PetOrCompanionAlliance,
|
|
||||||
|
|
||||||
/// <summary>A pet or companion belonging to a player not in the party or alliance.</summary>
|
|
||||||
PetOrCompanionOther = 1 << XivChatRelationKind.PetOrCompanionOther,
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using ChatTwo.Resources;
|
|
||||||
|
|
||||||
namespace ChatTwo.Code;
|
|
||||||
|
|
||||||
internal static class ChatSourceExt
|
|
||||||
{
|
|
||||||
internal const ChatSource All =
|
|
||||||
ChatSource.LocalPlayer | ChatSource.PartyMember | ChatSource.AllianceMember |
|
|
||||||
ChatSource.OtherPlayer | ChatSource.EngagedEnemy | ChatSource.UnengagedEnemy |
|
|
||||||
ChatSource.FriendlyNpc | ChatSource.PetOrCompanion | ChatSource.PetOrCompanionParty |
|
|
||||||
ChatSource.PetOrCompanionAlliance | ChatSource.PetOrCompanionOther;
|
|
||||||
|
|
||||||
internal static string Name(this ChatSource source) => source switch
|
|
||||||
{
|
|
||||||
ChatSource.LocalPlayer => Language.ChatSource_Self,
|
|
||||||
ChatSource.PartyMember => Language.ChatSource_PartyMember,
|
|
||||||
ChatSource.AllianceMember => Language.ChatSource_AllianceMember,
|
|
||||||
ChatSource.OtherPlayer => Language.ChatSource_Other,
|
|
||||||
ChatSource.EngagedEnemy => Language.ChatSource_EngagedEnemy,
|
|
||||||
ChatSource.UnengagedEnemy => Language.ChatSource_UnengagedEnemy,
|
|
||||||
ChatSource.FriendlyNpc => Language.ChatSource_FriendlyNpc,
|
|
||||||
ChatSource.PetOrCompanion => Language.ChatSource_SelfPet,
|
|
||||||
ChatSource.PetOrCompanionParty => Language.ChatSource_PartyPet,
|
|
||||||
ChatSource.PetOrCompanionAlliance => Language.ChatSource_AlliancePet,
|
|
||||||
ChatSource.PetOrCompanionOther => Language.ChatSource_OtherPet,
|
|
||||||
_ => throw new ArgumentOutOfRangeException(nameof(source), source, null),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,486 +0,0 @@
|
|||||||
using ChatTwo.Resources;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Game.Config;
|
|
||||||
|
|
||||||
namespace ChatTwo.Code;
|
|
||||||
|
|
||||||
internal static class ChatTypeExt
|
|
||||||
{
|
|
||||||
internal static IEnumerable<(string, ChatType[])> SortOrder =>
|
|
||||||
[
|
|
||||||
(Language.Options_Tabs_ChannelTypes_Special, [ChatType.Debug, ChatType.Urgent, ChatType.Notice]),
|
|
||||||
|
|
||||||
(Language.Options_Tabs_ChannelTypes_Chat,
|
|
||||||
[
|
|
||||||
ChatType.Say,
|
|
||||||
ChatType.Yell,
|
|
||||||
ChatType.Shout,
|
|
||||||
ChatType.TellIncoming,
|
|
||||||
ChatType.TellOutgoing,
|
|
||||||
ChatType.Party,
|
|
||||||
ChatType.CrossParty,
|
|
||||||
ChatType.Alliance,
|
|
||||||
ChatType.FreeCompany,
|
|
||||||
ChatType.PvpTeam,
|
|
||||||
ChatType.CrossLinkshell1,
|
|
||||||
ChatType.CrossLinkshell2,
|
|
||||||
ChatType.CrossLinkshell3,
|
|
||||||
ChatType.CrossLinkshell4,
|
|
||||||
ChatType.CrossLinkshell5,
|
|
||||||
ChatType.CrossLinkshell6,
|
|
||||||
ChatType.CrossLinkshell7,
|
|
||||||
ChatType.CrossLinkshell8,
|
|
||||||
ChatType.Linkshell1,
|
|
||||||
ChatType.Linkshell2,
|
|
||||||
ChatType.Linkshell3,
|
|
||||||
ChatType.Linkshell4,
|
|
||||||
ChatType.Linkshell5,
|
|
||||||
ChatType.Linkshell6,
|
|
||||||
ChatType.Linkshell7,
|
|
||||||
ChatType.Linkshell8,
|
|
||||||
ChatType.NoviceNetwork,
|
|
||||||
ChatType.StandardEmote,
|
|
||||||
ChatType.CustomEmote
|
|
||||||
]),
|
|
||||||
|
|
||||||
(Language.Options_Tabs_ChannelTypes_Battle,
|
|
||||||
[
|
|
||||||
ChatType.Damage,
|
|
||||||
ChatType.Miss,
|
|
||||||
ChatType.Action,
|
|
||||||
ChatType.Item,
|
|
||||||
ChatType.Healing,
|
|
||||||
ChatType.GainBuff,
|
|
||||||
ChatType.LoseBuff,
|
|
||||||
ChatType.GainDebuff,
|
|
||||||
ChatType.LoseDebuff
|
|
||||||
]),
|
|
||||||
|
|
||||||
(Language.Options_Tabs_ChannelTypes_Announcements,
|
|
||||||
[
|
|
||||||
ChatType.System,
|
|
||||||
ChatType.BattleSystem,
|
|
||||||
ChatType.GatheringSystem,
|
|
||||||
ChatType.Error,
|
|
||||||
ChatType.Echo,
|
|
||||||
ChatType.NoviceNetworkSystem,
|
|
||||||
ChatType.FreeCompanyAnnouncement,
|
|
||||||
ChatType.PvpTeamAnnouncement,
|
|
||||||
ChatType.FreeCompanyLoginLogout,
|
|
||||||
ChatType.PvpTeamLoginLogout,
|
|
||||||
ChatType.RetainerSale,
|
|
||||||
ChatType.NpcDialogue,
|
|
||||||
ChatType.NpcAnnouncement,
|
|
||||||
ChatType.LootNotice,
|
|
||||||
ChatType.Progress,
|
|
||||||
ChatType.LootRoll,
|
|
||||||
ChatType.Crafting,
|
|
||||||
ChatType.Gathering,
|
|
||||||
ChatType.PeriodicRecruitmentNotification,
|
|
||||||
ChatType.Sign,
|
|
||||||
ChatType.RandomNumber,
|
|
||||||
ChatType.Orchestrion,
|
|
||||||
ChatType.MessageBook,
|
|
||||||
ChatType.Alarm,
|
|
||||||
ChatType.GlamourNotifications
|
|
||||||
])
|
|
||||||
// Note: ExtraChat linkshells are handled separately in the tab settings
|
|
||||||
// UI.
|
|
||||||
];
|
|
||||||
|
|
||||||
internal static string Name(this ChatType type)
|
|
||||||
{
|
|
||||||
return type switch
|
|
||||||
{
|
|
||||||
ChatType.Debug => Language.ChatType_Debug,
|
|
||||||
ChatType.Urgent => Language.ChatType_Urgent,
|
|
||||||
ChatType.Notice => Language.ChatType_Notice,
|
|
||||||
ChatType.Say => Language.ChatType_Say,
|
|
||||||
ChatType.Shout => Language.ChatType_Shout,
|
|
||||||
ChatType.TellOutgoing => Language.ChatType_TellOutgoing,
|
|
||||||
ChatType.TellIncoming => Language.ChatType_TellIncoming,
|
|
||||||
ChatType.Party => Language.ChatType_Party,
|
|
||||||
ChatType.Alliance => Language.ChatType_Alliance,
|
|
||||||
ChatType.Linkshell1 => Language.ChatType_Linkshell1,
|
|
||||||
ChatType.Linkshell2 => Language.ChatType_Linkshell2,
|
|
||||||
ChatType.Linkshell3 => Language.ChatType_Linkshell3,
|
|
||||||
ChatType.Linkshell4 => Language.ChatType_Linkshell4,
|
|
||||||
ChatType.Linkshell5 => Language.ChatType_Linkshell5,
|
|
||||||
ChatType.Linkshell6 => Language.ChatType_Linkshell6,
|
|
||||||
ChatType.Linkshell7 => Language.ChatType_Linkshell7,
|
|
||||||
ChatType.Linkshell8 => Language.ChatType_Linkshell8,
|
|
||||||
ChatType.FreeCompany => Language.ChatType_FreeCompany,
|
|
||||||
ChatType.NoviceNetwork => Language.ChatType_NoviceNetwork,
|
|
||||||
ChatType.CustomEmote => Language.ChatType_CustomEmotes,
|
|
||||||
ChatType.StandardEmote => Language.ChatType_StandardEmotes,
|
|
||||||
ChatType.Yell => Language.ChatType_Yell,
|
|
||||||
ChatType.CrossParty => Language.ChatType_CrossWorldParty,
|
|
||||||
ChatType.PvpTeam => Language.ChatType_PvpTeam,
|
|
||||||
ChatType.CrossLinkshell1 => Language.ChatType_CrossLinkshell1,
|
|
||||||
ChatType.Damage => Language.ChatType_Damage,
|
|
||||||
ChatType.Miss => Language.ChatType_Miss,
|
|
||||||
ChatType.Action => Language.ChatType_Action,
|
|
||||||
ChatType.Item => Language.ChatType_Item,
|
|
||||||
ChatType.Healing => Language.ChatType_Healing,
|
|
||||||
ChatType.GainBuff => Language.ChatType_GainBuff,
|
|
||||||
ChatType.GainDebuff => Language.ChatType_GainDebuff,
|
|
||||||
ChatType.LoseBuff => Language.ChatType_LoseBuff,
|
|
||||||
ChatType.LoseDebuff => Language.ChatType_LoseDebuff,
|
|
||||||
ChatType.Alarm => Language.ChatType_Alarm,
|
|
||||||
ChatType.GlamourNotifications => Language.ChatType_Glamour,
|
|
||||||
ChatType.Echo => Language.ChatType_Echo,
|
|
||||||
ChatType.System => Language.ChatType_System,
|
|
||||||
ChatType.BattleSystem => Language.ChatType_BattleSystem,
|
|
||||||
ChatType.GatheringSystem => Language.ChatType_GatheringSystem,
|
|
||||||
ChatType.Error => Language.ChatType_Error,
|
|
||||||
ChatType.NpcDialogue => Language.ChatType_NpcDialogue,
|
|
||||||
ChatType.LootNotice => Language.ChatType_LootNotice,
|
|
||||||
ChatType.Progress => Language.ChatType_Progress,
|
|
||||||
ChatType.LootRoll => Language.ChatType_LootRoll,
|
|
||||||
ChatType.Crafting => Language.ChatType_Crafting,
|
|
||||||
ChatType.Gathering => Language.ChatType_Gathering,
|
|
||||||
ChatType.NpcAnnouncement => Language.ChatType_NpcAnnouncement,
|
|
||||||
ChatType.FreeCompanyAnnouncement => Language.ChatType_FreeCompanyAnnouncement,
|
|
||||||
ChatType.FreeCompanyLoginLogout => Language.ChatType_FreeCompanyLoginLogout,
|
|
||||||
ChatType.RetainerSale => Language.ChatType_RetainerSale,
|
|
||||||
ChatType.PeriodicRecruitmentNotification => Language.ChatType_PeriodicRecruitmentNotification,
|
|
||||||
ChatType.Sign => Language.ChatType_Sign,
|
|
||||||
ChatType.RandomNumber => Language.ChatType_RandomNumber,
|
|
||||||
ChatType.NoviceNetworkSystem => Language.ChatType_NoviceNetworkSystem,
|
|
||||||
ChatType.Orchestrion => Language.ChatType_Orchestrion,
|
|
||||||
ChatType.PvpTeamAnnouncement => Language.ChatType_PvpTeamAnnouncement,
|
|
||||||
ChatType.PvpTeamLoginLogout => Language.ChatType_PvpTeamLoginLogout,
|
|
||||||
ChatType.MessageBook => Language.ChatType_MessageBook,
|
|
||||||
ChatType.GmTell => Language.ChatType_GmTell,
|
|
||||||
ChatType.GmSay => Language.ChatType_GmSay,
|
|
||||||
ChatType.GmShout => Language.ChatType_GmShout,
|
|
||||||
ChatType.GmYell => Language.ChatType_GmYell,
|
|
||||||
ChatType.GmParty => Language.ChatType_GmParty,
|
|
||||||
ChatType.GmFreeCompany => Language.ChatType_GmFreeCompany,
|
|
||||||
ChatType.GmLinkshell1 => Language.ChatType_GmLinkshell1,
|
|
||||||
ChatType.GmLinkshell2 => Language.ChatType_GmLinkshell2,
|
|
||||||
ChatType.GmLinkshell3 => Language.ChatType_GmLinkshell3,
|
|
||||||
ChatType.GmLinkshell4 => Language.ChatType_GmLinkshell4,
|
|
||||||
ChatType.GmLinkshell5 => Language.ChatType_GmLinkshell5,
|
|
||||||
ChatType.GmLinkshell6 => Language.ChatType_GmLinkshell6,
|
|
||||||
ChatType.GmLinkshell7 => Language.ChatType_GmLinkshell7,
|
|
||||||
ChatType.GmLinkshell8 => Language.ChatType_GmLinkshell8,
|
|
||||||
ChatType.GmNoviceNetwork => Language.ChatType_GmNoviceNetwork,
|
|
||||||
ChatType.CrossLinkshell2 => Language.ChatType_CrossLinkshell2,
|
|
||||||
ChatType.CrossLinkshell3 => Language.ChatType_CrossLinkshell3,
|
|
||||||
ChatType.CrossLinkshell4 => Language.ChatType_CrossLinkshell4,
|
|
||||||
ChatType.CrossLinkshell5 => Language.ChatType_CrossLinkshell5,
|
|
||||||
ChatType.CrossLinkshell6 => Language.ChatType_CrossLinkshell6,
|
|
||||||
ChatType.CrossLinkshell7 => Language.ChatType_CrossLinkshell7,
|
|
||||||
ChatType.CrossLinkshell8 => Language.ChatType_CrossLinkshell8,
|
|
||||||
ChatType.ExtraChatLinkshell1 => Language.ChatType_ExtraChatLinkshell1,
|
|
||||||
ChatType.ExtraChatLinkshell2 => Language.ChatType_ExtraChatLinkshell2,
|
|
||||||
ChatType.ExtraChatLinkshell3 => Language.ChatType_ExtraChatLinkshell3,
|
|
||||||
ChatType.ExtraChatLinkshell4 => Language.ChatType_ExtraChatLinkshell4,
|
|
||||||
ChatType.ExtraChatLinkshell5 => Language.ChatType_ExtraChatLinkshell5,
|
|
||||||
ChatType.ExtraChatLinkshell6 => Language.ChatType_ExtraChatLinkshell6,
|
|
||||||
ChatType.ExtraChatLinkshell7 => Language.ChatType_ExtraChatLinkshell7,
|
|
||||||
ChatType.ExtraChatLinkshell8 => Language.ChatType_ExtraChatLinkshell8,
|
|
||||||
_ => type.ToString(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static uint? DefaultColor(this ChatType type)
|
|
||||||
{
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case ChatType.Debug:
|
|
||||||
return ColourUtil.ComponentsToRgba(204, 204, 204);
|
|
||||||
case ChatType.Urgent:
|
|
||||||
return ColourUtil.ComponentsToRgba(255, 127, 127);
|
|
||||||
case ChatType.Notice:
|
|
||||||
return ColourUtil.ComponentsToRgba(179, 140, 255);
|
|
||||||
|
|
||||||
case ChatType.Say:
|
|
||||||
case ChatType.GmSay:
|
|
||||||
return ColourUtil.ComponentsToRgba(247, 247, 247);
|
|
||||||
case ChatType.Shout:
|
|
||||||
case ChatType.GmShout:
|
|
||||||
return ColourUtil.ComponentsToRgba(255, 166, 102);
|
|
||||||
case ChatType.TellIncoming:
|
|
||||||
case ChatType.TellOutgoing:
|
|
||||||
case ChatType.GmTell:
|
|
||||||
return ColourUtil.ComponentsToRgba(255, 184, 222);
|
|
||||||
case ChatType.Party:
|
|
||||||
case ChatType.CrossParty:
|
|
||||||
case ChatType.GmParty:
|
|
||||||
return ColourUtil.ComponentsToRgba(102, 229, 255);
|
|
||||||
case ChatType.Alliance:
|
|
||||||
return ColourUtil.ComponentsToRgba(255, 127, 0);
|
|
||||||
case ChatType.NoviceNetwork:
|
|
||||||
case ChatType.NoviceNetworkSystem:
|
|
||||||
case ChatType.GmNoviceNetwork:
|
|
||||||
return ColourUtil.ComponentsToRgba(212, 255, 125);
|
|
||||||
case ChatType.Linkshell1:
|
|
||||||
case ChatType.Linkshell2:
|
|
||||||
case ChatType.Linkshell3:
|
|
||||||
case ChatType.Linkshell4:
|
|
||||||
case ChatType.Linkshell5:
|
|
||||||
case ChatType.Linkshell6:
|
|
||||||
case ChatType.Linkshell7:
|
|
||||||
case ChatType.Linkshell8:
|
|
||||||
case ChatType.CrossLinkshell1:
|
|
||||||
case ChatType.CrossLinkshell2:
|
|
||||||
case ChatType.CrossLinkshell3:
|
|
||||||
case ChatType.CrossLinkshell4:
|
|
||||||
case ChatType.CrossLinkshell5:
|
|
||||||
case ChatType.CrossLinkshell6:
|
|
||||||
case ChatType.CrossLinkshell7:
|
|
||||||
case ChatType.CrossLinkshell8:
|
|
||||||
case ChatType.GmLinkshell1:
|
|
||||||
case ChatType.GmLinkshell2:
|
|
||||||
case ChatType.GmLinkshell3:
|
|
||||||
case ChatType.GmLinkshell4:
|
|
||||||
case ChatType.GmLinkshell5:
|
|
||||||
case ChatType.GmLinkshell6:
|
|
||||||
case ChatType.GmLinkshell7:
|
|
||||||
case ChatType.GmLinkshell8:
|
|
||||||
return ColourUtil.ComponentsToRgba(212, 255, 125);
|
|
||||||
case ChatType.StandardEmote:
|
|
||||||
return ColourUtil.ComponentsToRgba(186, 255, 240);
|
|
||||||
case ChatType.CustomEmote:
|
|
||||||
return ColourUtil.ComponentsToRgba(186, 255, 240);
|
|
||||||
case ChatType.Yell:
|
|
||||||
case ChatType.GmYell:
|
|
||||||
return ColourUtil.ComponentsToRgba(255, 255, 0);
|
|
||||||
case ChatType.Echo:
|
|
||||||
return ColourUtil.ComponentsToRgba(204, 204, 204);
|
|
||||||
case ChatType.System:
|
|
||||||
case ChatType.GatheringSystem:
|
|
||||||
case ChatType.PeriodicRecruitmentNotification:
|
|
||||||
case ChatType.Orchestrion:
|
|
||||||
case ChatType.Alarm:
|
|
||||||
case ChatType.GlamourNotifications:
|
|
||||||
case ChatType.RetainerSale:
|
|
||||||
case ChatType.Sign:
|
|
||||||
case ChatType.MessageBook:
|
|
||||||
return ColourUtil.ComponentsToRgba(204, 204, 204);
|
|
||||||
case ChatType.NpcAnnouncement:
|
|
||||||
case ChatType.NpcDialogue:
|
|
||||||
return ColourUtil.ComponentsToRgba(171, 214, 71);
|
|
||||||
case ChatType.Error:
|
|
||||||
return ColourUtil.ComponentsToRgba(255, 74, 74);
|
|
||||||
case ChatType.FreeCompany:
|
|
||||||
case ChatType.FreeCompanyAnnouncement:
|
|
||||||
case ChatType.FreeCompanyLoginLogout:
|
|
||||||
case ChatType.GmFreeCompany:
|
|
||||||
return ColourUtil.ComponentsToRgba(171, 219, 229);
|
|
||||||
case ChatType.PvpTeam:
|
|
||||||
return ColourUtil.ComponentsToRgba(171, 219, 229);
|
|
||||||
case ChatType.PvpTeamAnnouncement:
|
|
||||||
case ChatType.PvpTeamLoginLogout:
|
|
||||||
return ColourUtil.ComponentsToRgba(171, 219, 229);
|
|
||||||
case ChatType.Action:
|
|
||||||
case ChatType.Item:
|
|
||||||
case ChatType.LootNotice:
|
|
||||||
return ColourUtil.ComponentsToRgba(255, 255, 176);
|
|
||||||
case ChatType.Progress:
|
|
||||||
return ColourUtil.ComponentsToRgba(255, 222, 115);
|
|
||||||
case ChatType.LootRoll:
|
|
||||||
case ChatType.RandomNumber:
|
|
||||||
return ColourUtil.ComponentsToRgba(199, 191, 158);
|
|
||||||
case ChatType.Crafting:
|
|
||||||
case ChatType.Gathering:
|
|
||||||
return ColourUtil.ComponentsToRgba(222, 191, 247);
|
|
||||||
case ChatType.Damage:
|
|
||||||
return ColourUtil.ComponentsToRgba(255, 125, 125);
|
|
||||||
case ChatType.Miss:
|
|
||||||
return ColourUtil.ComponentsToRgba(204, 204, 204);
|
|
||||||
case ChatType.Healing:
|
|
||||||
return ColourUtil.ComponentsToRgba(212, 255, 125);
|
|
||||||
case ChatType.GainBuff:
|
|
||||||
case ChatType.LoseBuff:
|
|
||||||
return ColourUtil.ComponentsToRgba(148, 191, 255);
|
|
||||||
case ChatType.GainDebuff:
|
|
||||||
case ChatType.LoseDebuff:
|
|
||||||
return ColourUtil.ComponentsToRgba(255, 138, 196);
|
|
||||||
case ChatType.BattleSystem:
|
|
||||||
return ColourUtil.ComponentsToRgba(204, 204, 204);
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static InputChannel? ToInputChannel(this ChatType type) => type switch
|
|
||||||
{
|
|
||||||
ChatType.TellOutgoing => InputChannel.Tell,
|
|
||||||
ChatType.Say => InputChannel.Say,
|
|
||||||
ChatType.Party => InputChannel.Party,
|
|
||||||
ChatType.Alliance => InputChannel.Alliance,
|
|
||||||
ChatType.Yell => InputChannel.Yell,
|
|
||||||
ChatType.Shout => InputChannel.Shout,
|
|
||||||
ChatType.FreeCompany => InputChannel.FreeCompany,
|
|
||||||
ChatType.PvpTeam => InputChannel.PvpTeam,
|
|
||||||
ChatType.NoviceNetwork => InputChannel.NoviceNetwork,
|
|
||||||
ChatType.CrossLinkshell1 => InputChannel.CrossLinkshell1,
|
|
||||||
ChatType.CrossLinkshell2 => InputChannel.CrossLinkshell2,
|
|
||||||
ChatType.CrossLinkshell3 => InputChannel.CrossLinkshell3,
|
|
||||||
ChatType.CrossLinkshell4 => InputChannel.CrossLinkshell4,
|
|
||||||
ChatType.CrossLinkshell5 => InputChannel.CrossLinkshell5,
|
|
||||||
ChatType.CrossLinkshell6 => InputChannel.CrossLinkshell6,
|
|
||||||
ChatType.CrossLinkshell7 => InputChannel.CrossLinkshell7,
|
|
||||||
ChatType.CrossLinkshell8 => InputChannel.CrossLinkshell8,
|
|
||||||
ChatType.Linkshell1 => InputChannel.Linkshell1,
|
|
||||||
ChatType.Linkshell2 => InputChannel.Linkshell2,
|
|
||||||
ChatType.Linkshell3 => InputChannel.Linkshell3,
|
|
||||||
ChatType.Linkshell4 => InputChannel.Linkshell4,
|
|
||||||
ChatType.Linkshell5 => InputChannel.Linkshell5,
|
|
||||||
ChatType.Linkshell6 => InputChannel.Linkshell6,
|
|
||||||
ChatType.Linkshell7 => InputChannel.Linkshell7,
|
|
||||||
ChatType.Linkshell8 => InputChannel.Linkshell8,
|
|
||||||
_ => null,
|
|
||||||
};
|
|
||||||
|
|
||||||
internal static bool IsGm(this ChatType type) => type switch
|
|
||||||
{
|
|
||||||
ChatType.GmTell => true,
|
|
||||||
ChatType.GmSay => true,
|
|
||||||
ChatType.GmShout => true,
|
|
||||||
ChatType.GmYell => true,
|
|
||||||
ChatType.GmParty => true,
|
|
||||||
ChatType.GmFreeCompany => true,
|
|
||||||
ChatType.GmLinkshell1 => true,
|
|
||||||
ChatType.GmLinkshell2 => true,
|
|
||||||
ChatType.GmLinkshell3 => true,
|
|
||||||
ChatType.GmLinkshell4 => true,
|
|
||||||
ChatType.GmLinkshell5 => true,
|
|
||||||
ChatType.GmLinkshell6 => true,
|
|
||||||
ChatType.GmLinkshell7 => true,
|
|
||||||
ChatType.GmLinkshell8 => true,
|
|
||||||
ChatType.GmNoviceNetwork => true,
|
|
||||||
_ => false,
|
|
||||||
};
|
|
||||||
|
|
||||||
internal static bool IsExtraChatLinkshell(this ChatType type) => type switch
|
|
||||||
{
|
|
||||||
ChatType.ExtraChatLinkshell1 => true,
|
|
||||||
ChatType.ExtraChatLinkshell2 => true,
|
|
||||||
ChatType.ExtraChatLinkshell3 => true,
|
|
||||||
ChatType.ExtraChatLinkshell4 => true,
|
|
||||||
ChatType.ExtraChatLinkshell5 => true,
|
|
||||||
ChatType.ExtraChatLinkshell6 => true,
|
|
||||||
ChatType.ExtraChatLinkshell7 => true,
|
|
||||||
ChatType.ExtraChatLinkshell8 => true,
|
|
||||||
_ => false,
|
|
||||||
};
|
|
||||||
|
|
||||||
public static UiConfigOption ToConfigEntry(this ChatType type) => type switch
|
|
||||||
{
|
|
||||||
ChatType.Say => UiConfigOption.ColorSay,
|
|
||||||
ChatType.Shout => UiConfigOption.ColorShout,
|
|
||||||
ChatType.TellOutgoing => UiConfigOption.ColorTell,
|
|
||||||
ChatType.Party => UiConfigOption.ColorParty,
|
|
||||||
ChatType.Linkshell1 => UiConfigOption.ColorLS1,
|
|
||||||
ChatType.Linkshell2 => UiConfigOption.ColorLS2,
|
|
||||||
ChatType.Linkshell3 => UiConfigOption.ColorLS3,
|
|
||||||
ChatType.Linkshell4 => UiConfigOption.ColorLS4,
|
|
||||||
ChatType.Linkshell5 => UiConfigOption.ColorLS5,
|
|
||||||
ChatType.Linkshell6 => UiConfigOption.ColorLS6,
|
|
||||||
ChatType.Linkshell7 => UiConfigOption.ColorLS7,
|
|
||||||
ChatType.Linkshell8 => UiConfigOption.ColorLS8,
|
|
||||||
ChatType.FreeCompany => UiConfigOption.ColorFCompany,
|
|
||||||
ChatType.NoviceNetwork => UiConfigOption.ColorBeginner,
|
|
||||||
ChatType.CustomEmote => UiConfigOption.ColorEmoteUser,
|
|
||||||
ChatType.StandardEmote => UiConfigOption.ColorEmote,
|
|
||||||
ChatType.Yell => UiConfigOption.ColorYell,
|
|
||||||
ChatType.GainBuff => UiConfigOption.ColorBuffGive,
|
|
||||||
ChatType.GainDebuff => UiConfigOption.ColorDebuffGive,
|
|
||||||
ChatType.System => UiConfigOption.ColorSysMsg,
|
|
||||||
ChatType.NpcDialogue => UiConfigOption.ColorNpcSay,
|
|
||||||
ChatType.LootRoll => UiConfigOption.ColorLoot,
|
|
||||||
ChatType.FreeCompanyAnnouncement => UiConfigOption.ColorFCAnnounce,
|
|
||||||
ChatType.PvpTeamAnnouncement => UiConfigOption.ColorPvPGroupAnnounce,
|
|
||||||
_ => UiConfigOption.ColorSay,
|
|
||||||
};
|
|
||||||
|
|
||||||
internal static bool HasSource(this ChatType type) => type switch
|
|
||||||
{
|
|
||||||
// Battle
|
|
||||||
ChatType.Damage => true,
|
|
||||||
ChatType.Miss => true,
|
|
||||||
ChatType.Action => true,
|
|
||||||
ChatType.Item => true,
|
|
||||||
ChatType.Healing => true,
|
|
||||||
ChatType.GainBuff => true,
|
|
||||||
ChatType.LoseBuff => true,
|
|
||||||
ChatType.GainDebuff => true,
|
|
||||||
ChatType.LoseDebuff => true,
|
|
||||||
|
|
||||||
// Announcements
|
|
||||||
ChatType.System => true,
|
|
||||||
ChatType.BattleSystem => true,
|
|
||||||
ChatType.Error => true,
|
|
||||||
ChatType.LootNotice => true,
|
|
||||||
ChatType.Progress => true,
|
|
||||||
ChatType.LootRoll => true,
|
|
||||||
ChatType.Crafting => true,
|
|
||||||
ChatType.Gathering => true,
|
|
||||||
ChatType.FreeCompanyLoginLogout => true,
|
|
||||||
ChatType.PvpTeamLoginLogout => true,
|
|
||||||
_ => false,
|
|
||||||
};
|
|
||||||
|
|
||||||
internal static ChatType Parent(this ChatType type) => type switch
|
|
||||||
{
|
|
||||||
ChatType.Say => ChatType.Say,
|
|
||||||
ChatType.GmSay => ChatType.Say,
|
|
||||||
ChatType.Shout => ChatType.Shout,
|
|
||||||
ChatType.GmShout => ChatType.Shout,
|
|
||||||
ChatType.TellOutgoing => ChatType.TellOutgoing,
|
|
||||||
ChatType.TellIncoming => ChatType.TellOutgoing,
|
|
||||||
ChatType.GmTell => ChatType.TellOutgoing,
|
|
||||||
ChatType.Party => ChatType.Party,
|
|
||||||
ChatType.CrossParty => ChatType.Party,
|
|
||||||
ChatType.GmParty => ChatType.Party,
|
|
||||||
ChatType.Linkshell1 => ChatType.Linkshell1,
|
|
||||||
ChatType.GmLinkshell1 => ChatType.Linkshell1,
|
|
||||||
ChatType.Linkshell2 => ChatType.Linkshell2,
|
|
||||||
ChatType.GmLinkshell2 => ChatType.Linkshell2,
|
|
||||||
ChatType.Linkshell3 => ChatType.Linkshell3,
|
|
||||||
ChatType.GmLinkshell3 => ChatType.Linkshell3,
|
|
||||||
ChatType.Linkshell4 => ChatType.Linkshell4,
|
|
||||||
ChatType.GmLinkshell4 => ChatType.Linkshell4,
|
|
||||||
ChatType.Linkshell5 => ChatType.Linkshell5,
|
|
||||||
ChatType.GmLinkshell5 => ChatType.Linkshell5,
|
|
||||||
ChatType.Linkshell6 => ChatType.Linkshell6,
|
|
||||||
ChatType.GmLinkshell6 => ChatType.Linkshell6,
|
|
||||||
ChatType.Linkshell7 => ChatType.Linkshell7,
|
|
||||||
ChatType.GmLinkshell7 => ChatType.Linkshell7,
|
|
||||||
ChatType.Linkshell8 => ChatType.Linkshell8,
|
|
||||||
ChatType.GmLinkshell8 => ChatType.Linkshell8,
|
|
||||||
ChatType.FreeCompany => ChatType.FreeCompany,
|
|
||||||
ChatType.GmFreeCompany => ChatType.FreeCompany,
|
|
||||||
ChatType.NoviceNetwork => ChatType.NoviceNetwork,
|
|
||||||
ChatType.GmNoviceNetwork => ChatType.NoviceNetwork,
|
|
||||||
ChatType.CustomEmote => ChatType.CustomEmote,
|
|
||||||
ChatType.StandardEmote => ChatType.StandardEmote,
|
|
||||||
ChatType.Yell => ChatType.Yell,
|
|
||||||
ChatType.GmYell => ChatType.Yell,
|
|
||||||
ChatType.GainBuff => ChatType.GainBuff,
|
|
||||||
ChatType.LoseBuff => ChatType.GainBuff,
|
|
||||||
ChatType.GainDebuff => ChatType.GainDebuff,
|
|
||||||
ChatType.LoseDebuff => ChatType.GainDebuff,
|
|
||||||
ChatType.System => ChatType.System,
|
|
||||||
ChatType.Alarm => ChatType.System,
|
|
||||||
ChatType.GlamourNotifications => ChatType.System,
|
|
||||||
ChatType.RetainerSale => ChatType.System,
|
|
||||||
ChatType.PeriodicRecruitmentNotification => ChatType.System,
|
|
||||||
ChatType.Sign => ChatType.System,
|
|
||||||
ChatType.Orchestrion => ChatType.System,
|
|
||||||
ChatType.MessageBook => ChatType.System,
|
|
||||||
ChatType.NpcDialogue => ChatType.NpcDialogue,
|
|
||||||
ChatType.NpcAnnouncement => ChatType.NpcDialogue,
|
|
||||||
ChatType.LootRoll => ChatType.LootRoll,
|
|
||||||
ChatType.RandomNumber => ChatType.LootRoll,
|
|
||||||
ChatType.FreeCompanyAnnouncement => ChatType.FreeCompanyAnnouncement,
|
|
||||||
ChatType.FreeCompanyLoginLogout => ChatType.FreeCompanyAnnouncement,
|
|
||||||
ChatType.PvpTeamAnnouncement => ChatType.PvpTeamAnnouncement,
|
|
||||||
ChatType.PvpTeamLoginLogout => ChatType.PvpTeamAnnouncement,
|
|
||||||
_ => type,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,195 +0,0 @@
|
|||||||
using Lumina.Excel.Sheets;
|
|
||||||
|
|
||||||
namespace ChatTwo.Code;
|
|
||||||
|
|
||||||
internal static class InputChannelExt
|
|
||||||
{
|
|
||||||
internal static ChatType ToChatType(this InputChannel input) => input switch
|
|
||||||
{
|
|
||||||
InputChannel.Tell => ChatType.TellOutgoing,
|
|
||||||
InputChannel.Say => ChatType.Say,
|
|
||||||
InputChannel.Party => ChatType.Party,
|
|
||||||
InputChannel.Alliance => ChatType.Alliance,
|
|
||||||
InputChannel.Yell => ChatType.Yell,
|
|
||||||
InputChannel.Shout => ChatType.Shout,
|
|
||||||
InputChannel.FreeCompany => ChatType.FreeCompany,
|
|
||||||
InputChannel.PvpTeam => ChatType.PvpTeam,
|
|
||||||
InputChannel.NoviceNetwork => ChatType.NoviceNetwork,
|
|
||||||
InputChannel.CrossLinkshell1 => ChatType.CrossLinkshell1,
|
|
||||||
InputChannel.CrossLinkshell2 => ChatType.CrossLinkshell2,
|
|
||||||
InputChannel.CrossLinkshell3 => ChatType.CrossLinkshell3,
|
|
||||||
InputChannel.CrossLinkshell4 => ChatType.CrossLinkshell4,
|
|
||||||
InputChannel.CrossLinkshell5 => ChatType.CrossLinkshell5,
|
|
||||||
InputChannel.CrossLinkshell6 => ChatType.CrossLinkshell6,
|
|
||||||
InputChannel.CrossLinkshell7 => ChatType.CrossLinkshell7,
|
|
||||||
InputChannel.CrossLinkshell8 => ChatType.CrossLinkshell8,
|
|
||||||
InputChannel.Linkshell1 => ChatType.Linkshell1,
|
|
||||||
InputChannel.Linkshell2 => ChatType.Linkshell2,
|
|
||||||
InputChannel.Linkshell3 => ChatType.Linkshell3,
|
|
||||||
InputChannel.Linkshell4 => ChatType.Linkshell4,
|
|
||||||
InputChannel.Linkshell5 => ChatType.Linkshell5,
|
|
||||||
InputChannel.Linkshell6 => ChatType.Linkshell6,
|
|
||||||
InputChannel.Linkshell7 => ChatType.Linkshell7,
|
|
||||||
InputChannel.Linkshell8 => ChatType.Linkshell8,
|
|
||||||
InputChannel.ExtraChatLinkshell1 => ChatType.ExtraChatLinkshell1,
|
|
||||||
InputChannel.ExtraChatLinkshell2 => ChatType.ExtraChatLinkshell2,
|
|
||||||
InputChannel.ExtraChatLinkshell3 => ChatType.ExtraChatLinkshell3,
|
|
||||||
InputChannel.ExtraChatLinkshell4 => ChatType.ExtraChatLinkshell4,
|
|
||||||
InputChannel.ExtraChatLinkshell5 => ChatType.ExtraChatLinkshell5,
|
|
||||||
InputChannel.ExtraChatLinkshell6 => ChatType.ExtraChatLinkshell6,
|
|
||||||
InputChannel.ExtraChatLinkshell7 => ChatType.ExtraChatLinkshell7,
|
|
||||||
InputChannel.ExtraChatLinkshell8 => ChatType.ExtraChatLinkshell8,
|
|
||||||
InputChannel.Invalid => ChatType.Echo,
|
|
||||||
_ => throw new ArgumentOutOfRangeException(nameof(input), input, null),
|
|
||||||
};
|
|
||||||
|
|
||||||
public static uint LinkshellIndex(this InputChannel channel) => channel switch
|
|
||||||
{
|
|
||||||
InputChannel.Linkshell1 => 0,
|
|
||||||
InputChannel.Linkshell2 => 1,
|
|
||||||
InputChannel.Linkshell3 => 2,
|
|
||||||
InputChannel.Linkshell4 => 3,
|
|
||||||
InputChannel.Linkshell5 => 4,
|
|
||||||
InputChannel.Linkshell6 => 5,
|
|
||||||
InputChannel.Linkshell7 => 6,
|
|
||||||
InputChannel.Linkshell8 => 7,
|
|
||||||
InputChannel.CrossLinkshell1 => 0,
|
|
||||||
InputChannel.CrossLinkshell2 => 1,
|
|
||||||
InputChannel.CrossLinkshell3 => 2,
|
|
||||||
InputChannel.CrossLinkshell4 => 3,
|
|
||||||
InputChannel.CrossLinkshell5 => 4,
|
|
||||||
InputChannel.CrossLinkshell6 => 5,
|
|
||||||
InputChannel.CrossLinkshell7 => 6,
|
|
||||||
InputChannel.CrossLinkshell8 => 7,
|
|
||||||
InputChannel.ExtraChatLinkshell1 => 0,
|
|
||||||
InputChannel.ExtraChatLinkshell2 => 1,
|
|
||||||
InputChannel.ExtraChatLinkshell3 => 2,
|
|
||||||
InputChannel.ExtraChatLinkshell4 => 3,
|
|
||||||
InputChannel.ExtraChatLinkshell5 => 4,
|
|
||||||
InputChannel.ExtraChatLinkshell6 => 5,
|
|
||||||
InputChannel.ExtraChatLinkshell7 => 6,
|
|
||||||
InputChannel.ExtraChatLinkshell8 => 7,
|
|
||||||
_ => uint.MaxValue,
|
|
||||||
};
|
|
||||||
|
|
||||||
public static string Prefix(this InputChannel channel) => channel switch
|
|
||||||
{
|
|
||||||
InputChannel.Tell => "/t",
|
|
||||||
InputChannel.Say => "/s",
|
|
||||||
InputChannel.Party => "/p",
|
|
||||||
InputChannel.Alliance => "/a",
|
|
||||||
InputChannel.Yell => "/y",
|
|
||||||
InputChannel.Shout => "/sh",
|
|
||||||
InputChannel.FreeCompany => "/fc",
|
|
||||||
InputChannel.PvpTeam => "/pt",
|
|
||||||
InputChannel.NoviceNetwork => "/b",
|
|
||||||
InputChannel.CrossLinkshell1 => "/cwl1",
|
|
||||||
InputChannel.CrossLinkshell2 => "/cwl2",
|
|
||||||
InputChannel.CrossLinkshell3 => "/cwl3",
|
|
||||||
InputChannel.CrossLinkshell4 => "/cwl4",
|
|
||||||
InputChannel.CrossLinkshell5 => "/cwl5",
|
|
||||||
InputChannel.CrossLinkshell6 => "/cwl6",
|
|
||||||
InputChannel.CrossLinkshell7 => "/cwl7",
|
|
||||||
InputChannel.CrossLinkshell8 => "/cwl8",
|
|
||||||
InputChannel.Linkshell1 => "/l1",
|
|
||||||
InputChannel.Linkshell2 => "/l2",
|
|
||||||
InputChannel.Linkshell3 => "/l3",
|
|
||||||
InputChannel.Linkshell4 => "/l4",
|
|
||||||
InputChannel.Linkshell5 => "/l5",
|
|
||||||
InputChannel.Linkshell6 => "/l6",
|
|
||||||
InputChannel.Linkshell7 => "/l7",
|
|
||||||
InputChannel.Linkshell8 => "/l8",
|
|
||||||
InputChannel.ExtraChatLinkshell1 => "/ecl1",
|
|
||||||
InputChannel.ExtraChatLinkshell2 => "/ecl2",
|
|
||||||
InputChannel.ExtraChatLinkshell3 => "/ecl3",
|
|
||||||
InputChannel.ExtraChatLinkshell4 => "/ecl4",
|
|
||||||
InputChannel.ExtraChatLinkshell5 => "/ecl5",
|
|
||||||
InputChannel.ExtraChatLinkshell6 => "/ecl6",
|
|
||||||
InputChannel.ExtraChatLinkshell7 => "/ecl7",
|
|
||||||
InputChannel.ExtraChatLinkshell8 => "/ecl8",
|
|
||||||
_ => "/e",
|
|
||||||
};
|
|
||||||
|
|
||||||
public static IEnumerable<TextCommand>? TextCommands(this InputChannel channel)
|
|
||||||
{
|
|
||||||
uint[] ids = channel switch
|
|
||||||
{
|
|
||||||
InputChannel.Tell => [104, 118],
|
|
||||||
InputChannel.Say => [102],
|
|
||||||
InputChannel.Party => [105],
|
|
||||||
InputChannel.Alliance => [119],
|
|
||||||
InputChannel.Yell => [117],
|
|
||||||
InputChannel.Shout => [103],
|
|
||||||
InputChannel.FreeCompany => [115],
|
|
||||||
InputChannel.PvpTeam => [91],
|
|
||||||
InputChannel.NoviceNetwork => [101],
|
|
||||||
InputChannel.CrossLinkshell1 => [13],
|
|
||||||
InputChannel.CrossLinkshell2 => [14],
|
|
||||||
InputChannel.CrossLinkshell3 => [15],
|
|
||||||
InputChannel.CrossLinkshell4 => [16],
|
|
||||||
InputChannel.CrossLinkshell5 => [17],
|
|
||||||
InputChannel.CrossLinkshell6 => [18],
|
|
||||||
InputChannel.CrossLinkshell7 => [19],
|
|
||||||
InputChannel.CrossLinkshell8 => [20],
|
|
||||||
InputChannel.Linkshell1 => [107],
|
|
||||||
InputChannel.Linkshell2 => [108],
|
|
||||||
InputChannel.Linkshell3 => [109],
|
|
||||||
InputChannel.Linkshell4 => [110],
|
|
||||||
InputChannel.Linkshell5 => [111],
|
|
||||||
InputChannel.Linkshell6 => [112],
|
|
||||||
InputChannel.Linkshell7 => [113],
|
|
||||||
InputChannel.Linkshell8 => [114],
|
|
||||||
_ => [],
|
|
||||||
};
|
|
||||||
|
|
||||||
if (ids.Length == 0)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
return ids.Where(id => Sheets.TextCommandSheet.HasRow(id)).Select(id => Sheets.TextCommandSheet.GetRow(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static bool IsLinkshell(this InputChannel channel) => channel switch
|
|
||||||
{
|
|
||||||
InputChannel.Linkshell1 => true,
|
|
||||||
InputChannel.Linkshell2 => true,
|
|
||||||
InputChannel.Linkshell3 => true,
|
|
||||||
InputChannel.Linkshell4 => true,
|
|
||||||
InputChannel.Linkshell5 => true,
|
|
||||||
InputChannel.Linkshell6 => true,
|
|
||||||
InputChannel.Linkshell7 => true,
|
|
||||||
InputChannel.Linkshell8 => true,
|
|
||||||
_ => false,
|
|
||||||
};
|
|
||||||
|
|
||||||
internal static bool IsCrossLinkshell(this InputChannel channel) => channel switch
|
|
||||||
{
|
|
||||||
InputChannel.CrossLinkshell1 => true,
|
|
||||||
InputChannel.CrossLinkshell2 => true,
|
|
||||||
InputChannel.CrossLinkshell3 => true,
|
|
||||||
InputChannel.CrossLinkshell4 => true,
|
|
||||||
InputChannel.CrossLinkshell5 => true,
|
|
||||||
InputChannel.CrossLinkshell6 => true,
|
|
||||||
InputChannel.CrossLinkshell7 => true,
|
|
||||||
InputChannel.CrossLinkshell8 => true,
|
|
||||||
_ => false,
|
|
||||||
};
|
|
||||||
|
|
||||||
internal static bool IsExtraChatLinkshell(this InputChannel channel) => channel switch
|
|
||||||
{
|
|
||||||
InputChannel.ExtraChatLinkshell1 => true,
|
|
||||||
InputChannel.ExtraChatLinkshell2 => true,
|
|
||||||
InputChannel.ExtraChatLinkshell3 => true,
|
|
||||||
InputChannel.ExtraChatLinkshell4 => true,
|
|
||||||
InputChannel.ExtraChatLinkshell5 => true,
|
|
||||||
InputChannel.ExtraChatLinkshell6 => true,
|
|
||||||
InputChannel.ExtraChatLinkshell7 => true,
|
|
||||||
InputChannel.ExtraChatLinkshell8 => true,
|
|
||||||
_ => false,
|
|
||||||
};
|
|
||||||
|
|
||||||
internal static bool IsValid(this InputChannel channel) => channel switch
|
|
||||||
{
|
|
||||||
InputChannel.Invalid => false,
|
|
||||||
_ => true,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
HellionChat — DalamudPackager override.
|
|
||||||
|
|
||||||
The default DalamudPackager.targets shipped by the SDK does not set
|
|
||||||
HandleImages / ImagesPath, so the images/ directory is silently
|
|
||||||
excluded from the release ZIP. The presence of this file at
|
|
||||||
$(ProjectDir)DalamudPackager.targets disables the SDK's default
|
|
||||||
target (it guards on `!Exists('$(PackagerTargetFile)')`) and lets
|
|
||||||
us call the packager task ourselves with the image fields wired in.
|
|
||||||
|
|
||||||
Apart from HandleImages + ImagesPath the property list mirrors the
|
|
||||||
SDK default verbatim so we don't lose any other manifest field as
|
|
||||||
the upstream SDK evolves.
|
|
||||||
-->
|
|
||||||
<Project>
|
|
||||||
<Target Name="HellionDalamudPackagerDebug"
|
|
||||||
AfterTargets="Build"
|
|
||||||
Condition="'$(Configuration)' == 'Debug'">
|
|
||||||
<DalamudPackager ProjectDir="$(ProjectDir)"
|
|
||||||
OutputPath="$(OutputPath)"
|
|
||||||
AssemblyName="$(AssemblyName)"
|
|
||||||
MakeZip="false"
|
|
||||||
Author="$(Author)"
|
|
||||||
Name="$(Name)"
|
|
||||||
MinimumDalamudVersion="$(MinimumDalamudVersion)"
|
|
||||||
Punchline="$(Punchline)"
|
|
||||||
Description="$(Description)"
|
|
||||||
ApplicableVersion="$(ApplicableVersion)"
|
|
||||||
RepoUrl="$(RepoUrl)"
|
|
||||||
Tags="$(Tags)"
|
|
||||||
CategoryTags="$(CategoryTags)"
|
|
||||||
DalamudApiLevel="$(DalamudApiLevel)"
|
|
||||||
LoadRequiredState="$(LoadRequiredState)"
|
|
||||||
LoadSync="$(LoadSync)"
|
|
||||||
CanUnloadAsync="$(CanUnloadAsync)"
|
|
||||||
LoadPriority="$(LoadPriority)"
|
|
||||||
ImageUrls="$(ImageUrls)"
|
|
||||||
IconUrl="$(IconUrl)"
|
|
||||||
Changelog="$(Changelog)"
|
|
||||||
AcceptsFeedback="$(AcceptsFeedback)"
|
|
||||||
FeedbackMessage="$(FeedbackMessage)"
|
|
||||||
HandleImages="true"
|
|
||||||
ImagesPath="$(ProjectDir)images" />
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
<Target Name="HellionDalamudPackagerRelease"
|
|
||||||
AfterTargets="Build"
|
|
||||||
Condition="'$(Configuration)' == 'Release'">
|
|
||||||
<DalamudPackager ProjectDir="$(ProjectDir)"
|
|
||||||
OutputPath="$(OutputPath)"
|
|
||||||
AssemblyName="$(AssemblyName)"
|
|
||||||
MakeZip="true"
|
|
||||||
Author="$(Author)"
|
|
||||||
Name="$(Name)"
|
|
||||||
MinimumDalamudVersion="$(MinimumDalamudVersion)"
|
|
||||||
Punchline="$(Punchline)"
|
|
||||||
Description="$(Description)"
|
|
||||||
ApplicableVersion="$(ApplicableVersion)"
|
|
||||||
RepoUrl="$(RepoUrl)"
|
|
||||||
Tags="$(Tags)"
|
|
||||||
CategoryTags="$(CategoryTags)"
|
|
||||||
DalamudApiLevel="$(DalamudApiLevel)"
|
|
||||||
LoadRequiredState="$(LoadRequiredState)"
|
|
||||||
LoadSync="$(LoadSync)"
|
|
||||||
CanUnloadAsync="$(CanUnloadAsync)"
|
|
||||||
LoadPriority="$(LoadPriority)"
|
|
||||||
ImageUrls="$(ImageUrls)"
|
|
||||||
IconUrl="$(IconUrl)"
|
|
||||||
Changelog="$(Changelog)"
|
|
||||||
AcceptsFeedback="$(AcceptsFeedback)"
|
|
||||||
FeedbackMessage="$(FeedbackMessage)"
|
|
||||||
HandleImages="true"
|
|
||||||
ImagesPath="$(ProjectDir)images" />
|
|
||||||
</Target>
|
|
||||||
</Project>
|
|
||||||
@@ -1,210 +0,0 @@
|
|||||||
using Dalamud;
|
|
||||||
using Dalamud.Interface;
|
|
||||||
using Dalamud.Interface.FontIdentifier;
|
|
||||||
using Dalamud.Interface.GameFonts;
|
|
||||||
using Dalamud.Interface.ManagedFontAtlas;
|
|
||||||
using Dalamud.Interface.Utility;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
|
|
||||||
namespace ChatTwo;
|
|
||||||
|
|
||||||
public class FontManager
|
|
||||||
{
|
|
||||||
internal IFontHandle Axis = null!;
|
|
||||||
internal IFontHandle AxisItalic = null!;
|
|
||||||
|
|
||||||
internal IFontHandle RegularFont = null!;
|
|
||||||
internal IFontHandle? ItalicFont;
|
|
||||||
|
|
||||||
internal IFontHandle FontAwesome = null!;
|
|
||||||
|
|
||||||
internal readonly byte[] GameSymFont;
|
|
||||||
|
|
||||||
private ushort[] Ranges = [];
|
|
||||||
private ushort[] JpRange = [];
|
|
||||||
|
|
||||||
public static readonly HashSet<float> AxisFontSizeList =
|
|
||||||
[
|
|
||||||
9.6f, 10f, 12f, 14f, 16f,
|
|
||||||
18f, 18.4f, 20f, 23f, 34f,
|
|
||||||
36f, 40f, 45f, 46f, 68f, 90f,
|
|
||||||
];
|
|
||||||
|
|
||||||
public FontManager()
|
|
||||||
{
|
|
||||||
var filePath = Path.Combine(Plugin.Interface.ConfigDirectory.FullName, "FFXIV_Lodestone_SSF.ttf");
|
|
||||||
if (File.Exists(filePath))
|
|
||||||
{
|
|
||||||
GameSymFont = File.ReadAllBytes(filePath);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameSymFont = new HttpClient().GetAsync("https://img.finalfantasyxiv.com/lds/pc/global/fonts/FFXIV_Lodestone_SSF.ttf")
|
|
||||||
.Result
|
|
||||||
.Content
|
|
||||||
.ReadAsByteArrayAsync()
|
|
||||||
.Result;
|
|
||||||
|
|
||||||
Dalamud.Utility.FilesystemUtil.WriteAllBytesSafe(filePath, GameSymFont);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Backing bytes for the bundled Hellion font (Exo 2, OFL-1.1). Lazily
|
|
||||||
/// extracted from the assembly's manifest resources on first use; the
|
|
||||||
/// load happens inside the font atlas build callback so we keep the
|
|
||||||
/// allocation off the plugin constructor's hot path.
|
|
||||||
/// </summary>
|
|
||||||
private static byte[]? HellionFontBytes;
|
|
||||||
|
|
||||||
private static byte[] GetHellionFontBytes()
|
|
||||||
{
|
|
||||||
if (HellionFontBytes is not null)
|
|
||||||
return HellionFontBytes;
|
|
||||||
|
|
||||||
using var stream = typeof(FontManager).Assembly.GetManifestResourceStream("HellionFont.ttf")
|
|
||||||
?? throw new FileNotFoundException("Hellion font resource not embedded in the assembly");
|
|
||||||
using var ms = new MemoryStream();
|
|
||||||
stream.CopyTo(ms);
|
|
||||||
HellionFontBytes = ms.ToArray();
|
|
||||||
return HellionFontBytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
private unsafe void SetUpRanges()
|
|
||||||
{
|
|
||||||
ushort[] BuildRange(IReadOnlyList<ushort>? chars, params nint[] ranges)
|
|
||||||
{
|
|
||||||
var builder = new ImFontGlyphRangesBuilderPtr(ImGuiNative.ImFontGlyphRangesBuilder());
|
|
||||||
// text
|
|
||||||
foreach (var range in ranges)
|
|
||||||
builder.AddRanges((ushort*)range);
|
|
||||||
|
|
||||||
// chars
|
|
||||||
if (chars != null)
|
|
||||||
{
|
|
||||||
for (var i = 0; i < chars.Count; i += 2)
|
|
||||||
{
|
|
||||||
if (chars[i] == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
for (var j = (uint) chars[i]; j <= chars[i + 1]; j++)
|
|
||||||
builder.AddChar((ushort) j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ingame supported ranges
|
|
||||||
var reader = new FdtReader(Plugin.DataManager.GetFile("common/font/axis_12.fdt")!.Data);
|
|
||||||
foreach (var c in reader.Glyphs)
|
|
||||||
builder.AddChar(c.Char);
|
|
||||||
|
|
||||||
// various symbols
|
|
||||||
// French
|
|
||||||
// Romanian
|
|
||||||
// builder.AddText("←→↑↓《》■※☀★★☆♥♡ヅツッシ☀☁☂℃℉°♀♂♠♣♦♣♧®©™€$£♯♭♪✓√◎◆◇♦■□〇●△▽▼▲‹›≤≥<«“”─\~");
|
|
||||||
builder.AddText("Œœ");
|
|
||||||
builder.AddText("ĂăÂâÎîȘșȚț");
|
|
||||||
|
|
||||||
// "Enclosed Alphanumerics" (partial) https://www.compart.com/en/unicode/block/U+2460
|
|
||||||
for (var i = 0x2460; i <= 0x24B5; i++)
|
|
||||||
builder.AddChar((char) i);
|
|
||||||
|
|
||||||
builder.AddChar('⓪');
|
|
||||||
return builder.BuildRangesToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
var ranges = new List<nint> { (nint)ImGui.GetIO().Fonts.GetGlyphRangesDefault() };
|
|
||||||
foreach (var extraRange in Enum.GetValues<ExtraGlyphRanges>())
|
|
||||||
if (Plugin.Config.ExtraGlyphRanges.HasFlag(extraRange))
|
|
||||||
ranges.Add(extraRange.Range());
|
|
||||||
|
|
||||||
Ranges = BuildRange(null, ranges.ToArray());
|
|
||||||
JpRange = BuildRange(GlyphRangesJapanese.GlyphRanges);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void BuildFonts()
|
|
||||||
{
|
|
||||||
SetUpRanges();
|
|
||||||
|
|
||||||
Axis = Plugin.Interface.UiBuilder.FontAtlas.NewGameFontHandle(new GameFontStyle(GameFontFamily.Axis, SizeInPx(Plugin.Config.FontSizeV2)));
|
|
||||||
AxisItalic = Plugin.Interface.UiBuilder.FontAtlas.NewGameFontHandle(new GameFontStyle(GameFontFamily.Axis, SizeInPx(Plugin.Config.FontSizeV2))
|
|
||||||
{
|
|
||||||
SkewStrength = SizeInPx(Plugin.Config.FontSizeV2) / 6
|
|
||||||
});
|
|
||||||
|
|
||||||
FontAwesome = Plugin.Interface.UiBuilder.FontAtlas.NewDelegateFontHandle(e =>
|
|
||||||
{
|
|
||||||
e.OnPreBuild(tk => tk.AddFontAwesomeIconFont(new SafeFontConfig { SizePx = GetFontSize() }));
|
|
||||||
e.OnPostBuild(tk => tk.FitRatio(tk.Font));
|
|
||||||
});
|
|
||||||
|
|
||||||
RegularFont = Plugin.Interface.UiBuilder.FontAtlas.NewDelegateFontHandle(
|
|
||||||
e => e.OnPreBuild(
|
|
||||||
tk =>
|
|
||||||
{
|
|
||||||
var config = new SafeFontConfig {SizePt = Plugin.Config.GlobalFontV2.SizePt, GlyphRanges = Ranges};
|
|
||||||
config.MergeFont = Plugin.Config.UseHellionFont
|
|
||||||
? tk.AddFontFromMemory(GetHellionFontBytes(), config, "Hellion-Exo2")
|
|
||||||
: AddFontWithFallback(tk, Plugin.Config.GlobalFontV2.FontId, config, "global");
|
|
||||||
|
|
||||||
config.SizePt = Plugin.Config.JapaneseFontV2.SizePt;
|
|
||||||
config.GlyphRanges = JpRange;
|
|
||||||
AddFontWithFallback(tk, Plugin.Config.JapaneseFontV2.FontId, config, "japanese");
|
|
||||||
|
|
||||||
config.SizePt = Plugin.Config.SymbolsFontSizeV2;
|
|
||||||
tk.AddGameSymbol(config);
|
|
||||||
|
|
||||||
tk.Font = config.MergeFont;
|
|
||||||
}
|
|
||||||
));
|
|
||||||
|
|
||||||
if (Plugin.Config.ItalicEnabled)
|
|
||||||
{
|
|
||||||
ItalicFont = Plugin.Interface.UiBuilder.FontAtlas.NewDelegateFontHandle(
|
|
||||||
e => e.OnPreBuild(
|
|
||||||
tk =>
|
|
||||||
{
|
|
||||||
var config = new SafeFontConfig {SizePt = Plugin.Config.ItalicFontV2.SizePt, GlyphRanges = Ranges};
|
|
||||||
config.MergeFont = AddFontWithFallback(tk, Plugin.Config.ItalicFontV2.FontId, config, "italic");
|
|
||||||
|
|
||||||
config.SizePt = Plugin.Config.JapaneseFontV2.SizePt;
|
|
||||||
config.GlyphRanges = JpRange;
|
|
||||||
AddFontWithFallback(tk, Plugin.Config.JapaneseFontV2.FontId, config, "japanese");
|
|
||||||
|
|
||||||
config.SizePt = Plugin.Config.SymbolsFontSizeV2;
|
|
||||||
tk.AddGameSymbol(config);
|
|
||||||
|
|
||||||
tk.Font = config.MergeFont;
|
|
||||||
}
|
|
||||||
));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ItalicFont = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Try to add a user-configured font to the build toolkit, falling back to
|
|
||||||
/// the bundled NotoSansCjkRegular asset if the configured font isn't
|
|
||||||
/// available on the system. Without this guard a stale SystemFontId
|
|
||||||
/// pointing at a font the user uninstalled or that never existed on
|
|
||||||
/// Linux (e.g. "Crimson Text") tears down the entire font atlas build.
|
|
||||||
/// </summary>
|
|
||||||
private static ImFontPtr AddFontWithFallback(IFontAtlasBuildToolkitPreBuild tk, IFontId fontId, SafeFontConfig config, string slot)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return fontId.AddToBuildToolkit(tk, config);
|
|
||||||
}
|
|
||||||
catch (Exception e) when (e is FileNotFoundException or DirectoryNotFoundException or IOException)
|
|
||||||
{
|
|
||||||
Plugin.Log.Warning(e, $"Configured {slot} font unavailable, falling back to NotoSansCjkRegular");
|
|
||||||
var fallback = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkRegular);
|
|
||||||
return fallback.AddToBuildToolkit(tk, config);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static float SizeInPt(float px) => (float) (px * 3.0 / 4.0);
|
|
||||||
public static float SizeInPx(float pt) => (float) (pt * 4.0 / 3.0);
|
|
||||||
public static float GetFontSize() => Plugin.Config.FontsEnabled ? Plugin.Config.GlobalFontV2.SizePx : SizeInPx(Plugin.Config.FontSizeV2);
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
using Dalamud.Game.ClientState.Objects.SubKinds;
|
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
|
||||||
|
|
||||||
namespace ChatTwo.GameFunctions.Types;
|
|
||||||
|
|
||||||
[Serializable]
|
|
||||||
public class TellTarget
|
|
||||||
{
|
|
||||||
public string Name { get; set; }
|
|
||||||
public uint World { get; set; }
|
|
||||||
public ulong ContentId { get; private set; }
|
|
||||||
public TellReason Reason { get; private set; }
|
|
||||||
|
|
||||||
public TellTarget(string name, uint world, ulong contentId, TellReason reason)
|
|
||||||
{
|
|
||||||
Name = name;
|
|
||||||
World = world;
|
|
||||||
ContentId = contentId;
|
|
||||||
Reason = reason;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsSet()
|
|
||||||
=> Name.Length > 0 && World > 0;
|
|
||||||
|
|
||||||
public string ToWorldString()
|
|
||||||
=> Sheets.WorldSheet.TryGetRow(World, out var worldRow) ? worldRow.Name.ToString() : string.Empty;
|
|
||||||
|
|
||||||
public string ToTargetString()
|
|
||||||
=> $"{Name}@{ToWorldString()}";
|
|
||||||
|
|
||||||
public unsafe void FromTarget(IPlayerCharacter target)
|
|
||||||
{
|
|
||||||
Name = target.Name.TextValue;
|
|
||||||
World = target.HomeWorld.RowId;
|
|
||||||
ContentId = ((Character*)target.Address)->ContentId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static TellTarget Empty() => new(string.Empty, 0, 0, TellReason.Direct);
|
|
||||||
public static TellTarget From(TellTarget t) => new(t.Name, t.World, t.ContentId, t.Reason);
|
|
||||||
}
|
|
||||||
@@ -1,317 +0,0 @@
|
|||||||
name: Hellion Chat
|
|
||||||
author: JonKazama-Hellion
|
|
||||||
punchline: Chat 2 with privacy controls aligned to EU, US and JP rules
|
|
||||||
description: |-
|
|
||||||
Hellion Chat is built on top of Chat 2 with one removal and a stack
|
|
||||||
of privacy controls on top. Tabs, channel filters, RGB colours,
|
|
||||||
emotes, screenshot mode, IPC integration and the chat replacement
|
|
||||||
window itself work the same. The optional webinterface that Chat 2
|
|
||||||
ships is intentionally not part of this fork because it serves a
|
|
||||||
different use case from the smaller default footprint Hellion Chat
|
|
||||||
is built around.
|
|
||||||
|
|
||||||
On top of that, Hellion Chat adds privacy and data-handling controls
|
|
||||||
designed to align with the modern data protection rules that apply
|
|
||||||
across the EU, the United States and Japan. By default only your own
|
|
||||||
conversations are stored; messages from strangers, NPCs and system
|
|
||||||
spam stay out of the database. Retention windows are configurable per
|
|
||||||
channel, history can be wiped retroactively, and stored data can be
|
|
||||||
exported on demand.
|
|
||||||
|
|
||||||
Key additions on top of Chat 2:
|
|
||||||
|
|
||||||
- Channel whitelist with a Privacy-First default
|
|
||||||
- Per-channel retention with a daily background sweep
|
|
||||||
- Retroactive cleanup with a Ctrl+Shift confirm
|
|
||||||
- Export to Markdown, JSON or CSV
|
|
||||||
- First-run wizard with three preset profiles (Privacy-First, Casual,
|
|
||||||
Full History)
|
|
||||||
- Bilingual UI (English and German) with live language switching
|
|
||||||
- Independent plugin state — own config file and database directory,
|
|
||||||
so Hellion Chat does not share state with the upstream plugin
|
|
||||||
|
|
||||||
Based on Chat 2 by Infi and Anna, licensed under EUPL-1.2.
|
|
||||||
repo_url: https://github.com/JonKazama-Hellion/HellionChat
|
|
||||||
accepts_feedback: true
|
|
||||||
tags:
|
|
||||||
- Social
|
|
||||||
- UI
|
|
||||||
- Chat
|
|
||||||
- Replacement
|
|
||||||
- Privacy
|
|
||||||
changelog: |-
|
|
||||||
**Hellion Chat 0.5.1 — Backlog Sweep**
|
|
||||||
|
|
||||||
Pure hardening and polish. No new features. Eight backlog items
|
|
||||||
from the v0.5.0 codebase review collected into one patch:
|
|
||||||
|
|
||||||
- Cleanup preview now flags itself as out-of-date when the user
|
|
||||||
edits the whitelist after the last refresh, and the refresh
|
|
||||||
button is visually emphasised in that state
|
|
||||||
- Greeted Auto-Tell-Tabs now also dim their selection and hover
|
|
||||||
backgrounds in the sidebar, not just the text
|
|
||||||
- Performance section in the General tab moves to the standard
|
|
||||||
HelpMarker tooltip pattern instead of a wall-of-text description
|
|
||||||
- Tabs and Database settings tabs pull their display name from
|
|
||||||
HellionStrings instead of the upstream Language bundle, so all
|
|
||||||
eight tabs share one i18n source
|
|
||||||
- FontChooser results are now marshalled onto the framework thread
|
|
||||||
via Plugin.Framework.Run instead of being written to settings
|
|
||||||
state directly from the threadpool
|
|
||||||
- EmoteCache.LoadData drops async void and the four CS8618 build
|
|
||||||
warnings the build has been carrying since v0.4.0
|
|
||||||
- All MessageStore SQL paths that fed dynamic value lists into
|
|
||||||
interpolated SQL now use named parameter bindings via a new
|
|
||||||
BindIntList helper. Same behaviour, defence against future
|
|
||||||
user-input regressions
|
|
||||||
|
|
||||||
Configuration version is unchanged at 10. No migration. Existing
|
|
||||||
installs upgrade silently.
|
|
||||||
|
|
||||||
Based on Chat 2 1.35.3 (upstream Infiziert90/ChatTwo, EUPL-1.2).
|
|
||||||
|
|
||||||
**Hellion Chat 0.5.0 — Settings UX polish**
|
|
||||||
|
|
||||||
The settings window has been pulled apart and rebuilt around eight
|
|
||||||
themed tabs instead of the twelve organic ones it grew into.
|
|
||||||
Settings now sit where they belong and the wall-of-text descriptions
|
|
||||||
have been replaced with hover help markers across every section.
|
|
||||||
|
|
||||||
What changed in this release:
|
|
||||||
|
|
||||||
- Twelve tabs collapsed into eight: General, Appearance, Window,
|
|
||||||
Chat, Tabs, Privacy, Database and Information
|
|
||||||
- Theme and font controls moved out of the Privacy tab into
|
|
||||||
Appearance where they belong
|
|
||||||
- Auto-Tell-Tabs settings, message preview and emote controls now
|
|
||||||
live under one Chat tab with collapsible sections
|
|
||||||
- About and Changelog merged into a single Information tab
|
|
||||||
- Disabled settings keep their tooltip help marker visible so you
|
|
||||||
can still read why an option is greyed out
|
|
||||||
- Section headings start collapsed by default, the same pattern
|
|
||||||
used for the Auto-Tell-Tabs preload section in 0.4.0
|
|
||||||
|
|
||||||
Configuration version bumps from 9 to 10 as a wipe migration. The
|
|
||||||
old config file is copied to HellionChat.json.pre-v10-backup before
|
|
||||||
the new defaults are written, so you can restore your previous
|
|
||||||
setup by hand if anything looks off. A one-shot notification on
|
|
||||||
first start explains the reset.
|
|
||||||
|
|
||||||
No changes to message storage, retention sweep, the privacy filter
|
|
||||||
or the export pipeline. Tabs and chat history are untouched by the
|
|
||||||
migration.
|
|
||||||
|
|
||||||
Based on Chat 2 1.35.3 (upstream Infiziert90/ChatTwo, EUPL-1.2).
|
|
||||||
|
|
||||||
**Hellion Chat 0.4.0 — Auto-Tell-Tabs**
|
|
||||||
|
|
||||||
Auto-Tell-Tabs lets you turn each /tell into a session-only tab
|
|
||||||
dedicated to that conversation partner. The original use case is
|
|
||||||
the FFXIV club greeter who has to track 5–15 parallel "hi, welcome"
|
|
||||||
exchanges; everyone else can disable the feature in one click and
|
|
||||||
go back to a single Tell Exclusive tab.
|
|
||||||
|
|
||||||
What lands in this release:
|
|
||||||
|
|
||||||
- Auto-spawn temp tab "Name@World" on /tell (incoming and outgoing)
|
|
||||||
- Tab limit (default 15, range 1–50) with LRU drop that prefers
|
|
||||||
greeted tabs first, then sorts by last activity
|
|
||||||
- History preload from the local message store (default 20 tells,
|
|
||||||
range 0–100) with a "— Earlier conversations —" separator above
|
|
||||||
the live tell that triggered the spawn
|
|
||||||
- Optional "mark as greeted" toggle button (off by default,
|
|
||||||
greeter-specific) that dims the tab name and lets you flip the
|
|
||||||
status
|
|
||||||
- Section header "Active Tells (n)" or compact-mode separator in
|
|
||||||
the sidebar between persistent tabs and the temp tabs
|
|
||||||
- Settings UI under Chat (toggle / limit / compact / greeted-toggle)
|
|
||||||
and Privacy (history preload count), with hover-tooltip help
|
|
||||||
markers replacing the previous wall-of-text descriptions for the
|
|
||||||
new sections
|
|
||||||
- Save and load filters strip temp tabs from the on-disk config so
|
|
||||||
a crash or a sidebar-mode toggle never persists or wipes them
|
|
||||||
|
|
||||||
Compatibility note: if XIV Messanger or another plugin is
|
|
||||||
suppressing direct messages, disable its "Suppress DMs" option so
|
|
||||||
Hellion Chat can receive tells and open the auto tabs.
|
|
||||||
|
|
||||||
Configuration version bumps from 8 to 9. Existing users get a one-
|
|
||||||
shot notification on the first start, defaults are seeded by
|
|
||||||
property initializers, persistent tabs are untouched.
|
|
||||||
|
|
||||||
The vertical sidebar tab view becomes the default for fresh
|
|
||||||
installs; existing users keep their saved preference.
|
|
||||||
|
|
||||||
Inspired by the per-sender tab pattern in XIV InstantMessenger
|
|
||||||
(Limiana, AGPL-3.0). No code was ported across the licence
|
|
||||||
boundary; only the architectural concept influenced this design.
|
|
||||||
|
|
||||||
Based on Chat 2 1.35.3 (upstream Infiziert90/ChatTwo, EUPL-1.2).
|
|
||||||
|
|
||||||
**Hellion Chat 0.3.1 — Upstream emote regression fix**
|
|
||||||
|
|
||||||
Cherry-picks Infi's upstream commit ff899ff "Fix a regression
|
|
||||||
from API 15 updates" which changes the BetterTTV emote DTOs
|
|
||||||
(Emote and Top100) from public fields to public properties.
|
|
||||||
System.Text.Json under the API 15 toolchain only honours the
|
|
||||||
[JsonPropertyName] attribute on properties, so the previous
|
|
||||||
field-based version deserialised every fetched emote into empty
|
|
||||||
default values. Result: BetterTTV emotes were silently broken
|
|
||||||
on fresh installs. The fix is six lines and applies cleanly on
|
|
||||||
top of our defensive null-check from earlier; the EmoteCache
|
|
||||||
path-traversal hardening from 0.3.0 stays as it is.
|
|
||||||
|
|
||||||
Authorship of the fix is preserved with git cherry-pick -x, so
|
|
||||||
Infi shows up as the author on the commit. Thanks to him for
|
|
||||||
catching it in the upstream codebase.
|
|
||||||
|
|
||||||
**Hellion Chat 0.3.0 — Audit hardening, brand sweep and rebrand of slash commands**
|
|
||||||
|
|
||||||
This release closes the remaining audit follow-ups from the
|
|
||||||
0.2.0 cleanup and finishes turning Hellion Chat into a properly
|
|
||||||
branded fork rather than a Chat 2 with a different name.
|
|
||||||
|
|
||||||
Slash commands have been renamed across the board so they no
|
|
||||||
longer collide with the upstream plugin and tell you which
|
|
||||||
plugin owns them at a glance:
|
|
||||||
|
|
||||||
- /chat2 becomes /hellion
|
|
||||||
- /chat2Viewer becomes /hellionView
|
|
||||||
- /clearlog2 becomes /clearhellion
|
|
||||||
- /chat2Debugger becomes /hellionDebugger (internal)
|
|
||||||
- /chat2SeString becomes /hellionSeString (internal)
|
|
||||||
|
|
||||||
This is a breaking change for anyone with macros bound to the
|
|
||||||
old command names. The upstream Chat 2 commands keep working
|
|
||||||
if you also have that plugin installed.
|
|
||||||
|
|
||||||
Privacy and storage hardening based on the post-0.2.0 audit:
|
|
||||||
|
|
||||||
- Privacy filter master switch now states explicitly that the
|
|
||||||
filter only governs storage, not the live chat log
|
|
||||||
- Emote cache refuses to write outside its own directory if a
|
|
||||||
third-party API ever returns a path that escapes
|
|
||||||
- Retention sweep is serialised so the 24h auto-sweep and the
|
|
||||||
manual button cannot launch in parallel and race for the
|
|
||||||
SQLite connection
|
|
||||||
- DbViewer paging uses an int constant and the matching SQL
|
|
||||||
parameter name (the upstream code passed a float and a name
|
|
||||||
without the parameter prefix; both worked in practice but
|
|
||||||
were inconsistent)
|
|
||||||
|
|
||||||
Visual identity now matches the Hellion Online Media website:
|
|
||||||
|
|
||||||
- Theme palette switched to Arctic Cyan plus Ember Orange,
|
|
||||||
matching the website's BRANDING.md tokens
|
|
||||||
- Active tabs and window title bars use a brand-color-dark teal
|
|
||||||
variation as identity colour, replacing the previous slate
|
|
||||||
violet that did not appear in the brand
|
|
||||||
- Resize grips and scrollbar grabs picked up Ember Orange
|
|
||||||
instead of industrial amber on hover and active states
|
|
||||||
|
|
||||||
About tab rewritten and properly localised:
|
|
||||||
|
|
||||||
- New "Why this fork exists" block sets out the mission in
|
|
||||||
neutral terms, framing Chat 2's full-history default as the
|
|
||||||
right one for most users while explaining the narrower
|
|
||||||
default footprint this fork chose
|
|
||||||
- All Hellion-specific About copy now lives in HellionStrings
|
|
||||||
in EN and DE, so German users see the Hellion sections in
|
|
||||||
German rather than the upstream English fallback
|
|
||||||
- Webinterface absence is described as a focus mismatch
|
|
||||||
(different use case, substantial rebuild) rather than as
|
|
||||||
a security issue with the upstream code
|
|
||||||
- Translator list at the bottom of the About tab is reachable
|
|
||||||
again on smaller settings windows
|
|
||||||
|
|
||||||
Based on Chat 2 1.35.3 (upstream Infiziert90/ChatTwo, EUPL-1.2).
|
|
||||||
|
|
||||||
**Hellion Chat 0.2.0 — Webinterface removed**
|
|
||||||
|
|
||||||
The upstream webinterface has been removed in its entirety. It
|
|
||||||
serves a different use case from the smaller default footprint
|
|
||||||
this fork is built around, namely remote access to chat from a
|
|
||||||
second device. Aligning it with the data minimisation defaults
|
|
||||||
Hellion Chat ships with would have meant a substantial rebuild.
|
|
||||||
Removing it was the cleaner path for this particular fork.
|
|
||||||
|
|
||||||
What changed in this release:
|
|
||||||
|
|
||||||
- Settings tab "Webinterface" is gone, the corresponding
|
|
||||||
Configuration fields (WebinterfaceEnabled / AutoStart / Password /
|
|
||||||
Port / AuthStore / MaxLinesToSend) are dropped and stale entries
|
|
||||||
fall out of the JSON on the next save automatically
|
|
||||||
- The whole ChatTwo/Http tree, the bundled Svelte frontend in
|
|
||||||
websiteBuild.zip and the WebinterfaceUtil helper are deleted
|
|
||||||
- Watson.Lite (the HTTP server) and Newtonsoft.Json (only used by
|
|
||||||
the webinterface JSON wire format) are removed from the
|
|
||||||
package references
|
|
||||||
- DbViewer's "Chat2 JSON Export" button is dropped because it
|
|
||||||
serialised the database into the webinterface message protocol;
|
|
||||||
the Privacy tab's MessageExporter (Markdown, JSON, CSV with
|
|
||||||
channel and date filters) covers the same ground without the
|
|
||||||
proprietary shape
|
|
||||||
- About tab notes the absence so users coming from Chat 2 do not
|
|
||||||
look for it
|
|
||||||
- Configuration version bumps from 7 to 8 with a one-shot
|
|
||||||
notification (EN + DE)
|
|
||||||
|
|
||||||
No changes to the privacy filter, retention sweep, first-run wizard
|
|
||||||
or export pipeline. Existing chat history is preserved.
|
|
||||||
|
|
||||||
Based on Chat 2 1.35.3 (upstream Infiziert90/ChatTwo, EUPL-1.2).
|
|
||||||
|
|
||||||
**Hellion Chat 0.1.2 — About tab rebrand, DBViewer polish**
|
|
||||||
|
|
||||||
- About tab now shows Hellion-specific maintainer, license, EU/US/JP
|
|
||||||
disclaimer and SQUARE ENIX disclaimer instead of the inherited
|
|
||||||
Chat 2 contact info; original ChatTwo translator credits stay
|
|
||||||
visible under a clearly labelled upstream tree node
|
|
||||||
- Localization clarified: Hellion-specific German strings are
|
|
||||||
maintained by the fork maintainer, the Crowdin contributor list
|
|
||||||
only covers the inherited upstream strings
|
|
||||||
- Cherry-picked DBViewer UI improvements from upstream Chat 2
|
|
||||||
(auto-scroll-reset on page change, tooltips on date reset,
|
|
||||||
folder export, page arrows, localized export-running messages)
|
|
||||||
- README rewritten in the Hellion project style with a tech-stack
|
|
||||||
table, architecture tree, database column list, install guide,
|
|
||||||
upstream-sync workflow notes and project-status checklist
|
|
||||||
|
|
||||||
**Hellion Chat 0.1.1 — Packaging and migration fixes**
|
|
||||||
|
|
||||||
- Plugin icon now ships inside the bundle, so the Hellion logo
|
|
||||||
renders locally in the Dalamud plugin list once installed (the
|
|
||||||
previous release relied only on the remote IconUrl)
|
|
||||||
- Plugin icon downsampled from 1024×1024 to 256×256 to match the
|
|
||||||
rendered size; loads faster and caches better
|
|
||||||
- Migration from upstream Chat 2 is more robust: each file move is
|
|
||||||
wrapped individually, a locked SQLite database no longer aborts
|
|
||||||
the rest of the migration, and a warning notification fires when
|
|
||||||
any file is held open (with a hint to disable Chat 2 and restart
|
|
||||||
the game)
|
|
||||||
- README ships a step-by-step migration guide (fresh install versus
|
|
||||||
coming from Chat 2) and a troubleshooting section with manual
|
|
||||||
recovery commands for Linux and Windows
|
|
||||||
|
|
||||||
**Hellion Chat 0.1.0 — Initial fork release**
|
|
||||||
|
|
||||||
Privacy
|
|
||||||
- Channel whitelist filter in MessageStore.UpsertMessage with a
|
|
||||||
Privacy-First default (own conversations only)
|
|
||||||
- Per-channel retention with a 24-hour idempotent background sweep
|
|
||||||
- Retroactive cleanup with a Ctrl+Shift confirm and VACUUM
|
|
||||||
- Export to Markdown / JSON / CSV via Dalamud's file dialog
|
|
||||||
|
|
||||||
Onboarding
|
|
||||||
- First-run wizard with three profiles: Privacy-First / Casual /
|
|
||||||
Full History
|
|
||||||
- Configuration migration that seeds defaults on update
|
|
||||||
- One-shot migration from upstream Chat 2's pluginConfigs layout
|
|
||||||
- Migrate3 idempotency recovery for half-migrated databases
|
|
||||||
|
|
||||||
Look & feel
|
|
||||||
- Localized UI (English and German) with live language switching
|
|
||||||
- Industrial HUD theme with cyan-teal action accents, slate-violet
|
|
||||||
tabs, amber active highlights and a window-opacity slider
|
|
||||||
|
|
||||||
Based on Chat 2 1.35.3 (upstream Infiziert90/ChatTwo, EUPL-1.2).
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
using Dalamud.Plugin.Ipc;
|
|
||||||
|
|
||||||
namespace ChatTwo.Ipc;
|
|
||||||
|
|
||||||
public sealed class ExtraChat : IDisposable
|
|
||||||
{
|
|
||||||
#pragma warning disable CS0649 // Assigned through IPC
|
|
||||||
[Serializable]
|
|
||||||
private struct OverrideInfo
|
|
||||||
{
|
|
||||||
public string? Channel;
|
|
||||||
public ushort UiColour;
|
|
||||||
public uint Rgba;
|
|
||||||
}
|
|
||||||
#pragma warning restore CS0649
|
|
||||||
|
|
||||||
private ICallGateSubscriber<OverrideInfo, object> OverrideChannelGate { get; }
|
|
||||||
private ICallGateSubscriber<Dictionary<string, uint>, Dictionary<string, uint>> ChannelCommandColoursGate { get; }
|
|
||||||
private ICallGateSubscriber<Dictionary<Guid, string>, Dictionary<Guid, string>> ChannelNamesGate { get; }
|
|
||||||
|
|
||||||
internal (string, uint)? ChannelOverride { get; set; }
|
|
||||||
|
|
||||||
private Dictionary<string, uint> ChannelCommandColoursInternal { get; set; } = new();
|
|
||||||
internal IReadOnlyDictionary<string, uint> ChannelCommandColours => ChannelCommandColoursInternal;
|
|
||||||
|
|
||||||
private Dictionary<Guid, string> ChannelNamesInternal { get; set; } = new();
|
|
||||||
internal IReadOnlyDictionary<Guid, string> ChannelNames => ChannelNamesInternal;
|
|
||||||
|
|
||||||
internal ExtraChat()
|
|
||||||
{
|
|
||||||
OverrideChannelGate = Plugin.Interface.GetIpcSubscriber<OverrideInfo, object>("ExtraChat.OverrideChannelColour");
|
|
||||||
ChannelCommandColoursGate = Plugin.Interface.GetIpcSubscriber<Dictionary<string, uint>, Dictionary<string, uint>>("ExtraChat.ChannelCommandColours");
|
|
||||||
ChannelNamesGate = Plugin.Interface.GetIpcSubscriber<Dictionary<Guid, string>, Dictionary<Guid, string>>("ExtraChat.ChannelNames");
|
|
||||||
|
|
||||||
OverrideChannelGate.Subscribe(OnOverrideChannel);
|
|
||||||
ChannelCommandColoursGate.Subscribe(OnChannelCommandColours);
|
|
||||||
ChannelNamesGate.Subscribe(OnChannelNames);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ChannelCommandColoursInternal = ChannelCommandColoursGate.InvokeFunc(null!);
|
|
||||||
ChannelNamesInternal = ChannelNamesGate.InvokeFunc(null!);
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
// no-op
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
OverrideChannelGate.Unsubscribe(OnOverrideChannel);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnOverrideChannel(OverrideInfo info)
|
|
||||||
{
|
|
||||||
if (info.Channel == null)
|
|
||||||
{
|
|
||||||
ChannelOverride = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ChannelOverride = (info.Channel, info.Rgba);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnChannelCommandColours(Dictionary<string, uint> obj)
|
|
||||||
{
|
|
||||||
ChannelCommandColoursInternal = obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnChannelNames(Dictionary<Guid, string> obj)
|
|
||||||
{
|
|
||||||
ChannelNamesInternal = obj;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
using ChatTwo.Code;
|
|
||||||
using Dalamud.Plugin.Ipc;
|
|
||||||
|
|
||||||
namespace ChatTwo.Ipc;
|
|
||||||
|
|
||||||
using ChatInputState = (bool InputVisible, bool InputFocused, bool HasText, bool IsTyping, int TextLength, ChatType ChannelType);
|
|
||||||
|
|
||||||
internal sealed class TypingIpc : IDisposable
|
|
||||||
{
|
|
||||||
private Plugin Plugin { get; }
|
|
||||||
|
|
||||||
private ICallGateProvider<ChatInputState> StateQueryGate { get; }
|
|
||||||
private ICallGateProvider<ChatInputState, object?> StateChangedGate { get; }
|
|
||||||
|
|
||||||
private ChatInputState LastState;
|
|
||||||
private bool HasState;
|
|
||||||
|
|
||||||
internal TypingIpc(Plugin plugin)
|
|
||||||
{
|
|
||||||
Plugin = plugin;
|
|
||||||
|
|
||||||
StateQueryGate = Plugin.Interface.GetIpcProvider<ChatInputState>("ChatTwo.GetChatInputState");
|
|
||||||
StateChangedGate = Plugin.Interface.GetIpcProvider<ChatInputState, object?>("ChatTwo.ChatInputStateChanged");
|
|
||||||
|
|
||||||
StateQueryGate.RegisterFunc(GetState);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ChatInputState BuildState()
|
|
||||||
{
|
|
||||||
var log = Plugin.ChatLogWindow;
|
|
||||||
|
|
||||||
var usedChannel = Plugin.CurrentTab.CurrentChannel;
|
|
||||||
var inputChannel = usedChannel.UseTempChannel ? usedChannel.TempChannel : usedChannel.Channel;
|
|
||||||
var channelType = inputChannel.ToChatType();
|
|
||||||
|
|
||||||
return (InputVisible: !log.IsHidden,
|
|
||||||
log.InputFocused,
|
|
||||||
HasText: log.Chat.Length > 0,
|
|
||||||
IsTyping: log is { InputFocused: true, Chat.Length: > 0 },
|
|
||||||
TextLength: log.Chat.Length,
|
|
||||||
ChannelType: channelType);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ChatInputState GetState()
|
|
||||||
=> BuildState();
|
|
||||||
|
|
||||||
internal void Update()
|
|
||||||
{
|
|
||||||
var state = BuildState();
|
|
||||||
if (HasState && state.Equals(LastState))
|
|
||||||
return;
|
|
||||||
|
|
||||||
HasState = true;
|
|
||||||
LastState = state;
|
|
||||||
StateChangedGate.SendMessage(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
StateQueryGate.UnregisterFunc();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
using Dalamud.Game.Text.SeStringHandling;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
|
||||||
using Dalamud.Plugin.Ipc;
|
|
||||||
|
|
||||||
namespace ChatTwo;
|
|
||||||
|
|
||||||
internal sealed class IpcManager : IDisposable
|
|
||||||
{
|
|
||||||
private ICallGateProvider<string> RegisterGate { get; }
|
|
||||||
private ICallGateProvider<string, object?> UnregisterGate { get; }
|
|
||||||
private ICallGateProvider<object?> AvailableGate { get; }
|
|
||||||
private ICallGateProvider<string, PlayerPayload?, ulong, Payload?, SeString?, SeString?, object?> InvokeGate { get; }
|
|
||||||
|
|
||||||
internal List<string> Registered { get; } = [];
|
|
||||||
|
|
||||||
public IpcManager()
|
|
||||||
{
|
|
||||||
RegisterGate = Plugin.Interface.GetIpcProvider<string>("ChatTwo.Register");
|
|
||||||
RegisterGate.RegisterFunc(Register);
|
|
||||||
|
|
||||||
AvailableGate = Plugin.Interface.GetIpcProvider<object?>("ChatTwo.Available");
|
|
||||||
|
|
||||||
UnregisterGate = Plugin.Interface.GetIpcProvider<string, object?>("ChatTwo.Unregister");
|
|
||||||
UnregisterGate.RegisterAction(Unregister);
|
|
||||||
|
|
||||||
InvokeGate = Plugin.Interface.GetIpcProvider<string, PlayerPayload?, ulong, Payload?, SeString?, SeString?, object?>("ChatTwo.Invoke");
|
|
||||||
|
|
||||||
AvailableGate.SendMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void Invoke(string id, PlayerPayload? sender, ulong contentId, Payload? payload, SeString? senderString, SeString? content)
|
|
||||||
{
|
|
||||||
InvokeGate.SendMessage(id, sender, contentId, payload, senderString, content);
|
|
||||||
}
|
|
||||||
|
|
||||||
private string Register()
|
|
||||||
{
|
|
||||||
var id = Guid.NewGuid().ToString();
|
|
||||||
Registered.Add(id);
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Unregister(string id)
|
|
||||||
{
|
|
||||||
Registered.Remove(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
UnregisterGate.UnregisterFunc();
|
|
||||||
RegisterGate.UnregisterFunc();
|
|
||||||
Registered.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,918 +0,0 @@
|
|||||||
using System.Buffers;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Data.Common;
|
|
||||||
using ChatTwo.Code;
|
|
||||||
using ChatTwo.Ui;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
|
||||||
using MessagePack;
|
|
||||||
using MessagePack.Formatters;
|
|
||||||
using MessagePack.Resolvers;
|
|
||||||
using Microsoft.Data.Sqlite;
|
|
||||||
|
|
||||||
using DalamudUtil = Dalamud.Utility.Util;
|
|
||||||
using Encoding = System.Text.Encoding;
|
|
||||||
|
|
||||||
namespace ChatTwo;
|
|
||||||
|
|
||||||
internal static class DbExtensions
|
|
||||||
{
|
|
||||||
internal static void Execute(this DbConnection conn, string sql)
|
|
||||||
{
|
|
||||||
using var cmd = conn.CreateCommand();
|
|
||||||
cmd.CommandText = sql;
|
|
||||||
cmd.ExecuteNonQuery();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal enum PayloadMessagePackType : byte
|
|
||||||
{
|
|
||||||
Achievement,
|
|
||||||
PartyFinder,
|
|
||||||
Uri,
|
|
||||||
Emote,
|
|
||||||
Other = 255,
|
|
||||||
}
|
|
||||||
|
|
||||||
public class PayloadMessagePackFormatter : IMessagePackFormatter<Payload?>
|
|
||||||
{
|
|
||||||
public void Serialize(ref MessagePackWriter writer, Payload? value, MessagePackSerializerOptions options)
|
|
||||||
{
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
writer.WriteNil();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
writer.WriteArrayHeader(2);
|
|
||||||
switch (value)
|
|
||||||
{
|
|
||||||
case AchievementPayload achievementPayload:
|
|
||||||
writer.WriteUInt8((byte)PayloadMessagePackType.Achievement);
|
|
||||||
writer.WriteUInt32(achievementPayload.Id);
|
|
||||||
break;
|
|
||||||
case PartyFinderPayload partyFinderPayload:
|
|
||||||
writer.WriteUInt8((byte)PayloadMessagePackType.PartyFinder);
|
|
||||||
writer.WriteUInt32(partyFinderPayload.Id);
|
|
||||||
break;
|
|
||||||
case UriPayload uriPayload:
|
|
||||||
writer.WriteUInt8((byte)PayloadMessagePackType.Uri);
|
|
||||||
writer.WriteString(Encoding.UTF8.GetBytes(uriPayload.Uri.ToString()));
|
|
||||||
break;
|
|
||||||
case EmotePayload emotePayload:
|
|
||||||
writer.WriteUInt8((byte)PayloadMessagePackType.Emote);
|
|
||||||
writer.WriteString(Encoding.UTF8.GetBytes(emotePayload.Code));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
writer.WriteUInt8((byte)PayloadMessagePackType.Other);
|
|
||||||
writer.Write(value.Encode());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Payload? Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)
|
|
||||||
{
|
|
||||||
if (reader.TryReadNil())
|
|
||||||
return null;
|
|
||||||
|
|
||||||
if (reader.ReadArrayHeader() != 2)
|
|
||||||
throw new InvalidOperationException("Invalid array count for Payload object");
|
|
||||||
|
|
||||||
var type = (PayloadMessagePackType)reader.ReadByte();
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case PayloadMessagePackType.Achievement:
|
|
||||||
return new AchievementPayload(reader.ReadUInt32());
|
|
||||||
case PayloadMessagePackType.PartyFinder:
|
|
||||||
return new PartyFinderPayload(reader.ReadUInt32());
|
|
||||||
case PayloadMessagePackType.Uri:
|
|
||||||
return new UriPayload(new Uri(reader.ReadString() ?? ""));
|
|
||||||
case PayloadMessagePackType.Emote:
|
|
||||||
return EmotePayload.ResolveEmote(reader.ReadString() ?? "");
|
|
||||||
case PayloadMessagePackType.Other:
|
|
||||||
default:
|
|
||||||
var bytes = reader.ReadBytes() ?? new ReadOnlySequence<byte>();
|
|
||||||
var binReader = new BinaryReader(new MemoryStream(bytes.ToArray()));
|
|
||||||
return Payload.Decode(binReader);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SeStringMessagePackFormatter : IMessagePackFormatter<SeString?>
|
|
||||||
{
|
|
||||||
public void Serialize(ref MessagePackWriter writer, SeString? value, MessagePackSerializerOptions options)
|
|
||||||
{
|
|
||||||
options.Resolver.GetFormatter<List<Payload>>()!.Serialize(ref writer, value?.Payloads ?? [], options);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SeString Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)
|
|
||||||
{
|
|
||||||
return new SeString(options.Resolver.GetFormatter<List<Payload>>()!.Deserialize(ref reader, options));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal class MessageStore : IDisposable
|
|
||||||
{
|
|
||||||
private const int MessageQueryLimit = 10_000;
|
|
||||||
|
|
||||||
private string DbPath { get; }
|
|
||||||
|
|
||||||
private SqliteConnection Connection { get; set; }
|
|
||||||
|
|
||||||
internal static readonly MessagePackSerializerOptions MsgPackOptions = MessagePackSerializerOptions.Standard
|
|
||||||
.WithResolver(CompositeResolver.Create([new PayloadMessagePackFormatter(), new SeStringMessagePackFormatter()], [StandardResolver.Instance]));
|
|
||||||
|
|
||||||
internal MessageStore(string dbPath)
|
|
||||||
{
|
|
||||||
DbPath = dbPath;
|
|
||||||
Connection = Connect();
|
|
||||||
Migrate();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
Connection.Close();
|
|
||||||
Connection.Dispose();
|
|
||||||
// Closing the connection doesn't immediately release the file.
|
|
||||||
GC.Collect();
|
|
||||||
GC.WaitForPendingFinalizers();
|
|
||||||
}
|
|
||||||
|
|
||||||
private SqliteConnection Connect()
|
|
||||||
{
|
|
||||||
var uriBuilder = new SqliteConnectionStringBuilder
|
|
||||||
{
|
|
||||||
DataSource = DbPath,
|
|
||||||
DefaultTimeout = 5,
|
|
||||||
Pooling = false,
|
|
||||||
Mode = SqliteOpenMode.ReadWriteCreate,
|
|
||||||
};
|
|
||||||
|
|
||||||
var conn = new SqliteConnection(uriBuilder.ToString());
|
|
||||||
conn.Open();
|
|
||||||
conn.Execute(@"PRAGMA journal_mode=WAL;");
|
|
||||||
conn.Execute(@"PRAGMA synchronous=NORMAL;");
|
|
||||||
if (DalamudUtil.IsWine())
|
|
||||||
conn.Execute(@"PRAGMA cache_size = 32768;");
|
|
||||||
return conn;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Migrate()
|
|
||||||
{
|
|
||||||
// Get current user_version.
|
|
||||||
using var cmd = Connection.CreateCommand();
|
|
||||||
cmd.CommandText = "PRAGMA user_version;";
|
|
||||||
var userVersion = Convert.ToInt32(cmd.ExecuteScalar());
|
|
||||||
|
|
||||||
var migrationsToDo = new List<Action>();
|
|
||||||
switch (userVersion)
|
|
||||||
{
|
|
||||||
case <= 0:
|
|
||||||
migrationsToDo.Add(Migrate0);
|
|
||||||
|
|
||||||
// Migration support was only added in version 1. Migrate 0 is
|
|
||||||
// idempotent.
|
|
||||||
migrationsToDo.Add(Migrate1);
|
|
||||||
migrationsToDo.Add(Migrate2);
|
|
||||||
migrationsToDo.Add(Migrate3);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
migrationsToDo.Add(Migrate2);
|
|
||||||
migrationsToDo.Add(Migrate3);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
migrationsToDo.Add(Migrate3);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var migration in migrationsToDo)
|
|
||||||
migration();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Migrate0()
|
|
||||||
{
|
|
||||||
Plugin.Log.Information("Running migration 0: Creating tables");
|
|
||||||
Connection.Execute(@"
|
|
||||||
CREATE TABLE IF NOT EXISTS messages (
|
|
||||||
Id BLOB PRIMARY KEY NOT NULL, -- Guid
|
|
||||||
Receiver INTEGER NOT NULL, -- uint64 (first bits are always 0)
|
|
||||||
ContentId INTEGER NOT NULL, -- uint64 (first bits are always 0)
|
|
||||||
Date INTEGER NOT NULL, -- unix timestamp with millisecond precision
|
|
||||||
Code INTEGER NOT NULL, -- ChatCode encoding
|
|
||||||
Sender BLOB NOT NULL, -- Chunk[] msgpack
|
|
||||||
Content BLOB NOT NULL, -- Chunk[] msgpack
|
|
||||||
SenderSource BLOB NOT NULL, -- SeString
|
|
||||||
ContentSource BLOB NOT NULL, -- SeString
|
|
||||||
SortCode INTEGER NOT NULL, -- SortCode encoding
|
|
||||||
ExtraChatChannel BLOB NOT NULL -- Guid
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_messages_receiver ON messages (Receiver);
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_messages_date ON messages (Date);
|
|
||||||
");
|
|
||||||
|
|
||||||
SetMigrationVersion(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Migrate1()
|
|
||||||
{
|
|
||||||
Plugin.Log.Information("Running migration 1: Adding Deleted column");
|
|
||||||
Connection.Execute(@"
|
|
||||||
-- Migration 1: Add Deleted column
|
|
||||||
ALTER TABLE messages ADD COLUMN Deleted BOOLEAN NOT NULL DEFAULT false;
|
|
||||||
");
|
|
||||||
|
|
||||||
SetMigrationVersion(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Migrate2()
|
|
||||||
{
|
|
||||||
Plugin.Log.Information("Running migration 2: Adding Channel generated column");
|
|
||||||
Connection.Execute(@"
|
|
||||||
-- Migration 2: Add Channel generated column
|
|
||||||
ALTER TABLE messages ADD COLUMN Channel INTEGER GENERATED ALWAYS AS (Code & 0x7f) VIRTUAL;
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_messages_channel ON messages (Channel);
|
|
||||||
");
|
|
||||||
|
|
||||||
SetMigrationVersion(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool ColumnExists(string table, string column)
|
|
||||||
{
|
|
||||||
// PRAGMA does not accept SQLite parameter bindings. The table name is
|
|
||||||
// a compile-time constant fed in from internal call sites, so the
|
|
||||||
// interpolation cannot be reached from any user-controlled path.
|
|
||||||
using var cmd = Connection.CreateCommand();
|
|
||||||
cmd.CommandText = $"PRAGMA table_info({table});";
|
|
||||||
using var reader = cmd.ExecuteReader();
|
|
||||||
while (reader.Read())
|
|
||||||
{
|
|
||||||
if (reader.GetString(1) == column)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Migrate3()
|
|
||||||
{
|
|
||||||
Plugin.Log.Information("Running migration 3: Fix log kinds to fit the new format");
|
|
||||||
|
|
||||||
// Recovery for partially-applied Migrate3: if the schema is already
|
|
||||||
// in its target shape (new columns exist, old Code column gone) but
|
|
||||||
// user_version was never bumped, just record the version and exit.
|
|
||||||
if (ColumnExists("messages", "ChatType") && !ColumnExists("messages", "Code"))
|
|
||||||
{
|
|
||||||
Plugin.Log.Information("Migration 3: schema already migrated, only bumping user_version");
|
|
||||||
SetMigrationVersion(3);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Connection.Execute(@"
|
|
||||||
-- Migration 3: Fix log kinds to fit the new format
|
|
||||||
-- Add new ChatType, SourceKind, TargetKind (byte), SortCodeV2
|
|
||||||
-- Migrate OldChatColumn
|
|
||||||
-- ChatType = OldChatColumn & 0x7f
|
|
||||||
-- SourceKind = log2(1 << ((OldChatColumn >> 11) & 0xF))
|
|
||||||
-- TargetKind = trunc(log2(1 << ((OldChatColumn >> 7) & 0xF)))
|
|
||||||
-- Virtual SortCodeV2 = ChatType << 16 | SourceKind << 8 | TargetKind
|
|
||||||
-- Delete OldChatColumn, Virtual Channel
|
|
||||||
|
|
||||||
ALTER TABLE messages ADD COLUMN ChatType INTEGER;
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_messages_chat_type ON messages (ChatType);
|
|
||||||
ALTER TABLE messages ADD COLUMN SourceKind INTEGER;
|
|
||||||
ALTER TABLE messages ADD COLUMN TargetKind INTEGER;
|
|
||||||
|
|
||||||
UPDATE messages SET
|
|
||||||
ChatType = Code & 0x7f,
|
|
||||||
SourceKind = trunc(log2(1 << ((Code >> 11) & 0xF))),
|
|
||||||
TargetKind = trunc(log2(1 << ((Code >> 7) & 0xF)))
|
|
||||||
WHERE true;
|
|
||||||
|
|
||||||
DROP INDEX idx_messages_channel;
|
|
||||||
ALTER TABLE messages DROP COLUMN Channel;
|
|
||||||
ALTER TABLE messages DROP COLUMN Code;
|
|
||||||
ALTER TABLE messages DROP COLUMN SortCode;
|
|
||||||
");
|
|
||||||
|
|
||||||
SetMigrationVersion(3);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SetMigrationVersion(int version)
|
|
||||||
{
|
|
||||||
Plugin.Log.Information($"Setting version {version}");
|
|
||||||
using var cmd = Connection.CreateCommand();
|
|
||||||
// PRAGMA does not accept SQLite parameter bindings, and there is no
|
|
||||||
// pragma_ function variant that can set the version either. The
|
|
||||||
// version is a compile-time int from the migration sequence, never
|
|
||||||
// user input.
|
|
||||||
cmd.CommandText = $"PRAGMA user_version = {version};";
|
|
||||||
cmd.ExecuteNonQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void ClearMessages()
|
|
||||||
{
|
|
||||||
Connection.Execute("DELETE FROM messages;");
|
|
||||||
PerformMaintenance();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a (ChatType, count) snapshot over non-deleted messages.
|
|
||||||
/// Used by the Privacy tab to preview the impact of a retroactive
|
|
||||||
/// cleanup before the user confirms.
|
|
||||||
/// </summary>
|
|
||||||
internal Dictionary<int, long> GetMessageCountsByChatType()
|
|
||||||
{
|
|
||||||
var result = new Dictionary<int, long>();
|
|
||||||
using var cmd = Connection.CreateCommand();
|
|
||||||
cmd.CommandText = "SELECT ChatType, COUNT(*) FROM messages WHERE deleted = false GROUP BY ChatType;";
|
|
||||||
cmd.CommandTimeout = 120;
|
|
||||||
using var reader = cmd.ExecuteReader();
|
|
||||||
while (reader.Read())
|
|
||||||
{
|
|
||||||
var chatType = reader.GetInt32(0);
|
|
||||||
var count = reader.GetInt64(1);
|
|
||||||
result[chatType] = count;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes messages older than the per-channel retention window, with a
|
|
||||||
/// global default for channels not listed explicitly. Cutoffs are
|
|
||||||
/// computed from "now" at call time. Runs VACUUM only if anything was
|
|
||||||
/// removed. Returns the number of rows deleted.
|
|
||||||
/// </summary>
|
|
||||||
internal long DeleteByRetentionPolicy(IReadOnlyDictionary<int, int> chatTypeDaysMap, int defaultDays)
|
|
||||||
{
|
|
||||||
if (defaultDays < 0)
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(defaultDays), "Negative retention is not allowed.");
|
|
||||||
foreach (var (_, days) in chatTypeDaysMap)
|
|
||||||
if (days < 0)
|
|
||||||
throw new ArgumentOutOfRangeException(nameof(chatTypeDaysMap), "Negative retention is not allowed.");
|
|
||||||
|
|
||||||
var nowMs = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
|
||||||
|
|
||||||
if (chatTypeDaysMap.Count == 0 && defaultDays <= 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
long deleted;
|
|
||||||
using (var cmd = Connection.CreateCommand())
|
|
||||||
{
|
|
||||||
var clauses = new List<string>();
|
|
||||||
var index = 0;
|
|
||||||
foreach (var (type, days) in chatTypeDaysMap)
|
|
||||||
{
|
|
||||||
var cutoff = nowMs - days * 86400000L;
|
|
||||||
var typeParam = $"$type{index}";
|
|
||||||
var cutoffParam = $"$cutoff{index}";
|
|
||||||
cmd.Parameters.AddWithValue(typeParam, type);
|
|
||||||
cmd.Parameters.AddWithValue(cutoffParam, cutoff);
|
|
||||||
clauses.Add($"(ChatType = {typeParam} AND Date < {cutoffParam})");
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Catch-all for channels without an explicit override. "0" is
|
|
||||||
// treated as "do not delete by default" — without an explicit
|
|
||||||
// user override, unmapped channels stay forever instead of
|
|
||||||
// getting wiped immediately.
|
|
||||||
if (defaultDays > 0)
|
|
||||||
{
|
|
||||||
var defaultCutoff = nowMs - defaultDays * 86400000L;
|
|
||||||
cmd.Parameters.AddWithValue("$defaultCutoff", defaultCutoff);
|
|
||||||
|
|
||||||
var explicitPlaceholders = chatTypeDaysMap.Count > 0
|
|
||||||
? BindIntList(cmd, "explicit", chatTypeDaysMap.Keys)
|
|
||||||
: "-1"; // empty list would produce invalid SQL
|
|
||||||
clauses.Add($"(ChatType NOT IN ({explicitPlaceholders}) AND Date < $defaultCutoff)");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clauses.Count == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
cmd.CommandText = $"DELETE FROM messages WHERE {string.Join(" OR ", clauses)};";
|
|
||||||
cmd.CommandTimeout = 600;
|
|
||||||
deleted = cmd.ExecuteNonQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (deleted > 0)
|
|
||||||
PerformMaintenance();
|
|
||||||
return deleted;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Hard-deletes every message whose ChatType is not in the supplied
|
|
||||||
/// allowlist, then VACUUMs the database to reclaim disk space.
|
|
||||||
/// Returns the number of rows deleted.
|
|
||||||
/// </summary>
|
|
||||||
internal long CleanupRetainOnly(IReadOnlyCollection<int> allowedTypes)
|
|
||||||
{
|
|
||||||
if (allowedTypes.Count == 0)
|
|
||||||
{
|
|
||||||
// Defensive: refuse a "delete everything" disguised as a filter.
|
|
||||||
// Use ClearMessages() if a full wipe is actually intended.
|
|
||||||
throw new InvalidOperationException("CleanupRetainOnly requires at least one allowed ChatType. Use ClearMessages for a full wipe.");
|
|
||||||
}
|
|
||||||
|
|
||||||
long deleted;
|
|
||||||
using (var cmd = Connection.CreateCommand())
|
|
||||||
{
|
|
||||||
var placeholders = BindIntList(cmd, "ct", allowedTypes);
|
|
||||||
cmd.CommandText = $"DELETE FROM messages WHERE ChatType NOT IN ({placeholders});";
|
|
||||||
cmd.CommandTimeout = 600;
|
|
||||||
deleted = cmd.ExecuteNonQuery();
|
|
||||||
}
|
|
||||||
PerformMaintenance();
|
|
||||||
return deleted;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void PerformMaintenance()
|
|
||||||
{
|
|
||||||
Connection.Execute(@"
|
|
||||||
VACUUM;
|
|
||||||
REINDEX messages;
|
|
||||||
ANALYZE;
|
|
||||||
");
|
|
||||||
}
|
|
||||||
|
|
||||||
private string LogPath => DbPath + "-wal";
|
|
||||||
internal long DatabaseSize() => !File.Exists(DbPath) ? 0 : new FileInfo(DbPath).Length;
|
|
||||||
internal long DatabaseLogSize() => !File.Exists(LogPath) ? 0 : new FileInfo(LogPath).Length;
|
|
||||||
|
|
||||||
internal int MessageCount()
|
|
||||||
{
|
|
||||||
using var cmd = Connection.CreateCommand();
|
|
||||||
cmd.CommandText = "SELECT COUNT(*) FROM messages;";
|
|
||||||
return Convert.ToInt32(cmd.ExecuteScalar());
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void UpsertMessage(Message message)
|
|
||||||
{
|
|
||||||
// Hellion Chat privacy filter — drop disallowed ChatTypes before
|
|
||||||
// they reach the storage layer (single source of truth, also
|
|
||||||
// covers any future write paths e.g. webinterface backfill).
|
|
||||||
if (!Plugin.Config.IsAllowedForStorage(message.Code.Type))
|
|
||||||
{
|
|
||||||
Plugin.Log.Debug($"Privacy filter dropped message: ChatType={message.Code.Type}");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using var cmd = Connection.CreateCommand();
|
|
||||||
cmd.CommandText = @"
|
|
||||||
INSERT INTO messages (
|
|
||||||
Id,
|
|
||||||
Receiver,
|
|
||||||
ContentId,
|
|
||||||
Date,
|
|
||||||
ChatType,
|
|
||||||
SourceKind,
|
|
||||||
TargetKind,
|
|
||||||
Sender,
|
|
||||||
Content,
|
|
||||||
SenderSource,
|
|
||||||
ContentSource,
|
|
||||||
ExtraChatChannel,
|
|
||||||
Deleted
|
|
||||||
) VALUES (
|
|
||||||
$Id,
|
|
||||||
$Receiver,
|
|
||||||
$ContentId,
|
|
||||||
$Date,
|
|
||||||
$ChatType,
|
|
||||||
$SourceKind,
|
|
||||||
$TargetKind,
|
|
||||||
$Sender,
|
|
||||||
$Content,
|
|
||||||
$SenderSource,
|
|
||||||
$ContentSource,
|
|
||||||
$ExtraChatChannel,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
ON CONFLICT (id) DO UPDATE SET
|
|
||||||
Receiver = excluded.Receiver,
|
|
||||||
ContentId = excluded.ContentId,
|
|
||||||
Date = excluded.Date,
|
|
||||||
ChatType = excluded.ChatType,
|
|
||||||
SourceKind = excluded.SourceKind,
|
|
||||||
TargetKind = excluded.TargetKind,
|
|
||||||
Sender = excluded.Sender,
|
|
||||||
Content = excluded.Content,
|
|
||||||
SenderSource = excluded.SenderSource,
|
|
||||||
ContentSource = excluded.ContentSource,
|
|
||||||
ExtraChatChannel = excluded.ExtraChatChannel,
|
|
||||||
Deleted = false;
|
|
||||||
";
|
|
||||||
|
|
||||||
cmd.Parameters.AddWithValue("$Id", message.Id);
|
|
||||||
cmd.Parameters.AddWithValue("$Receiver", message.Receiver);
|
|
||||||
cmd.Parameters.AddWithValue("$ContentId", message.ContentId);
|
|
||||||
cmd.Parameters.AddWithValue("$Date", message.Date.ToUnixTimeMilliseconds());
|
|
||||||
cmd.Parameters.AddWithValue("$ChatType", message.Code.Type);
|
|
||||||
cmd.Parameters.AddWithValue("$SourceKind", message.Code.Source);
|
|
||||||
cmd.Parameters.AddWithValue("$TargetKind", message.Code.Target);
|
|
||||||
cmd.Parameters.AddWithValue("$Sender", MessagePackSerializer.Serialize(message.Sender, MsgPackOptions));
|
|
||||||
cmd.Parameters.AddWithValue("$Content", MessagePackSerializer.Serialize(message.Content, MsgPackOptions));
|
|
||||||
cmd.Parameters.AddWithValue("$SenderSource", MessagePackSerializer.Serialize(message.SenderSource, MsgPackOptions));
|
|
||||||
cmd.Parameters.AddWithValue("$ContentSource", MessagePackSerializer.Serialize(message.ContentSource, MsgPackOptions));
|
|
||||||
cmd.Parameters.AddWithValue("$ExtraChatChannel", message.ExtraChatChannel);
|
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Streams messages for export. Optional filters:
|
|
||||||
/// - <paramref name="chatTypes"/>: limit to these ChatTypes
|
|
||||||
/// - <paramref name="from"/> / <paramref name="to"/>: inclusive date range
|
|
||||||
/// Result is sorted ascending by Date and excludes soft-deleted rows.
|
|
||||||
/// Caller is responsible for disposing the enumerator.
|
|
||||||
/// </summary>
|
|
||||||
internal MessageEnumerator StreamForExport(
|
|
||||||
IReadOnlyCollection<int>? chatTypes,
|
|
||||||
DateTimeOffset? from,
|
|
||||||
DateTimeOffset? to)
|
|
||||||
{
|
|
||||||
var cmd = Connection.CreateCommand();
|
|
||||||
|
|
||||||
var clauses = new List<string> { "deleted = false" };
|
|
||||||
if (chatTypes is { Count: > 0 })
|
|
||||||
clauses.Add($"ChatType IN ({BindIntList(cmd, "exct", chatTypes)})");
|
|
||||||
if (from is not null)
|
|
||||||
clauses.Add("Date >= $From");
|
|
||||||
if (to is not null)
|
|
||||||
clauses.Add("Date <= $To");
|
|
||||||
|
|
||||||
cmd.CommandText = @"
|
|
||||||
SELECT
|
|
||||||
Id,
|
|
||||||
Receiver,
|
|
||||||
ContentId,
|
|
||||||
Date,
|
|
||||||
ChatType,
|
|
||||||
SourceKind,
|
|
||||||
TargetKind,
|
|
||||||
Sender,
|
|
||||||
Content,
|
|
||||||
SenderSource,
|
|
||||||
ContentSource,
|
|
||||||
ExtraChatChannel
|
|
||||||
FROM messages
|
|
||||||
WHERE " + string.Join(" AND ", clauses) + @"
|
|
||||||
ORDER BY Date ASC;";
|
|
||||||
cmd.CommandTimeout = 600;
|
|
||||||
|
|
||||||
if (from is not null)
|
|
||||||
cmd.Parameters.AddWithValue("$From", from.Value.ToUnixTimeMilliseconds());
|
|
||||||
if (to is not null)
|
|
||||||
cmd.Parameters.AddWithValue("$To", to.Value.ToUnixTimeMilliseconds());
|
|
||||||
|
|
||||||
return new MessageEnumerator(cmd.ExecuteReader());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the most recent messages.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="receiver">The receiver content ID to filter by. If null, no filtering is performed.</param>
|
|
||||||
/// <param name="since">Only show messages since this date. If null, no filtering is performed.</param>
|
|
||||||
/// <param name="count">The amount to return. Defaults to 10,000.</param>
|
|
||||||
internal MessageEnumerator GetMostRecentMessages(ulong? receiver = null, DateTimeOffset? since = null, int count = MessageQueryLimit)
|
|
||||||
{
|
|
||||||
List<string> whereClauses = ["deleted = false"];
|
|
||||||
if (receiver != null)
|
|
||||||
whereClauses.Add("Receiver = $Receiver");
|
|
||||||
if (since != null)
|
|
||||||
whereClauses.Add("Date >= $Since");
|
|
||||||
|
|
||||||
var whereClause = "WHERE " + string.Join(" AND ", whereClauses);
|
|
||||||
|
|
||||||
var cmd = Connection.CreateCommand();
|
|
||||||
// Select last N messages by date DESC, but reverse the order to get
|
|
||||||
// them in ascending order.
|
|
||||||
cmd.CommandText = @"
|
|
||||||
SELECT *
|
|
||||||
FROM (
|
|
||||||
SELECT
|
|
||||||
Id,
|
|
||||||
Receiver,
|
|
||||||
ContentId,
|
|
||||||
Date,
|
|
||||||
ChatType,
|
|
||||||
SourceKind,
|
|
||||||
TargetKind,
|
|
||||||
Sender,
|
|
||||||
Content,
|
|
||||||
SenderSource,
|
|
||||||
ContentSource,
|
|
||||||
ExtraChatChannel
|
|
||||||
FROM messages
|
|
||||||
" + whereClause + @"
|
|
||||||
ORDER BY Date DESC
|
|
||||||
LIMIT $Count
|
|
||||||
)
|
|
||||||
ORDER BY Date ASC;
|
|
||||||
";
|
|
||||||
cmd.CommandTimeout = 120; // this could take a while on slow computers
|
|
||||||
|
|
||||||
if (receiver != null)
|
|
||||||
cmd.Parameters.AddWithValue("$Receiver", receiver);
|
|
||||||
if (since != null)
|
|
||||||
cmd.Parameters.AddWithValue("$Since", since.Value.ToUnixTimeMilliseconds());
|
|
||||||
|
|
||||||
cmd.Parameters.AddWithValue("$Count", count);
|
|
||||||
|
|
||||||
return new MessageEnumerator(cmd.ExecuteReader());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Hellion Chat — Auto-Tell-Tabs history preload.
|
|
||||||
///
|
|
||||||
/// Returns up to <paramref name="limit"/> tells exchanged with the named
|
|
||||||
/// player, oldest-first, ready to be added to a freshly spawned auto
|
|
||||||
/// tell tab. The Sender column is a serialized chunk blob, so SQL on its
|
|
||||||
/// own cannot filter by player identity; we narrow with SQL on Receiver
|
|
||||||
/// + ChatType (cheap, indexed) and let the client do the final
|
|
||||||
/// PlayerPayload comparison on the result set.
|
|
||||||
///
|
|
||||||
/// <paramref name="sqlScanLimit"/> caps how many recent tells we scan
|
|
||||||
/// before giving up. 500 covers around 10 days for an active greeter
|
|
||||||
/// and stays well under the 20 ms budget required to keep the spawn on
|
|
||||||
/// the message-processing worker thread.
|
|
||||||
/// </summary>
|
|
||||||
internal IReadOnlyList<Message> GetTellHistoryWithSender(
|
|
||||||
ulong receiver,
|
|
||||||
string senderName,
|
|
||||||
uint senderWorld,
|
|
||||||
int limit,
|
|
||||||
int sqlScanLimit = 500)
|
|
||||||
{
|
|
||||||
if (limit <= 0)
|
|
||||||
{
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
using var cmd = Connection.CreateCommand();
|
|
||||||
cmd.CommandText = @"
|
|
||||||
SELECT
|
|
||||||
Id,
|
|
||||||
Receiver,
|
|
||||||
ContentId,
|
|
||||||
Date,
|
|
||||||
ChatType,
|
|
||||||
SourceKind,
|
|
||||||
TargetKind,
|
|
||||||
Sender,
|
|
||||||
Content,
|
|
||||||
SenderSource,
|
|
||||||
ContentSource,
|
|
||||||
ExtraChatChannel
|
|
||||||
FROM messages
|
|
||||||
WHERE deleted = false
|
|
||||||
AND Receiver = $Receiver
|
|
||||||
AND ChatType IN ($TellIncoming, $TellOutgoing)
|
|
||||||
ORDER BY Date DESC
|
|
||||||
LIMIT $ScanLimit;
|
|
||||||
";
|
|
||||||
cmd.CommandTimeout = 60;
|
|
||||||
cmd.Parameters.AddWithValue("$Receiver", receiver);
|
|
||||||
cmd.Parameters.AddWithValue("$TellIncoming", (int)ChatType.TellIncoming);
|
|
||||||
cmd.Parameters.AddWithValue("$TellOutgoing", (int)ChatType.TellOutgoing);
|
|
||||||
cmd.Parameters.AddWithValue("$ScanLimit", sqlScanLimit);
|
|
||||||
|
|
||||||
var collected = new List<Message>();
|
|
||||||
using var enumerator = new MessageEnumerator(cmd.ExecuteReader());
|
|
||||||
foreach (var message in enumerator)
|
|
||||||
{
|
|
||||||
if (!ChunkUtil.MatchesSender(message, senderName, senderWorld))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
collected.Add(message);
|
|
||||||
if (collected.Count >= limit)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// SQL was DESC (newest-first) so we hit the limit on the most
|
|
||||||
// recent matching tells. Reverse to oldest-first for chronological
|
|
||||||
// display in the tab.
|
|
||||||
collected.Reverse();
|
|
||||||
return collected;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Marks a message as deleted so it won't get returned in queries.
|
|
||||||
/// </summary>
|
|
||||||
internal void DeleteMessage(Guid id)
|
|
||||||
{
|
|
||||||
using var cmd = Connection.CreateCommand();
|
|
||||||
cmd.CommandText = "UPDATE messages SET Deleted = true WHERE Id = $Id;";
|
|
||||||
cmd.Parameters.AddWithValue("$Id", id);
|
|
||||||
cmd.ExecuteNonQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
internal long CountDateRange(DateTime after, DateTime before, IEnumerable<byte> channels, ulong? receiver = null)
|
|
||||||
{
|
|
||||||
using var cmd = Connection.CreateCommand();
|
|
||||||
|
|
||||||
List<string> whereClauses = ["deleted = false"];
|
|
||||||
if (receiver != null)
|
|
||||||
whereClauses.Add("Receiver = $Receiver");
|
|
||||||
|
|
||||||
whereClauses.Add("Date BETWEEN $After AND $Before");
|
|
||||||
whereClauses.Add($"ChatType IN ({BindIntList(cmd, "cdr", channels.Select(c => (int)c))})");
|
|
||||||
|
|
||||||
var whereClause = "WHERE " + string.Join(" AND ", whereClauses);
|
|
||||||
|
|
||||||
// Select last N messages by date DESC, but reverse the order to get
|
|
||||||
// them in ascending order.
|
|
||||||
cmd.CommandText = @"
|
|
||||||
SELECT COUNT(*)
|
|
||||||
FROM messages
|
|
||||||
" + whereClause;
|
|
||||||
|
|
||||||
if (receiver != null)
|
|
||||||
cmd.Parameters.AddWithValue("$Receiver", receiver);
|
|
||||||
|
|
||||||
cmd.Parameters.AddWithValue("$After", ((DateTimeOffset) after).ToUnixTimeMilliseconds());
|
|
||||||
cmd.Parameters.AddWithValue("$Before", ((DateTimeOffset) before).ToUnixTimeMilliseconds());
|
|
||||||
cmd.CommandTimeout = 120; // this could take a while on slow computers
|
|
||||||
|
|
||||||
return (long) cmd.ExecuteScalar()!;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal MessageEnumerator GetDateRange(DateTime after, DateTime before, IEnumerable<byte> channels, ulong? receiver = null)
|
|
||||||
{
|
|
||||||
var cmd = Connection.CreateCommand();
|
|
||||||
|
|
||||||
List<string> whereClauses = ["deleted = false"];
|
|
||||||
if (receiver != null)
|
|
||||||
whereClauses.Add("Receiver = $Receiver");
|
|
||||||
|
|
||||||
whereClauses.Add("Date BETWEEN $After AND $Before");
|
|
||||||
whereClauses.Add($"ChatType IN ({BindIntList(cmd, "gdr", channels.Select(c => (int)c))})");
|
|
||||||
|
|
||||||
var whereClause = $"WHERE {string.Join(" AND ", whereClauses)}";
|
|
||||||
|
|
||||||
// Select last N messages by date DESC, but reverse the order to get
|
|
||||||
// them in ascending order.
|
|
||||||
cmd.CommandText = @"
|
|
||||||
SELECT
|
|
||||||
Id,
|
|
||||||
Receiver,
|
|
||||||
ContentId,
|
|
||||||
Date,
|
|
||||||
ChatType,
|
|
||||||
SourceKind,
|
|
||||||
TargetKind,
|
|
||||||
Sender,
|
|
||||||
Content,
|
|
||||||
SenderSource,
|
|
||||||
ContentSource,
|
|
||||||
ExtraChatChannel
|
|
||||||
FROM messages
|
|
||||||
" + whereClause;
|
|
||||||
cmd.CommandTimeout = 120; // this could take a while on slow computers
|
|
||||||
|
|
||||||
if (receiver != null)
|
|
||||||
cmd.Parameters.AddWithValue("$Receiver", receiver);
|
|
||||||
|
|
||||||
cmd.Parameters.AddWithValue("$After", ((DateTimeOffset) after).ToUnixTimeMilliseconds());
|
|
||||||
cmd.Parameters.AddWithValue("$Before", ((DateTimeOffset) before).ToUnixTimeMilliseconds());
|
|
||||||
|
|
||||||
return new MessageEnumerator(cmd.ExecuteReader());
|
|
||||||
}
|
|
||||||
|
|
||||||
internal MessageEnumerator GetPagedDateRange(DateTime after, DateTime before, IEnumerable<byte> channels, ulong? receiver = null, int page = 0)
|
|
||||||
{
|
|
||||||
var cmd = Connection.CreateCommand();
|
|
||||||
|
|
||||||
List<string> whereClauses = ["deleted = false"];
|
|
||||||
if (receiver != null)
|
|
||||||
whereClauses.Add("Receiver = $Receiver");
|
|
||||||
|
|
||||||
whereClauses.Add("Date BETWEEN $After AND $Before");
|
|
||||||
whereClauses.Add($"ChatType IN ({BindIntList(cmd, "pdr", channels.Select(c => (int)c))})");
|
|
||||||
|
|
||||||
var whereClause = $"WHERE {string.Join(" AND ", whereClauses)}";
|
|
||||||
|
|
||||||
// Select last N messages by date DESC, but reverse the order to get
|
|
||||||
// them in ascending order.
|
|
||||||
cmd.CommandText = @"
|
|
||||||
SELECT
|
|
||||||
Id,
|
|
||||||
Receiver,
|
|
||||||
ContentId,
|
|
||||||
Date,
|
|
||||||
ChatType,
|
|
||||||
SourceKind,
|
|
||||||
TargetKind,
|
|
||||||
Sender,
|
|
||||||
Content,
|
|
||||||
SenderSource,
|
|
||||||
ContentSource,
|
|
||||||
ExtraChatChannel
|
|
||||||
FROM messages
|
|
||||||
" + whereClause + @"
|
|
||||||
ORDER BY Date
|
|
||||||
LIMIT $Offset, $OffsetCount;
|
|
||||||
";
|
|
||||||
cmd.CommandTimeout = 120; // this could take a while on slow computers
|
|
||||||
|
|
||||||
if (receiver != null)
|
|
||||||
cmd.Parameters.AddWithValue("$Receiver", receiver);
|
|
||||||
|
|
||||||
cmd.Parameters.AddWithValue("$After", ((DateTimeOffset) after).ToUnixTimeMilliseconds());
|
|
||||||
cmd.Parameters.AddWithValue("$Before", ((DateTimeOffset) before).ToUnixTimeMilliseconds());
|
|
||||||
cmd.Parameters.AddWithValue("$Offset", DbViewer.RowPerPage * page);
|
|
||||||
cmd.Parameters.AddWithValue("$OffsetCount", DbViewer.RowPerPage);
|
|
||||||
|
|
||||||
return new MessageEnumerator(cmd.ExecuteReader());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build "$prefix0,$prefix1,..." placeholder list and bind values to
|
|
||||||
// the command. SQLite has no native array parameter, so we generate
|
|
||||||
// the list at runtime and bind each entry under its own name. Used
|
|
||||||
// for IN-clauses and similar dynamic-arity SQL fragments.
|
|
||||||
private static string BindIntList(SqliteCommand cmd, string prefix, IEnumerable<int> values)
|
|
||||||
{
|
|
||||||
var names = new List<string>();
|
|
||||||
var index = 0;
|
|
||||||
foreach (var value in values)
|
|
||||||
{
|
|
||||||
var name = $"${prefix}{index}";
|
|
||||||
cmd.Parameters.AddWithValue(name, value);
|
|
||||||
names.Add(name);
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
return string.Join(",", names);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal class MessageEnumerator(DbDataReader reader) : IEnumerable<Message>, IDisposable, IAsyncDisposable
|
|
||||||
{
|
|
||||||
private const int MaxErrorLogs = 10;
|
|
||||||
|
|
||||||
// FailedIds and FailedCount are separate, because messages might fail to
|
|
||||||
// even parse the ID field.
|
|
||||||
private readonly List<Guid> FailedIds = [];
|
|
||||||
private int FailedCount;
|
|
||||||
public bool DidError => FailedCount > 0;
|
|
||||||
|
|
||||||
public IEnumerator<Message> GetEnumerator()
|
|
||||||
{
|
|
||||||
while (reader.Read())
|
|
||||||
{
|
|
||||||
var id = Guid.Empty;
|
|
||||||
Message msg;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
id = reader.GetGuid(0);
|
|
||||||
msg = new Message(
|
|
||||||
id,
|
|
||||||
(ulong)reader.GetInt64(1),
|
|
||||||
(ulong)reader.GetInt64(2),
|
|
||||||
DateTimeOffset.FromUnixTimeMilliseconds(reader.GetInt64(3)),
|
|
||||||
new ChatCode((byte)reader.GetInt32(4), (byte)reader.GetInt32(5), (byte)reader.GetInt32(6)),
|
|
||||||
MessagePackSerializer.Deserialize<List<Chunk>>(reader.GetFieldValue<byte[]>(7), MessageStore.MsgPackOptions),
|
|
||||||
MessagePackSerializer.Deserialize<List<Chunk>>(reader.GetFieldValue<byte[]>(8), MessageStore.MsgPackOptions),
|
|
||||||
MessagePackSerializer.Deserialize<SeString>(reader.GetFieldValue<byte[]>(9), MessageStore.MsgPackOptions),
|
|
||||||
MessagePackSerializer.Deserialize<SeString>(reader.GetFieldValue<byte[]>(10), MessageStore.MsgPackOptions),
|
|
||||||
reader.GetGuid(11)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
if (FailedCount < MaxErrorLogs)
|
|
||||||
Plugin.Log.Error($"Exception while reading message '{id}' from database: {e}");
|
|
||||||
FailedCount++;
|
|
||||||
if (FailedCount == MaxErrorLogs)
|
|
||||||
Plugin.Log.Error("Further parsing errors will not be logged");
|
|
||||||
if (id != Guid.Empty)
|
|
||||||
FailedIds.Add(id);
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
yield return msg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IEnumerator IEnumerable.GetEnumerator()
|
|
||||||
{
|
|
||||||
return GetEnumerator();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IReadOnlyList<Guid> FailedMessageIds()
|
|
||||||
{
|
|
||||||
return FailedIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
reader.Dispose();
|
|
||||||
}
|
|
||||||
public async ValueTask DisposeAsync()
|
|
||||||
{
|
|
||||||
await reader.DisposeAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,554 +0,0 @@
|
|||||||
using System.Diagnostics;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.IO;
|
|
||||||
using ChatTwo.Ipc;
|
|
||||||
using ChatTwo.Resources;
|
|
||||||
using ChatTwo.Ui;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Game.ClientState.Conditions;
|
|
||||||
using Dalamud.Interface.Windowing;
|
|
||||||
using Dalamud.IoC;
|
|
||||||
using Dalamud.Plugin;
|
|
||||||
using Dalamud.Plugin.Services;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using Dalamud.Interface.ImGuiFileDialog;
|
|
||||||
|
|
||||||
namespace ChatTwo;
|
|
||||||
|
|
||||||
// ReSharper disable once ClassNeverInstantiated.Global
|
|
||||||
public sealed class Plugin : IDalamudPlugin
|
|
||||||
{
|
|
||||||
public const string PluginName = "Hellion Chat";
|
|
||||||
|
|
||||||
[PluginService] public static IPluginLog Log { get; private set; } = null!;
|
|
||||||
[PluginService] public static IDalamudPluginInterface Interface { get; private set; } = null!;
|
|
||||||
[PluginService] public static IChatGui ChatGui { get; private set; } = null!;
|
|
||||||
[PluginService] public static IClientState ClientState { get; private set; } = null!;
|
|
||||||
[PluginService] public static ICommandManager CommandManager { get; private set; } = null!;
|
|
||||||
[PluginService] public static ICondition Condition { get; private set; } = null!;
|
|
||||||
[PluginService] public static IDataManager DataManager { get; private set; } = null!;
|
|
||||||
[PluginService] public static IFramework Framework { get; private set; } = null!;
|
|
||||||
[PluginService] public static IGameGui GameGui { get; private set; } = null!;
|
|
||||||
[PluginService] public static IKeyState KeyState { get; private set; } = null!;
|
|
||||||
[PluginService] public static IObjectTable ObjectTable { get; private set; } = null!;
|
|
||||||
[PluginService] public static IPartyList PartyList { get; private set; } = null!;
|
|
||||||
[PluginService] public static ITargetManager TargetManager { get; private set; } = null!;
|
|
||||||
[PluginService] public static ITextureProvider TextureProvider { get; private set; } = null!;
|
|
||||||
[PluginService] public static IGameInteropProvider GameInteropProvider { get; private set; } = null!;
|
|
||||||
[PluginService] public static IGameConfig GameConfig { get; private set; } = null!;
|
|
||||||
[PluginService] public static INotificationManager Notification { get; private set; } = null!;
|
|
||||||
[PluginService] public static IAddonLifecycle AddonLifecycle { get; private set; } = null!;
|
|
||||||
[PluginService] public static IPlayerState PlayerState { get; private set; } = null!;
|
|
||||||
[PluginService] public static ISeStringEvaluator Evaluator { get; private set; } = null!;
|
|
||||||
|
|
||||||
public static Configuration Config = null!;
|
|
||||||
public static FileDialogManager FileDialogManager { get; private set; } = null!;
|
|
||||||
|
|
||||||
public readonly WindowSystem WindowSystem = new(PluginName);
|
|
||||||
public SettingsWindow SettingsWindow { get; }
|
|
||||||
public ChatLogWindow ChatLogWindow { get; }
|
|
||||||
public DbViewer DbViewer { get; }
|
|
||||||
public InputPreview InputPreview { get; }
|
|
||||||
public CommandHelpWindow CommandHelpWindow { get; }
|
|
||||||
public SeStringDebugger SeStringDebugger { get; }
|
|
||||||
public FirstRunWizard FirstRunWizard { get; }
|
|
||||||
public DebuggerWindow DebuggerWindow { get; }
|
|
||||||
|
|
||||||
internal Commands Commands { get; }
|
|
||||||
internal GameFunctions.GameFunctions Functions { get; }
|
|
||||||
internal MessageManager MessageManager { get; }
|
|
||||||
internal AutoTellTabsService AutoTellTabsService { get; }
|
|
||||||
internal IpcManager Ipc { get; }
|
|
||||||
internal ExtraChat ExtraChat { get; }
|
|
||||||
internal TypingIpc TypingIpc { get; }
|
|
||||||
internal FontManager FontManager { get; }
|
|
||||||
|
|
||||||
internal int DeferredSaveFrames = -1;
|
|
||||||
|
|
||||||
// Serialises retention sweeps. The 24h auto-sweep on plugin load and
|
|
||||||
// the manual button in the Privacy tab both run on background threads;
|
|
||||||
// without this gate, hitting the manual button moments after a fresh
|
|
||||||
// plugin start would launch two sweeps in parallel and the second one
|
|
||||||
// would just re-do work the first one already finished. The lock guards
|
|
||||||
// the flag — the flag check itself bails before we touch the database.
|
|
||||||
// Volatile because the ImGui thread reads the flag outside the lock to
|
|
||||||
// gate the manual button; without it the JIT may cache the value in a
|
|
||||||
// register and miss the background-thread update.
|
|
||||||
internal readonly object RetentionSweepLock = new();
|
|
||||||
internal volatile bool RetentionSweepRunning;
|
|
||||||
|
|
||||||
internal DateTime GameStarted { get; }
|
|
||||||
|
|
||||||
// Tab management needs to happen outside the chatlog window class for access reasons
|
|
||||||
internal int LastTab { get; set; }
|
|
||||||
internal int? WantedTab { get; set; }
|
|
||||||
internal Tab CurrentTab
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var i = LastTab;
|
|
||||||
return i > -1 && i < Config.Tabs.Count ? Config.Tabs[i] : new Tab();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Plugin()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
GameStarted = Process.GetCurrentProcess().StartTime.ToUniversalTime();
|
|
||||||
|
|
||||||
// Hellion Chat: take over config + database from upstream ChatTwo
|
|
||||||
// before Dalamud loads our plugin config. Idempotent: only acts on
|
|
||||||
// the first start where the legacy paths exist and ours don't.
|
|
||||||
MigrateFromChatTwoLayout();
|
|
||||||
|
|
||||||
Config = Interface.GetPluginConfig() as Configuration ?? new Configuration();
|
|
||||||
|
|
||||||
// Hellion Chat — Auto-Tell-Tabs Defense-in-Depth. SaveConfig
|
|
||||||
// already strips temp tabs before persistence, but a previous
|
|
||||||
// crash or external write could have left them in the JSON.
|
|
||||||
// Drop them on load to guarantee the session-only invariant.
|
|
||||||
Config.Tabs.RemoveAll(t => t.IsTempTab);
|
|
||||||
|
|
||||||
// Hellion Chat v9 → v10 — wipes the configuration so the new 8-tab
|
|
||||||
// layout starts from defaults instead of mapping every previous setting
|
|
||||||
// to its new position. Backup-Failure ist non-fatal, der Wipe läuft
|
|
||||||
// trotzdem; dem User fehlt dann nur das manuelle Restore-Sicherheitsnetz.
|
|
||||||
if (Config.Version < 10)
|
|
||||||
{
|
|
||||||
var pluginConfigsDir = Interface.ConfigDirectory.Parent?.FullName;
|
|
||||||
if (pluginConfigsDir is not null)
|
|
||||||
{
|
|
||||||
var liveConfigPath = Path.Combine(pluginConfigsDir, $"{Interface.InternalName}.json");
|
|
||||||
var backupPath = Path.Combine(pluginConfigsDir, $"{Interface.InternalName}.json.pre-v10-backup");
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (File.Exists(liveConfigPath))
|
|
||||||
{
|
|
||||||
File.Copy(liveConfigPath, backupPath, overwrite: true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Log.Warning(ex, "HellionChat: pre-v10 config backup failed");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Config = new Configuration
|
|
||||||
{
|
|
||||||
Version = 10,
|
|
||||||
FirstRunCompleted = true,
|
|
||||||
};
|
|
||||||
SaveConfig();
|
|
||||||
|
|
||||||
Notification.AddNotification(new Dalamud.Interface.ImGuiNotification.Notification
|
|
||||||
{
|
|
||||||
Title = HellionStrings.SettingsRefactor_Migration_Title,
|
|
||||||
Content = HellionStrings.SettingsRefactor_Migration_Content,
|
|
||||||
Type = Dalamud.Interface.ImGuiNotification.NotificationType.Info,
|
|
||||||
InitialDuration = TimeSpan.FromSeconds(25),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hellion default tab layout for first-run and v10-wipe.
|
|
||||||
// General catches player chat plus active gameplay events; the
|
|
||||||
// System tab takes the technical noise so it does not bury real
|
|
||||||
// conversation. Beginner tab only appears when the Novice
|
|
||||||
// Network is enabled in Audio and Notifications, otherwise it
|
|
||||||
// would just sit empty.
|
|
||||||
if (Config.Tabs.Count == 0)
|
|
||||||
{
|
|
||||||
Config.Tabs.Add(TabsUtil.VanillaGeneral);
|
|
||||||
Config.Tabs.Add(TabsUtil.HellionSystem);
|
|
||||||
Config.Tabs.Add(TabsUtil.HellionFreeCompany);
|
|
||||||
Config.Tabs.Add(TabsUtil.HellionParty);
|
|
||||||
if (Config.ShowNoviceNetwork)
|
|
||||||
Config.Tabs.Add(TabsUtil.HellionBeginner);
|
|
||||||
Config.Tabs.Add(TabsUtil.HellionLinkshell);
|
|
||||||
Config.Tabs.Add(TabsUtil.VanillaTellExclusive);
|
|
||||||
}
|
|
||||||
|
|
||||||
LanguageChanged(Interface.UiLanguage);
|
|
||||||
ImGuiUtil.Initialize(this);
|
|
||||||
|
|
||||||
FileDialogManager = new FileDialogManager();
|
|
||||||
|
|
||||||
Commands = new Commands();
|
|
||||||
Functions = new GameFunctions.GameFunctions(this);
|
|
||||||
Ipc = new IpcManager();
|
|
||||||
TypingIpc = new TypingIpc(this);
|
|
||||||
ExtraChat = new ExtraChat();
|
|
||||||
FontManager = new FontManager();
|
|
||||||
|
|
||||||
MessageManager = new MessageManager(this); // Does it require UI?
|
|
||||||
|
|
||||||
// Hellion Chat — Auto-Tell-Tabs service. Subscribes to the
|
|
||||||
// MessageManager's MessageProcessed event for live tells and
|
|
||||||
// to ClientState.Logout for the cleanup pass. Created after
|
|
||||||
// MessageManager so the constructor can hand off the live
|
|
||||||
// store and event source.
|
|
||||||
AutoTellTabsService = new AutoTellTabsService(this, MessageManager, MessageManager.Store);
|
|
||||||
AutoTellTabsService.Initialize();
|
|
||||||
|
|
||||||
// Hellion Chat — daily retention sweep, off-thread so it never
|
|
||||||
// blocks plugin load. Skips itself when disabled or already ran
|
|
||||||
// within the past 24 hours.
|
|
||||||
RunRetentionSweepIfDue();
|
|
||||||
|
|
||||||
ChatLogWindow = new ChatLogWindow(this);
|
|
||||||
SettingsWindow = new SettingsWindow(this);
|
|
||||||
DbViewer = new DbViewer(this);
|
|
||||||
InputPreview = new InputPreview(ChatLogWindow);
|
|
||||||
CommandHelpWindow = new CommandHelpWindow(ChatLogWindow);
|
|
||||||
SeStringDebugger = new SeStringDebugger(this);
|
|
||||||
DebuggerWindow = new DebuggerWindow(this);
|
|
||||||
FirstRunWizard = new FirstRunWizard(this);
|
|
||||||
|
|
||||||
WindowSystem.AddWindow(ChatLogWindow);
|
|
||||||
WindowSystem.AddWindow(SettingsWindow);
|
|
||||||
WindowSystem.AddWindow(DbViewer);
|
|
||||||
WindowSystem.AddWindow(InputPreview);
|
|
||||||
WindowSystem.AddWindow(CommandHelpWindow);
|
|
||||||
WindowSystem.AddWindow(SeStringDebugger);
|
|
||||||
WindowSystem.AddWindow(DebuggerWindow);
|
|
||||||
WindowSystem.AddWindow(FirstRunWizard);
|
|
||||||
|
|
||||||
// Open the wizard on a fresh install. Existing ChatTwo users have
|
|
||||||
// FirstRunCompleted set to true by the v6→v7 migration above.
|
|
||||||
if (!Config.FirstRunCompleted)
|
|
||||||
FirstRunWizard.IsOpen = true;
|
|
||||||
|
|
||||||
FontManager.BuildFonts();
|
|
||||||
|
|
||||||
Interface.UiBuilder.DisableCutsceneUiHide = true;
|
|
||||||
Interface.UiBuilder.DisableGposeUiHide = true;
|
|
||||||
|
|
||||||
// let all the other components register, then initialize commands
|
|
||||||
Commands.Initialise();
|
|
||||||
|
|
||||||
if (Interface.Reason is not PluginLoadReason.Boot)
|
|
||||||
MessageManager.FilterAllTabsAsync();
|
|
||||||
|
|
||||||
Framework.Update += FrameworkUpdate;
|
|
||||||
Interface.UiBuilder.Draw += Draw;
|
|
||||||
Interface.LanguageChanged += LanguageChanged;
|
|
||||||
// Hellion Chat — surface a "main UI" entry point so Dalamud's
|
|
||||||
// plugin list shows the Open-Plugin button. Settings is the
|
|
||||||
// most useful landing place; OpenConfigUi is already wired to
|
|
||||||
// the same toggle inside SettingsWindow.
|
|
||||||
Interface.UiBuilder.OpenMainUi += OpenMainUi;
|
|
||||||
|
|
||||||
if (Config.ShowEmotes)
|
|
||||||
_ = EmoteCache.LoadData(); // Fire-and-forget intentional, exceptions are caught inside
|
|
||||||
|
|
||||||
#if !DEBUG
|
|
||||||
// Avoid 300ms hitch when sending first message by preloading the
|
|
||||||
// auto-translate cache. Don't do this in debug because it makes
|
|
||||||
// profiling difficult.
|
|
||||||
AutoTranslate.PreloadCache();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Log.Error(ex, "Plugin load threw an error, turning off plugin");
|
|
||||||
Dispose();
|
|
||||||
|
|
||||||
// Re-throw the exception to fail the plugin load.
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Suppressing this warning because Dispose() is called in Plugin() if the
|
|
||||||
// load fails, so some values may not be initialized.
|
|
||||||
[SuppressMessage("ReSharper", "ConditionalAccessQualifierIsNonNullableAccordingToAPIContract")]
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
Interface.UiBuilder.OpenMainUi -= OpenMainUi;
|
|
||||||
Interface.LanguageChanged -= LanguageChanged;
|
|
||||||
Interface.UiBuilder.Draw -= Draw;
|
|
||||||
Framework.Update -= FrameworkUpdate;
|
|
||||||
GameFunctions.GameFunctions.SetChatInteractable(true);
|
|
||||||
|
|
||||||
WindowSystem?.RemoveAllWindows();
|
|
||||||
ChatLogWindow?.Dispose();
|
|
||||||
DbViewer?.Dispose();
|
|
||||||
InputPreview?.Dispose();
|
|
||||||
SettingsWindow?.Dispose();
|
|
||||||
DebuggerWindow?.Dispose();
|
|
||||||
SeStringDebugger?.Dispose();
|
|
||||||
|
|
||||||
TypingIpc?.Dispose();
|
|
||||||
ExtraChat?.Dispose();
|
|
||||||
Ipc?.Dispose();
|
|
||||||
// Dispose the Auto-Tell-Tabs service before MessageManager so it
|
|
||||||
// can cleanly unsubscribe from the MessageProcessed event before
|
|
||||||
// its source goes away.
|
|
||||||
AutoTellTabsService?.Dispose();
|
|
||||||
MessageManager?.DisposeAsync().AsTask().Wait();
|
|
||||||
Functions?.Dispose();
|
|
||||||
Commands?.Dispose();
|
|
||||||
|
|
||||||
EmoteCache.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void MigrateFromChatTwoLayout()
|
|
||||||
{
|
|
||||||
var pluginConfigsDir = Interface.ConfigDirectory.Parent?.FullName;
|
|
||||||
if (pluginConfigsDir is null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var legacyConfigFile = Path.Combine(pluginConfigsDir, "ChatTwo.json");
|
|
||||||
var legacyConfigDir = Path.Combine(pluginConfigsDir, "ChatTwo");
|
|
||||||
var ourConfigFile = Path.Combine(pluginConfigsDir, "HellionChat.json");
|
|
||||||
var ourConfigDir = Interface.ConfigDirectory.FullName;
|
|
||||||
|
|
||||||
// Track whether anything legitimately blocked us. The most common
|
|
||||||
// cause is upstream Chat 2 still being loaded — its SQLite handle
|
|
||||||
// keeps chat-sqlite.db locked and File.Move throws IOException.
|
|
||||||
var lockedBlocker = false;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (!File.Exists(ourConfigFile) && File.Exists(legacyConfigFile))
|
|
||||||
{
|
|
||||||
File.Move(legacyConfigFile, ourConfigFile);
|
|
||||||
Log.Information($"HellionChat: migrated config file {legacyConfigFile} → {ourConfigFile}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.Warning(e, $"HellionChat: config file move blocked, leaving {legacyConfigFile} in place");
|
|
||||||
lockedBlocker = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The plugin's ConfigDirectory may already exist on first load
|
|
||||||
// (Dalamud creates it), so check at the file level instead of
|
|
||||||
// skipping when the directory is present. Move every legacy
|
|
||||||
// entry whose target name is not occupied yet, then remove the
|
|
||||||
// source dir if it ends up empty. Each move is wrapped on its
|
|
||||||
// own so a single locked file (the SQLite db while ChatTwo still
|
|
||||||
// runs) does not abandon the rest of the migration.
|
|
||||||
if (!Directory.Exists(legacyConfigDir))
|
|
||||||
return;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(ourConfigDir);
|
|
||||||
|
|
||||||
foreach (var file in Directory.EnumerateFiles(legacyConfigDir))
|
|
||||||
{
|
|
||||||
var target = Path.Combine(ourConfigDir, Path.GetFileName(file));
|
|
||||||
if (File.Exists(target))
|
|
||||||
continue;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
File.Move(file, target);
|
|
||||||
Log.Information($"HellionChat: migrated file {file} → {target}");
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.Warning(e, $"HellionChat: file move blocked for {file}, will retry on next load");
|
|
||||||
lockedBlocker = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var dir in Directory.EnumerateDirectories(legacyConfigDir))
|
|
||||||
{
|
|
||||||
var target = Path.Combine(ourConfigDir, Path.GetFileName(dir));
|
|
||||||
if (Directory.Exists(target))
|
|
||||||
continue;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Directory.Move(dir, target);
|
|
||||||
Log.Information($"HellionChat: migrated subdir {dir} → {target}");
|
|
||||||
}
|
|
||||||
catch (IOException e)
|
|
||||||
{
|
|
||||||
Log.Warning(e, $"HellionChat: subdir move blocked for {dir}, will retry on next load");
|
|
||||||
lockedBlocker = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Directory.EnumerateFileSystemEntries(legacyConfigDir).Any())
|
|
||||||
{
|
|
||||||
Directory.Delete(legacyConfigDir);
|
|
||||||
Log.Information($"HellionChat: removed empty legacy dir {legacyConfigDir}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.Error(e, "HellionChat: layout migration failed, continuing with whatever exists");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lockedBlocker)
|
|
||||||
{
|
|
||||||
// Surface the most common cause to the user as a notification
|
|
||||||
// so they don't think Hellion Chat lost their history when in
|
|
||||||
// fact upstream Chat 2 was still holding the database file.
|
|
||||||
Notification.AddNotification(new Dalamud.Interface.ImGuiNotification.Notification
|
|
||||||
{
|
|
||||||
Title = "Hellion Chat",
|
|
||||||
Content = "Could not migrate the Chat 2 database — the file appears to be in use. " +
|
|
||||||
"Disable Chat 2, fully close the game, then start it again. " +
|
|
||||||
"See the README troubleshooting section if the issue persists.",
|
|
||||||
Type = Dalamud.Interface.ImGuiNotification.NotificationType.Warning,
|
|
||||||
InitialDuration = TimeSpan.FromSeconds(30),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OpenMainUi()
|
|
||||||
{
|
|
||||||
// Settings is the most useful landing surface — same target as the
|
|
||||||
// Configure button. SettingsWindow.Toggle is internal and already
|
|
||||||
// wired to OpenConfigUi, so re-using IsOpen keeps both entry points
|
|
||||||
// behaviourally identical.
|
|
||||||
SettingsWindow.IsOpen = !SettingsWindow.IsOpen;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RunRetentionSweepIfDue()
|
|
||||||
{
|
|
||||||
if (!Config.RetentionEnabled)
|
|
||||||
return;
|
|
||||||
if (DateTimeOffset.UtcNow - Config.RetentionLastRunAt < TimeSpan.FromHours(24))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Snapshot the policy so the user can edit settings while we run.
|
|
||||||
// Spec defaults form the baseline; explicit user overrides win.
|
|
||||||
var policy = new Dictionary<int, int>();
|
|
||||||
foreach (var (type, days) in Privacy.PrivacyDefaults.DefaultRetentionDays)
|
|
||||||
policy[(int)(ushort)type] = days;
|
|
||||||
foreach (var (type, days) in Config.RetentionPerChannelDays)
|
|
||||||
policy[(int)(ushort)type] = days;
|
|
||||||
var defaultDays = Config.RetentionDefaultDays;
|
|
||||||
|
|
||||||
new Thread(() =>
|
|
||||||
{
|
|
||||||
// Bail out cheaply if a manual sweep is already in flight; the
|
|
||||||
// lock around the actual work would queue us up otherwise and
|
|
||||||
// we would just re-do whatever the manual run already did.
|
|
||||||
lock (RetentionSweepLock)
|
|
||||||
{
|
|
||||||
if (RetentionSweepRunning)
|
|
||||||
return;
|
|
||||||
RetentionSweepRunning = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var deleted = MessageManager.Store.DeleteByRetentionPolicy(policy, defaultDays);
|
|
||||||
Config.RetentionLastRunAt = DateTimeOffset.UtcNow;
|
|
||||||
SaveConfig();
|
|
||||||
|
|
||||||
if (deleted > 0)
|
|
||||||
{
|
|
||||||
Log.Information($"Retention sweep deleted {deleted} expired messages.");
|
|
||||||
Framework.Run(() =>
|
|
||||||
{
|
|
||||||
MessageManager.ClearAllTabs();
|
|
||||||
MessageManager.FilterAllTabsAsync();
|
|
||||||
}).Wait();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Log.Information("Retention sweep ran, nothing expired.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log.Error(e, "Retention sweep failed");
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
lock (RetentionSweepLock)
|
|
||||||
RetentionSweepRunning = false;
|
|
||||||
}
|
|
||||||
}) { IsBackground = true }.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Draw()
|
|
||||||
{
|
|
||||||
// Hellion theme is pushed once per frame here so every plugin window
|
|
||||||
// (chat log, settings, viewers, wizard, file dialog) renders with
|
|
||||||
// the same palette. Skipping the push leaves the upstream Dalamud
|
|
||||||
// look untouched for users who flipped the toggle off.
|
|
||||||
using IDisposable? _style = Config.HellionThemeEnabled
|
|
||||||
? HellionStyle.PushGlobal(Config.HellionThemeWindowOpacity)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
ChatLogWindow.BeginFrame();
|
|
||||||
|
|
||||||
if (Config.HideInLoadingScreens && Condition[ConditionFlag.BetweenAreas])
|
|
||||||
{
|
|
||||||
ChatLogWindow.FinalizeFrame();
|
|
||||||
TypingIpc.Update();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ChatLogWindow.HideStateCheck();
|
|
||||||
|
|
||||||
Interface.UiBuilder.DisableUserUiHide = !Config.HideWhenUiHidden;
|
|
||||||
ChatLogWindow.DefaultText = ImGui.GetStyle().Colors[(int) ImGuiCol.Text];
|
|
||||||
|
|
||||||
using ((Config.FontsEnabled ? FontManager.RegularFont : FontManager.Axis).Push())
|
|
||||||
WindowSystem.Draw();
|
|
||||||
|
|
||||||
ChatLogWindow.FinalizeFrame();
|
|
||||||
TypingIpc.Update();
|
|
||||||
|
|
||||||
FileDialogManager.Draw();
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void SaveConfig()
|
|
||||||
{
|
|
||||||
// Hellion Chat — Auto-Tell-Tabs are session-only. Strip them out
|
|
||||||
// before serialization so a crash mid-session can never persist
|
|
||||||
// them. We snapshot the full tab list first and restore it after
|
|
||||||
// the save, preserving the user's order and open conversations.
|
|
||||||
var snapshot = Config.Tabs.ToList();
|
|
||||||
Config.Tabs.RemoveAll(t => t.IsTempTab);
|
|
||||||
|
|
||||||
Interface.SavePluginConfig(Config);
|
|
||||||
|
|
||||||
Config.Tabs.Clear();
|
|
||||||
Config.Tabs.AddRange(snapshot);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal void LanguageChanged(string langCode)
|
|
||||||
{
|
|
||||||
var info = Config.LanguageOverride is LanguageOverride.None
|
|
||||||
? new CultureInfo(langCode)
|
|
||||||
: new CultureInfo(Config.LanguageOverride.Code());
|
|
||||||
|
|
||||||
Language.Culture = info;
|
|
||||||
HellionStrings.Culture = info;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static readonly string[] ChatAddonNames =
|
|
||||||
[
|
|
||||||
"ChatLog",
|
|
||||||
"ChatLogPanel_0",
|
|
||||||
"ChatLogPanel_1",
|
|
||||||
"ChatLogPanel_2",
|
|
||||||
"ChatLogPanel_3"
|
|
||||||
];
|
|
||||||
|
|
||||||
private void FrameworkUpdate(IFramework framework)
|
|
||||||
{
|
|
||||||
if (DeferredSaveFrames >= 0 && DeferredSaveFrames-- == 0)
|
|
||||||
SaveConfig();
|
|
||||||
|
|
||||||
if (!Config.HideChat)
|
|
||||||
return;
|
|
||||||
|
|
||||||
foreach (var name in ChatAddonNames)
|
|
||||||
if (GameFunctions.GameFunctions.IsAddonInteractable(name))
|
|
||||||
GameFunctions.GameFunctions.SetAddonInteractable(name, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool InBattle => Condition[ConditionFlag.InCombat];
|
|
||||||
public static bool GposeActive => Condition[ConditionFlag.WatchingCutscene];
|
|
||||||
public static bool CutsceneActive => Condition[ConditionFlag.OccupiedInCutSceneEvent] || Condition[ConditionFlag.WatchingCutscene78];
|
|
||||||
}
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
using ChatTwo.Code;
|
|
||||||
|
|
||||||
namespace ChatTwo.Privacy;
|
|
||||||
|
|
||||||
internal static class PrivacyDefaults
|
|
||||||
{
|
|
||||||
// Privacy-First default whitelist (DSGVO Art. 25 - Privacy by Default).
|
|
||||||
// Only the player's own conversations are persisted out-of-the-box.
|
|
||||||
// Public chat (Say/Shout/Yell), Novice Network, NPC dialogue, system
|
|
||||||
// logs and battle messages are NOT persisted unless the user opts in.
|
|
||||||
internal static readonly IReadOnlySet<ChatType> PrivacyFirstWhitelist = new HashSet<ChatType>
|
|
||||||
{
|
|
||||||
ChatType.TellIncoming,
|
|
||||||
ChatType.TellOutgoing,
|
|
||||||
ChatType.Party,
|
|
||||||
ChatType.CrossParty,
|
|
||||||
ChatType.Alliance,
|
|
||||||
ChatType.FreeCompany,
|
|
||||||
ChatType.Linkshell1,
|
|
||||||
ChatType.Linkshell2,
|
|
||||||
ChatType.Linkshell3,
|
|
||||||
ChatType.Linkshell4,
|
|
||||||
ChatType.Linkshell5,
|
|
||||||
ChatType.Linkshell6,
|
|
||||||
ChatType.Linkshell7,
|
|
||||||
ChatType.Linkshell8,
|
|
||||||
ChatType.CrossLinkshell1,
|
|
||||||
ChatType.CrossLinkshell2,
|
|
||||||
ChatType.CrossLinkshell3,
|
|
||||||
ChatType.CrossLinkshell4,
|
|
||||||
ChatType.CrossLinkshell5,
|
|
||||||
ChatType.CrossLinkshell6,
|
|
||||||
ChatType.CrossLinkshell7,
|
|
||||||
ChatType.CrossLinkshell8,
|
|
||||||
ChatType.ExtraChatLinkshell1,
|
|
||||||
ChatType.ExtraChatLinkshell2,
|
|
||||||
ChatType.ExtraChatLinkshell3,
|
|
||||||
ChatType.ExtraChatLinkshell4,
|
|
||||||
ChatType.ExtraChatLinkshell5,
|
|
||||||
ChatType.ExtraChatLinkshell6,
|
|
||||||
ChatType.ExtraChatLinkshell7,
|
|
||||||
ChatType.ExtraChatLinkshell8,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Default retention windows per channel (in days). Channels not listed
|
|
||||||
// here fall back to Configuration.RetentionDefaultDays. Reflects the
|
|
||||||
// design spec: Tells 365, own-conversation channels 90, everything else
|
|
||||||
// shorter via the global default.
|
|
||||||
internal static readonly IReadOnlyDictionary<ChatType, int> DefaultRetentionDays = new Dictionary<ChatType, int>
|
|
||||||
{
|
|
||||||
[ChatType.TellIncoming] = 365,
|
|
||||||
[ChatType.TellOutgoing] = 365,
|
|
||||||
|
|
||||||
[ChatType.Party] = 90,
|
|
||||||
[ChatType.CrossParty] = 90,
|
|
||||||
[ChatType.Alliance] = 90,
|
|
||||||
[ChatType.PvpTeam] = 90,
|
|
||||||
[ChatType.FreeCompany] = 90,
|
|
||||||
|
|
||||||
[ChatType.Linkshell1] = 90,
|
|
||||||
[ChatType.Linkshell2] = 90,
|
|
||||||
[ChatType.Linkshell3] = 90,
|
|
||||||
[ChatType.Linkshell4] = 90,
|
|
||||||
[ChatType.Linkshell5] = 90,
|
|
||||||
[ChatType.Linkshell6] = 90,
|
|
||||||
[ChatType.Linkshell7] = 90,
|
|
||||||
[ChatType.Linkshell8] = 90,
|
|
||||||
|
|
||||||
[ChatType.CrossLinkshell1] = 90,
|
|
||||||
[ChatType.CrossLinkshell2] = 90,
|
|
||||||
[ChatType.CrossLinkshell3] = 90,
|
|
||||||
[ChatType.CrossLinkshell4] = 90,
|
|
||||||
[ChatType.CrossLinkshell5] = 90,
|
|
||||||
[ChatType.CrossLinkshell6] = 90,
|
|
||||||
[ChatType.CrossLinkshell7] = 90,
|
|
||||||
[ChatType.CrossLinkshell8] = 90,
|
|
||||||
|
|
||||||
[ChatType.ExtraChatLinkshell1] = 90,
|
|
||||||
[ChatType.ExtraChatLinkshell2] = 90,
|
|
||||||
[ChatType.ExtraChatLinkshell3] = 90,
|
|
||||||
[ChatType.ExtraChatLinkshell4] = 90,
|
|
||||||
[ChatType.ExtraChatLinkshell5] = 90,
|
|
||||||
[ChatType.ExtraChatLinkshell6] = 90,
|
|
||||||
[ChatType.ExtraChatLinkshell7] = 90,
|
|
||||||
[ChatType.ExtraChatLinkshell8] = 90,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Casual profile = Privacy-First plus public chat (Say/Shout/Yell, both
|
|
||||||
// emote types, Novice Network), kept for a short 24-hour window so the
|
|
||||||
// last RP scene or shout trade is still searchable but third-party data
|
|
||||||
// doesn't accumulate forever.
|
|
||||||
internal static readonly IReadOnlySet<ChatType> CasualWhitelist = new HashSet<ChatType>(PrivacyFirstWhitelist)
|
|
||||||
{
|
|
||||||
ChatType.Say,
|
|
||||||
ChatType.Shout,
|
|
||||||
ChatType.Yell,
|
|
||||||
ChatType.CustomEmote,
|
|
||||||
ChatType.StandardEmote,
|
|
||||||
ChatType.NoviceNetwork,
|
|
||||||
};
|
|
||||||
|
|
||||||
internal static readonly IReadOnlyDictionary<ChatType, int> CasualRetentionOverrides = new Dictionary<ChatType, int>
|
|
||||||
{
|
|
||||||
[ChatType.Say] = 1,
|
|
||||||
[ChatType.Shout] = 1,
|
|
||||||
[ChatType.Yell] = 1,
|
|
||||||
[ChatType.CustomEmote] = 1,
|
|
||||||
[ChatType.StandardEmote] = 1,
|
|
||||||
[ChatType.NoviceNetwork] = 1,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ChatTwo.Tests")]
|
|
||||||
-245
@@ -1,245 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// Hand-maintained strongly-typed accessor for HellionStrings.resx.
|
|
||||||
// Mirrors the layout of Language.Designer.cs so the same Plugin.cs
|
|
||||||
// LanguageChanged handler can update Culture for both classes.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#nullable enable
|
|
||||||
|
|
||||||
namespace ChatTwo.Resources;
|
|
||||||
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute]
|
|
||||||
internal class HellionStrings
|
|
||||||
{
|
|
||||||
private static global::System.Resources.ResourceManager? resourceMan;
|
|
||||||
private static global::System.Globalization.CultureInfo? resourceCulture;
|
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
|
||||||
internal HellionStrings() { }
|
|
||||||
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (resourceMan is null)
|
|
||||||
resourceMan = new global::System.Resources.ResourceManager("ChatTwo.Resources.HellionStrings", typeof(HellionStrings).Assembly);
|
|
||||||
return resourceMan;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
internal static global::System.Globalization.CultureInfo? Culture
|
|
||||||
{
|
|
||||||
get => resourceCulture;
|
|
||||||
set => resourceCulture = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string Get(string key)
|
|
||||||
=> ResourceManager.GetString(key, resourceCulture) ?? key;
|
|
||||||
|
|
||||||
internal static string Privacy_Tab_Title => Get(nameof(Privacy_Tab_Title));
|
|
||||||
internal static string Privacy_FilterEnabled_Name => Get(nameof(Privacy_FilterEnabled_Name));
|
|
||||||
internal static string Privacy_FilterEnabled_Description => Get(nameof(Privacy_FilterEnabled_Description));
|
|
||||||
internal static string Privacy_FilterEnabled_StorageOnly_Help => Get(nameof(Privacy_FilterEnabled_StorageOnly_Help));
|
|
||||||
internal static string Privacy_Filter_Tree_Heading => Get(nameof(Privacy_Filter_Tree_Heading));
|
|
||||||
internal static string Privacy_Whitelist_Help => Get(nameof(Privacy_Whitelist_Help));
|
|
||||||
internal static string Privacy_Preset_PrivacyFirst => Get(nameof(Privacy_Preset_PrivacyFirst));
|
|
||||||
internal static string Privacy_Preset_ClearAll => Get(nameof(Privacy_Preset_ClearAll));
|
|
||||||
internal static string Privacy_Preset_SelectAll => Get(nameof(Privacy_Preset_SelectAll));
|
|
||||||
internal static string Privacy_Group_DirectMessages => Get(nameof(Privacy_Group_DirectMessages));
|
|
||||||
internal static string Privacy_Group_PartyAlliance => Get(nameof(Privacy_Group_PartyAlliance));
|
|
||||||
internal static string Privacy_Group_FreeCompany => Get(nameof(Privacy_Group_FreeCompany));
|
|
||||||
internal static string Privacy_Group_Linkshells => Get(nameof(Privacy_Group_Linkshells));
|
|
||||||
internal static string Privacy_Group_CrossLinkshells => Get(nameof(Privacy_Group_CrossLinkshells));
|
|
||||||
internal static string Privacy_Group_ExtraChat => Get(nameof(Privacy_Group_ExtraChat));
|
|
||||||
internal static string Privacy_Group_PublicChat => Get(nameof(Privacy_Group_PublicChat));
|
|
||||||
internal static string Privacy_Group_SystemLogs => Get(nameof(Privacy_Group_SystemLogs));
|
|
||||||
internal static string Privacy_PersistUnknown_Name => Get(nameof(Privacy_PersistUnknown_Name));
|
|
||||||
internal static string Privacy_PersistUnknown_Description => Get(nameof(Privacy_PersistUnknown_Description));
|
|
||||||
|
|
||||||
internal static string Cleanup_Heading => Get(nameof(Cleanup_Heading));
|
|
||||||
internal static string Cleanup_Help_Intro => Get(nameof(Cleanup_Help_Intro));
|
|
||||||
internal static string Cleanup_Help_SavedNote => Get(nameof(Cleanup_Help_SavedNote));
|
|
||||||
internal static string Cleanup_Preview_Stale => Get(nameof(Cleanup_Preview_Stale));
|
|
||||||
internal static string Retention_Help_SavedNote => Get(nameof(Retention_Help_SavedNote));
|
|
||||||
internal static string Cleanup_RefreshPreview => Get(nameof(Cleanup_RefreshPreview));
|
|
||||||
internal static string Cleanup_NoPreview => Get(nameof(Cleanup_NoPreview));
|
|
||||||
internal static string Cleanup_TotalStored => Get(nameof(Cleanup_TotalStored));
|
|
||||||
internal static string Cleanup_WillKeep => Get(nameof(Cleanup_WillKeep));
|
|
||||||
internal static string Cleanup_WillDelete => Get(nameof(Cleanup_WillDelete));
|
|
||||||
internal static string Cleanup_Breakdown => Get(nameof(Cleanup_Breakdown));
|
|
||||||
internal static string Cleanup_Marker_Keep => Get(nameof(Cleanup_Marker_Keep));
|
|
||||||
internal static string Cleanup_Marker_Delete => Get(nameof(Cleanup_Marker_Delete));
|
|
||||||
internal static string Cleanup_Apply_Label => Get(nameof(Cleanup_Apply_Label));
|
|
||||||
internal static string Cleanup_Apply_Tooltip => Get(nameof(Cleanup_Apply_Tooltip));
|
|
||||||
internal static string Cleanup_Running => Get(nameof(Cleanup_Running));
|
|
||||||
internal static string Cleanup_PreviewError => Get(nameof(Cleanup_PreviewError));
|
|
||||||
internal static string Cleanup_Success => Get(nameof(Cleanup_Success));
|
|
||||||
internal static string Cleanup_Error => Get(nameof(Cleanup_Error));
|
|
||||||
|
|
||||||
internal static string Retention_Heading => Get(nameof(Retention_Heading));
|
|
||||||
internal static string Retention_Enabled_Name => Get(nameof(Retention_Enabled_Name));
|
|
||||||
internal static string Retention_Enabled_Description => Get(nameof(Retention_Enabled_Description));
|
|
||||||
internal static string Retention_Default_Label => Get(nameof(Retention_Default_Label));
|
|
||||||
internal static string Retention_Default_Help => Get(nameof(Retention_Default_Help));
|
|
||||||
internal static string Retention_Reset_Spec => Get(nameof(Retention_Reset_Spec));
|
|
||||||
internal static string Retention_Clear_Overrides => Get(nameof(Retention_Clear_Overrides));
|
|
||||||
internal static string Retention_Tree_Heading => Get(nameof(Retention_Tree_Heading));
|
|
||||||
internal static string Retention_Tag_Override => Get(nameof(Retention_Tag_Override));
|
|
||||||
internal static string Retention_Tag_Spec => Get(nameof(Retention_Tag_Spec));
|
|
||||||
internal static string Retention_Tag_Global => Get(nameof(Retention_Tag_Global));
|
|
||||||
internal static string Retention_Reset_Button => Get(nameof(Retention_Reset_Button));
|
|
||||||
internal static string Retention_Apply_Label => Get(nameof(Retention_Apply_Label));
|
|
||||||
internal static string Retention_Apply_Tooltip => Get(nameof(Retention_Apply_Tooltip));
|
|
||||||
internal static string Retention_Running => Get(nameof(Retention_Running));
|
|
||||||
internal static string Retention_LastRun_Never => Get(nameof(Retention_LastRun_Never));
|
|
||||||
internal static string Retention_LastRun_At => Get(nameof(Retention_LastRun_At));
|
|
||||||
internal static string Retention_Success => Get(nameof(Retention_Success));
|
|
||||||
internal static string Retention_Error => Get(nameof(Retention_Error));
|
|
||||||
|
|
||||||
internal static string Wizard_Title => Get(nameof(Wizard_Title));
|
|
||||||
internal static string Wizard_Intro => Get(nameof(Wizard_Intro));
|
|
||||||
internal static string Wizard_Profile_PrivacyFirst_Heading => Get(nameof(Wizard_Profile_PrivacyFirst_Heading));
|
|
||||||
internal static string Wizard_Profile_PrivacyFirst_Description => Get(nameof(Wizard_Profile_PrivacyFirst_Description));
|
|
||||||
internal static string Wizard_Profile_PrivacyFirst_Apply => Get(nameof(Wizard_Profile_PrivacyFirst_Apply));
|
|
||||||
internal static string Wizard_Profile_Casual_Heading => Get(nameof(Wizard_Profile_Casual_Heading));
|
|
||||||
internal static string Wizard_Profile_Casual_Description => Get(nameof(Wizard_Profile_Casual_Description));
|
|
||||||
internal static string Wizard_Profile_Casual_Apply => Get(nameof(Wizard_Profile_Casual_Apply));
|
|
||||||
internal static string Wizard_Profile_FullHistory_Heading => Get(nameof(Wizard_Profile_FullHistory_Heading));
|
|
||||||
internal static string Wizard_Profile_FullHistory_Description => Get(nameof(Wizard_Profile_FullHistory_Description));
|
|
||||||
internal static string Wizard_Profile_FullHistory_GdprWarning => Get(nameof(Wizard_Profile_FullHistory_GdprWarning));
|
|
||||||
internal static string Wizard_Profile_FullHistory_Apply => Get(nameof(Wizard_Profile_FullHistory_Apply));
|
|
||||||
internal static string Wizard_Reopen_Button => Get(nameof(Wizard_Reopen_Button));
|
|
||||||
|
|
||||||
internal static string Export_Heading => Get(nameof(Export_Heading));
|
|
||||||
internal static string Export_Help => Get(nameof(Export_Help));
|
|
||||||
internal static string Export_Range_Label => Get(nameof(Export_Range_Label));
|
|
||||||
internal static string Export_Sender_Label => Get(nameof(Export_Sender_Label));
|
|
||||||
internal static string Export_Channels_Heading => Get(nameof(Export_Channels_Heading));
|
|
||||||
internal static string Export_Channels_AllOff => Get(nameof(Export_Channels_AllOff));
|
|
||||||
internal static string Export_Format_Label => Get(nameof(Export_Format_Label));
|
|
||||||
internal static string Export_Format_Markdown => Get(nameof(Export_Format_Markdown));
|
|
||||||
internal static string Export_Format_Json => Get(nameof(Export_Format_Json));
|
|
||||||
internal static string Export_Format_Csv => Get(nameof(Export_Format_Csv));
|
|
||||||
internal static string Export_Button => Get(nameof(Export_Button));
|
|
||||||
internal static string Export_Dialog_Title => Get(nameof(Export_Dialog_Title));
|
|
||||||
internal static string Export_Running => Get(nameof(Export_Running));
|
|
||||||
internal static string Export_Success => Get(nameof(Export_Success));
|
|
||||||
internal static string Export_Empty => Get(nameof(Export_Empty));
|
|
||||||
internal static string Export_Error => Get(nameof(Export_Error));
|
|
||||||
|
|
||||||
internal static string Theme_Enabled_Name => Get(nameof(Theme_Enabled_Name));
|
|
||||||
internal static string Theme_Enabled_Description => Get(nameof(Theme_Enabled_Description));
|
|
||||||
internal static string Theme_WindowOpacity_Label => Get(nameof(Theme_WindowOpacity_Label));
|
|
||||||
internal static string Theme_WindowOpacity_Help => Get(nameof(Theme_WindowOpacity_Help));
|
|
||||||
internal static string Theme_UseHellionFont_Name => Get(nameof(Theme_UseHellionFont_Name));
|
|
||||||
internal static string Theme_UseHellionFont_Description => Get(nameof(Theme_UseHellionFont_Description));
|
|
||||||
|
|
||||||
internal static string About_Maintainer_Heading => Get(nameof(About_Maintainer_Heading));
|
|
||||||
internal static string About_Maintainer_Body => Get(nameof(About_Maintainer_Body));
|
|
||||||
internal static string About_Maintainer_Website_Label => Get(nameof(About_Maintainer_Website_Label));
|
|
||||||
internal static string About_Mission_Heading => Get(nameof(About_Mission_Heading));
|
|
||||||
internal static string About_Mission_P1 => Get(nameof(About_Mission_P1));
|
|
||||||
internal static string About_Mission_P2 => Get(nameof(About_Mission_P2));
|
|
||||||
internal static string About_Mission_P3 => Get(nameof(About_Mission_P3));
|
|
||||||
internal static string About_BuiltOn_Heading => Get(nameof(About_BuiltOn_Heading));
|
|
||||||
internal static string About_BuiltOn_P1 => Get(nameof(About_BuiltOn_P1));
|
|
||||||
internal static string About_BuiltOn_P2 => Get(nameof(About_BuiltOn_P2));
|
|
||||||
internal static string About_BuiltOn_Upstream_Label => Get(nameof(About_BuiltOn_Upstream_Label));
|
|
||||||
internal static string About_License_Heading => Get(nameof(About_License_Heading));
|
|
||||||
internal static string About_License_P1 => Get(nameof(About_License_P1));
|
|
||||||
internal static string About_License_P2 => Get(nameof(About_License_P2));
|
|
||||||
internal static string About_License_P3 => Get(nameof(About_License_P3));
|
|
||||||
internal static string About_SE_Heading => Get(nameof(About_SE_Heading));
|
|
||||||
internal static string About_SE_P1 => Get(nameof(About_SE_P1));
|
|
||||||
internal static string About_SE_P2 => Get(nameof(About_SE_P2));
|
|
||||||
internal static string About_Localization_Heading => Get(nameof(About_Localization_Heading));
|
|
||||||
internal static string About_Localization_P1 => Get(nameof(About_Localization_P1));
|
|
||||||
internal static string About_Localization_P2 => Get(nameof(About_Localization_P2));
|
|
||||||
internal static string About_Translators_TreeNode => Get(nameof(About_Translators_TreeNode));
|
|
||||||
|
|
||||||
// Hellion Chat — Auto-Tell-Tabs runtime strings
|
|
||||||
internal static string AutoTellTabs_SectionHeader => Get(nameof(AutoTellTabs_SectionHeader));
|
|
||||||
internal static string AutoTellTabs_HistorySeparator => Get(nameof(AutoTellTabs_HistorySeparator));
|
|
||||||
internal static string AutoTellTabs_HistoryLoadError => Get(nameof(AutoTellTabs_HistoryLoadError));
|
|
||||||
internal static string AutoTellTabs_GreetedTooltip => Get(nameof(AutoTellTabs_GreetedTooltip));
|
|
||||||
internal static string AutoTellTabs_UnGreetedTooltip => Get(nameof(AutoTellTabs_UnGreetedTooltip));
|
|
||||||
|
|
||||||
// Hellion Chat — Auto-Tell-Tabs Chat settings tab
|
|
||||||
internal static string ChatLog_AutoTellTabs_Section_Title => Get(nameof(ChatLog_AutoTellTabs_Section_Title));
|
|
||||||
internal static string ChatLog_AutoTellTabs_Enable_Name => Get(nameof(ChatLog_AutoTellTabs_Enable_Name));
|
|
||||||
internal static string ChatLog_AutoTellTabs_Enable_Description => Get(nameof(ChatLog_AutoTellTabs_Enable_Description));
|
|
||||||
internal static string ChatLog_AutoTellTabs_Limit_Name => Get(nameof(ChatLog_AutoTellTabs_Limit_Name));
|
|
||||||
internal static string ChatLog_AutoTellTabs_Limit_Description => Get(nameof(ChatLog_AutoTellTabs_Limit_Description));
|
|
||||||
internal static string ChatLog_AutoTellTabs_Compact_Name => Get(nameof(ChatLog_AutoTellTabs_Compact_Name));
|
|
||||||
internal static string ChatLog_AutoTellTabs_Compact_Description => Get(nameof(ChatLog_AutoTellTabs_Compact_Description));
|
|
||||||
internal static string ChatLog_AutoTellTabs_GreetedToggle_Name => Get(nameof(ChatLog_AutoTellTabs_GreetedToggle_Name));
|
|
||||||
internal static string ChatLog_AutoTellTabs_GreetedToggle_Description => Get(nameof(ChatLog_AutoTellTabs_GreetedToggle_Description));
|
|
||||||
internal static string ChatLog_AutoTellTabs_PreloadHint => Get(nameof(ChatLog_AutoTellTabs_PreloadHint));
|
|
||||||
internal static string ChatLog_AutoTellTabs_ConflictHint => Get(nameof(ChatLog_AutoTellTabs_ConflictHint));
|
|
||||||
|
|
||||||
// Hellion Chat — Auto-Tell-Tabs Privacy settings tab
|
|
||||||
internal static string Privacy_AutoTellTabs_Section_Title => Get(nameof(Privacy_AutoTellTabs_Section_Title));
|
|
||||||
internal static string Privacy_AutoTellTabs_Preload_Name => Get(nameof(Privacy_AutoTellTabs_Preload_Name));
|
|
||||||
internal static string Privacy_AutoTellTabs_Preload_Description => Get(nameof(Privacy_AutoTellTabs_Preload_Description));
|
|
||||||
internal static string Privacy_AutoTellTabs_Preload_Hint => Get(nameof(Privacy_AutoTellTabs_Preload_Hint));
|
|
||||||
|
|
||||||
// Hellion Chat — Settings UX Polish v10 wipe migration
|
|
||||||
internal static string SettingsRefactor_Migration_Title => Get(nameof(SettingsRefactor_Migration_Title));
|
|
||||||
internal static string SettingsRefactor_Migration_Content => Get(nameof(SettingsRefactor_Migration_Content));
|
|
||||||
|
|
||||||
// Hellion Chat — Settings UX Polish 8-tab structure
|
|
||||||
internal static string Settings_Tab_General => Get(nameof(Settings_Tab_General));
|
|
||||||
internal static string Settings_Tab_Appearance => Get(nameof(Settings_Tab_Appearance));
|
|
||||||
internal static string Settings_Tab_Window => Get(nameof(Settings_Tab_Window));
|
|
||||||
internal static string Settings_Tab_Chat => Get(nameof(Settings_Tab_Chat));
|
|
||||||
internal static string Settings_Tab_Tabs => Get(nameof(Settings_Tab_Tabs));
|
|
||||||
internal static string Settings_Tab_Database => Get(nameof(Settings_Tab_Database));
|
|
||||||
internal static string Settings_Tab_Information => Get(nameof(Settings_Tab_Information));
|
|
||||||
|
|
||||||
// Hellion Chat — General-Tab section headings
|
|
||||||
internal static string Settings_General_Input_Heading => Get(nameof(Settings_General_Input_Heading));
|
|
||||||
internal static string Settings_General_Audio_Heading => Get(nameof(Settings_General_Audio_Heading));
|
|
||||||
internal static string Settings_General_Performance_Heading => Get(nameof(Settings_General_Performance_Heading));
|
|
||||||
internal static string Settings_General_Language_Heading => Get(nameof(Settings_General_Language_Heading));
|
|
||||||
|
|
||||||
// Hellion Chat — Appearance-Tab section headings
|
|
||||||
internal static string Settings_Appearance_Theme_Heading => Get(nameof(Settings_Appearance_Theme_Heading));
|
|
||||||
internal static string Settings_Appearance_Fonts_Heading => Get(nameof(Settings_Appearance_Fonts_Heading));
|
|
||||||
internal static string Settings_Appearance_Colours_Heading => Get(nameof(Settings_Appearance_Colours_Heading));
|
|
||||||
internal static string Settings_Appearance_Timestamps_Heading => Get(nameof(Settings_Appearance_Timestamps_Heading));
|
|
||||||
|
|
||||||
// Hellion Chat — Window-Tab section headings
|
|
||||||
internal static string Settings_Window_Hide_Heading => Get(nameof(Settings_Window_Hide_Heading));
|
|
||||||
internal static string Settings_Window_InactivityHide_Heading => Get(nameof(Settings_Window_InactivityHide_Heading));
|
|
||||||
internal static string Settings_Window_Frame_Heading => Get(nameof(Settings_Window_Frame_Heading));
|
|
||||||
internal static string Settings_Window_Tooltips_Heading => Get(nameof(Settings_Window_Tooltips_Heading));
|
|
||||||
|
|
||||||
// Hellion Chat — Chat-Tab section headings
|
|
||||||
internal static string Settings_Chat_AutoTellTabs_Heading => Get(nameof(Settings_Chat_AutoTellTabs_Heading));
|
|
||||||
internal static string Settings_Chat_Behaviour_Heading => Get(nameof(Settings_Chat_Behaviour_Heading));
|
|
||||||
internal static string Settings_Chat_Preview_Heading => Get(nameof(Settings_Chat_Preview_Heading));
|
|
||||||
internal static string Settings_Chat_Emotes_Heading => Get(nameof(Settings_Chat_Emotes_Heading));
|
|
||||||
|
|
||||||
// Hellion Chat — Database-Tab section headings
|
|
||||||
internal static string Settings_Database_Storage_Heading => Get(nameof(Settings_Database_Storage_Heading));
|
|
||||||
internal static string Settings_Database_Viewer_Heading => Get(nameof(Settings_Database_Viewer_Heading));
|
|
||||||
internal static string Settings_Database_Stats_Heading => Get(nameof(Settings_Database_Stats_Heading));
|
|
||||||
|
|
||||||
// Hellion Chat — Information-Tab section headings
|
|
||||||
internal static string Settings_Information_VersionInfo_Heading => Get(nameof(Settings_Information_VersionInfo_Heading));
|
|
||||||
internal static string Settings_Information_About_Heading => Get(nameof(Settings_Information_About_Heading));
|
|
||||||
internal static string Settings_Information_Changelog_Heading => Get(nameof(Settings_Information_Changelog_Heading));
|
|
||||||
|
|
||||||
// Hellion Chat — Default tab presets (channel-themed)
|
|
||||||
internal static string Tabs_Presets_System => Get(nameof(Tabs_Presets_System));
|
|
||||||
internal static string Tabs_Presets_FreeCompany => Get(nameof(Tabs_Presets_FreeCompany));
|
|
||||||
internal static string Tabs_Presets_Party => Get(nameof(Tabs_Presets_Party));
|
|
||||||
internal static string Tabs_Presets_Beginner => Get(nameof(Tabs_Presets_Beginner));
|
|
||||||
internal static string Tabs_Presets_Linkshell => Get(nameof(Tabs_Presets_Linkshell));
|
|
||||||
internal static string Tabs_Presets_Linkshell_Hint => Get(nameof(Tabs_Presets_Linkshell_Hint));
|
|
||||||
}
|
|
||||||
@@ -1,558 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<data name="Privacy_Tab_Title" xml:space="preserve">
|
|
||||||
<value>Privacy</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_FilterEnabled_Name" xml:space="preserve">
|
|
||||||
<value>Enable privacy filter</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_FilterEnabled_Description" xml:space="preserve">
|
|
||||||
<value>When enabled, only messages from whitelisted channels are persisted to the database. Disabling restores upstream ChatTwo behavior (everything except battle messages is stored).</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_FilterEnabled_StorageOnly_Help" xml:space="preserve">
|
|
||||||
<value>The filter only controls what is written to the local database. The chat log itself keeps showing every message live, disallowed channels just stop being saved. Use the channel hide options in your in-game chat tabs if you want to remove channels from the visible chat.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_Filter_Tree_Heading" xml:space="preserve">
|
|
||||||
<value>Privacy filter and whitelist</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_Whitelist_Help" xml:space="preserve">
|
|
||||||
<value>Pick which channels are stored in the local database. Privacy-First default: only your own conversations. Use the buttons below to apply a preset.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_Preset_PrivacyFirst" xml:space="preserve">
|
|
||||||
<value>Privacy-First (recommended)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_Preset_ClearAll" xml:space="preserve">
|
|
||||||
<value>Clear all</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_Preset_SelectAll" xml:space="preserve">
|
|
||||||
<value>Select all</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_Group_DirectMessages" xml:space="preserve">
|
|
||||||
<value>Direct Messages</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_Group_PartyAlliance" xml:space="preserve">
|
|
||||||
<value>Party & Alliance</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_Group_FreeCompany" xml:space="preserve">
|
|
||||||
<value>Free Company</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_Group_Linkshells" xml:space="preserve">
|
|
||||||
<value>Linkshells</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_Group_CrossLinkshells" xml:space="preserve">
|
|
||||||
<value>Cross-World Linkshells</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_Group_ExtraChat" xml:space="preserve">
|
|
||||||
<value>ExtraChat (Encrypted)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_Group_PublicChat" xml:space="preserve">
|
|
||||||
<value>Public Chat (third-party data)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_Group_SystemLogs" xml:space="preserve">
|
|
||||||
<value>System & Game Logs</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_PersistUnknown_Name" xml:space="preserve">
|
|
||||||
<value>Persist unknown channel types</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_PersistUnknown_Description" xml:space="preserve">
|
|
||||||
<value>Failsafe for ChatTypes added by future FFXIV patches that this plugin does not yet know about. Default OFF (Privacy-First). Turn ON if you want a complete log including future channels.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_Heading" xml:space="preserve">
|
|
||||||
<value>Apply filter to existing database</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_Help_Intro" xml:space="preserve">
|
|
||||||
<value>The privacy filter only applies to new messages. Use the cleanup below to retroactively remove already-stored messages that don't match your saved whitelist.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_Help_SavedNote" xml:space="preserve">
|
|
||||||
<value>Cleanup uses your SAVED whitelist (Plugin.Config), not unsaved edits above. Click Save first if you want to apply your current edits.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Help_SavedNote" xml:space="preserve">
|
|
||||||
<value>The manual sweep uses your SAVED retention policy, not the slider values above. Click Save first if you want the run to apply your current edits.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_Preview_Stale" xml:space="preserve">
|
|
||||||
<value>Preview is out of date — your whitelist has changed since the last refresh. Click Refresh to recalculate.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_RefreshPreview" xml:space="preserve">
|
|
||||||
<value>Refresh preview</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_NoPreview" xml:space="preserve">
|
|
||||||
<value>No preview yet. Click Refresh to compute the impact.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_TotalStored" xml:space="preserve">
|
|
||||||
<value>Total stored messages: {0:N0}</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_WillKeep" xml:space="preserve">
|
|
||||||
<value>Will keep: {0:N0}</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_WillDelete" xml:space="preserve">
|
|
||||||
<value>Will delete: {0:N0}</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_Breakdown" xml:space="preserve">
|
|
||||||
<value>Per-channel breakdown</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_Marker_Keep" xml:space="preserve">
|
|
||||||
<value>[KEEP] </value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_Marker_Delete" xml:space="preserve">
|
|
||||||
<value>[DELETE]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_Apply_Label" xml:space="preserve">
|
|
||||||
<value>Apply current filter to database</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_Apply_Tooltip" xml:space="preserve">
|
|
||||||
<value>Ctrl+Shift: Hard-deletes {0:N0} messages, then runs VACUUM. Cannot be undone.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_Running" xml:space="preserve">
|
|
||||||
<value>Cleanup running in background…</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_PreviewError" xml:space="preserve">
|
|
||||||
<value>Failed to compute cleanup preview, see /xllog</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_Success" xml:space="preserve">
|
|
||||||
<value>Privacy cleanup complete: {0:N0} messages removed.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Cleanup_Error" xml:space="preserve">
|
|
||||||
<value>Privacy cleanup failed, see /xllog</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Heading" xml:space="preserve">
|
|
||||||
<value>Message retention</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Enabled_Name" xml:space="preserve">
|
|
||||||
<value>Auto-delete messages after a per-channel retention window</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Enabled_Description" xml:space="preserve">
|
|
||||||
<value>When enabled, messages older than the configured window are deleted on every plugin start (at most once per 24 hours). Off by default. The plugin never deletes history without your explicit consent.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Default_Label" xml:space="preserve">
|
|
||||||
<value>Default retention (days, 0 = never)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Default_Help" xml:space="preserve">
|
|
||||||
<value>Applies to channels without an explicit override below.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Reset_Spec" xml:space="preserve">
|
|
||||||
<value>Reset overrides to spec defaults</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Clear_Overrides" xml:space="preserve">
|
|
||||||
<value>Clear all overrides</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Tree_Heading" xml:space="preserve">
|
|
||||||
<value>Per-channel retention overrides</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Tag_Override" xml:space="preserve">
|
|
||||||
<value>[override]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Tag_Spec" xml:space="preserve">
|
|
||||||
<value>[spec]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Tag_Global" xml:space="preserve">
|
|
||||||
<value>[global]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Reset_Button" xml:space="preserve">
|
|
||||||
<value>reset</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Apply_Label" xml:space="preserve">
|
|
||||||
<value>Apply retention policy now</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Apply_Tooltip" xml:space="preserve">
|
|
||||||
<value>Ctrl+Shift: runs the retention sweep immediately using the SAVED policy. Save your changes first.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Running" xml:space="preserve">
|
|
||||||
<value>Retention sweep running in background…</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_LastRun_Never" xml:space="preserve">
|
|
||||||
<value>Last run: never</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_LastRun_At" xml:space="preserve">
|
|
||||||
<value>Last run: {0:yyyy-MM-dd HH:mm}</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Success" xml:space="preserve">
|
|
||||||
<value>Retention sweep complete: {0:N0} messages removed.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Retention_Error" xml:space="preserve">
|
|
||||||
<value>Retention sweep failed, see /xllog</value>
|
|
||||||
</data>
|
|
||||||
<data name="Wizard_Title" xml:space="preserve">
|
|
||||||
<value>Hellion Chat — Welcome</value>
|
|
||||||
</data>
|
|
||||||
<data name="Wizard_Intro" xml:space="preserve">
|
|
||||||
<value>Pick a starting profile. You can change anything later under Settings → Privacy.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Wizard_Profile_PrivacyFirst_Heading" xml:space="preserve">
|
|
||||||
<value>Privacy-First (recommended)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Wizard_Profile_PrivacyFirst_Description" xml:space="preserve">
|
|
||||||
<value>Only your own conversations are stored: Tells, Party, FC, Linkshells, Cross-World Linkshells, Alliance and ExtraChat. Public chat, NPC dialogue and system spam are dropped at the storage layer. Retention follows the spec defaults (Tells 365 days, own-conversation channels 90 days).</value>
|
|
||||||
</data>
|
|
||||||
<data name="Wizard_Profile_PrivacyFirst_Apply" xml:space="preserve">
|
|
||||||
<value>Use Privacy-First</value>
|
|
||||||
</data>
|
|
||||||
<data name="Wizard_Profile_Casual_Heading" xml:space="preserve">
|
|
||||||
<value>Casual</value>
|
|
||||||
</data>
|
|
||||||
<data name="Wizard_Profile_Casual_Description" xml:space="preserve">
|
|
||||||
<value>Privacy-First plus a 24-hour window for public chat (Say, Shout, Yell, both emote types, Novice Network). For RP players who want to look up the last scene without keeping public chat forever.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Wizard_Profile_Casual_Apply" xml:space="preserve">
|
|
||||||
<value>Use Casual</value>
|
|
||||||
</data>
|
|
||||||
<data name="Wizard_Profile_FullHistory_Heading" xml:space="preserve">
|
|
||||||
<value>Full History</value>
|
|
||||||
</data>
|
|
||||||
<data name="Wizard_Profile_FullHistory_Description" xml:space="preserve">
|
|
||||||
<value>Disables the privacy filter entirely. Stores everything except battle logs, just like upstream Chat 2. Retention is OFF, history grows forever.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Wizard_Profile_FullHistory_GdprWarning" xml:space="preserve">
|
|
||||||
<value>GDPR notice: storing third-party messages (Say/Shout/Yell of strangers, NPC dialogue with player names, etc.) for an unlimited time may exceed the personal/household exemption (Art. 2(2)(c)). Use this profile only if you have a clear reason to keep the full archive.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Wizard_Profile_FullHistory_Apply" xml:space="preserve">
|
|
||||||
<value>Use Full History</value>
|
|
||||||
</data>
|
|
||||||
<data name="Wizard_Reopen_Button" xml:space="preserve">
|
|
||||||
<value>Show wizard again</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Heading" xml:space="preserve">
|
|
||||||
<value>Export (GDPR Art. 15 — right of access)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Help" xml:space="preserve">
|
|
||||||
<value>Export stored messages to Markdown, JSON or CSV. Use this to fulfil a request for access from someone whose messages you have, or to take your own history with you.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Range_Label" xml:space="preserve">
|
|
||||||
<value>Last X days (0 = all time)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Sender_Label" xml:space="preserve">
|
|
||||||
<value>Sender contains (optional, case-insensitive)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Channels_Heading" xml:space="preserve">
|
|
||||||
<value>Limit to channels</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Channels_AllOff" xml:space="preserve">
|
|
||||||
<value>(none selected = all stored channels)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Format_Label" xml:space="preserve">
|
|
||||||
<value>Format</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Format_Markdown" xml:space="preserve">
|
|
||||||
<value>Markdown</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Format_Json" xml:space="preserve">
|
|
||||||
<value>JSON</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Format_Csv" xml:space="preserve">
|
|
||||||
<value>CSV</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Button" xml:space="preserve">
|
|
||||||
<value>Export to file…</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Dialog_Title" xml:space="preserve">
|
|
||||||
<value>Save export</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Running" xml:space="preserve">
|
|
||||||
<value>Export running in background…</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Success" xml:space="preserve">
|
|
||||||
<value>Export complete: {0:N0} messages written to {1}</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Empty" xml:space="preserve">
|
|
||||||
<value>Export complete: no messages matched the filter.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Export_Error" xml:space="preserve">
|
|
||||||
<value>Export failed, see /xllog</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme_Enabled_Name" xml:space="preserve">
|
|
||||||
<value>Use the Hellion theme across all plugin windows</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme_Enabled_Description" xml:space="preserve">
|
|
||||||
<value>Hellion Online Media palette of Arctic Cyan plus Ember Orange, applied across the chat log, settings, viewers and the wizard. Disable to fall back to the default Dalamud look.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme_WindowOpacity_Label" xml:space="preserve">
|
|
||||||
<value>Window opacity</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme_WindowOpacity_Help" xml:space="preserve">
|
|
||||||
<value>How opaque the plugin panes are. Lower values let the game shine through; form fields and dialogs stay opaque on top so they remain readable.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme_UseHellionFont_Name" xml:space="preserve">
|
|
||||||
<value>Use the bundled Hellion font (Exo 2)</value>
|
|
||||||
</data>
|
|
||||||
<data name="Theme_UseHellionFont_Description" xml:space="preserve">
|
|
||||||
<value>Renders chat and UI in Exo 2 (SIL Open Font License 1.1) which ships with the plugin. Disable to fall back to whatever font you picked under Settings → Fonts.</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<data name="About_Maintainer_Heading" xml:space="preserve">
|
|
||||||
<value>Maintainer</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_Maintainer_Body" xml:space="preserve">
|
|
||||||
<value>I maintain Hellion Chat through Hellion Online Media. The website has the contact details for licensing, legal or business questions.</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_Maintainer_Website_Label" xml:space="preserve">
|
|
||||||
<value>Website:</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<data name="About_Mission_Heading" xml:space="preserve">
|
|
||||||
<value>Why this fork exists</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_Mission_P1" xml:space="preserve">
|
|
||||||
<value>Hellion Chat is not trying to replace Chat 2. Chat 2 ships a complete chat experience with full history available for filtering, search and replay. That default is the right one for most users. This fork takes a different stance: a smaller default footprint, with extra knobs for users who want to keep less third-party chat on disk.</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_Mission_P2" xml:space="preserve">
|
|
||||||
<value>The reason I wanted that narrower default was personal. After two years on Chat 2 my database had grown past two million messages, most of them /say, /shout and /yell from strangers in Limsa. That data is exactly what makes Chat 2's full-history view powerful and most users are happy to keep it. For my own taste I wanted a smaller default. So I built this fork.</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_Mission_P3" xml:space="preserve">
|
|
||||||
<value>I am not chasing a big audience and the fork is not in competition with Chat 2. The code is open under the same EUPL-1.2 licence as the upstream plugin. Infi, Anna or anyone else are welcome to read it, borrow ideas, ask questions, or ignore the project. All three are fine by me.</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<data name="About_BuiltOn_Heading" xml:space="preserve">
|
|
||||||
<value>Built on Chat 2</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_BuiltOn_P1" xml:space="preserve">
|
|
||||||
<value>Hellion Chat is a fork of Chat 2 by Infi and Anna (ascclemens). The chat replacement window, the IPC integration, the rendering engine and the entire storage core come from upstream Chat 2.</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_BuiltOn_P2" xml:space="preserve">
|
|
||||||
<value>The webinterface is the only major piece I removed. It is built for remote access to chat from a second device, which is a different focus than the smaller default footprint this fork is built around. Aligning it with these defaults would have meant a substantial rebuild, so removing it was the cleaner path for this particular fork.</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_BuiltOn_Upstream_Label" xml:space="preserve">
|
|
||||||
<value>Upstream repository:</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<data name="About_License_Heading" xml:space="preserve">
|
|
||||||
<value>License</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_License_P1" xml:space="preserve">
|
|
||||||
<value>Hellion Chat and Chat 2 both ship under the European Union Public Licence v1.2 (EUPL-1.2).</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_License_P2" xml:space="preserve">
|
|
||||||
<value>© 2023 to 2026, the Chat 2 authors (Infi, Anna and the upstream contributors).</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_License_P3" xml:space="preserve">
|
|
||||||
<value>© 2026 Hellion Online Media for the additions made in this fork.</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<data name="About_SE_Heading" xml:space="preserve">
|
|
||||||
<value>FINAL FANTASY XIV disclaimer</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_SE_P1" xml:space="preserve">
|
|
||||||
<value>FINAL FANTASY XIV © SQUARE ENIX CO., LTD. All rights reserved.</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_SE_P2" xml:space="preserve">
|
|
||||||
<value>Hellion Chat is an unofficial, fan-made plugin. It has no affiliation with Square Enix and is not endorsed, sponsored or approved by them.</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<data name="About_Localization_Heading" xml:space="preserve">
|
|
||||||
<value>Localization</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_Localization_P1" xml:space="preserve">
|
|
||||||
<value>The German translations of the Hellion-specific strings come from me. Other languages are not provided yet.</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_Localization_P2" xml:space="preserve">
|
|
||||||
<value>The translator list below covers the upstream Chat 2 strings on Crowdin. Those volunteers translated Chat 2, not the Hellion additions.</value>
|
|
||||||
</data>
|
|
||||||
<data name="About_Translators_TreeNode" xml:space="preserve">
|
|
||||||
<value>Chat 2 community translators (upstream)</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<!-- Hellion Chat — Auto-Tell-Tabs (runtime strings) -->
|
|
||||||
<data name="AutoTellTabs_SectionHeader" xml:space="preserve">
|
|
||||||
<value>Active Tells</value>
|
|
||||||
</data>
|
|
||||||
<data name="AutoTellTabs_HistorySeparator" xml:space="preserve">
|
|
||||||
<value>— Earlier conversations —</value>
|
|
||||||
</data>
|
|
||||||
<data name="AutoTellTabs_HistoryLoadError" xml:space="preserve">
|
|
||||||
<value>History could not be loaded.</value>
|
|
||||||
</data>
|
|
||||||
<data name="AutoTellTabs_GreetedTooltip" xml:space="preserve">
|
|
||||||
<value>Marked as greeted. Click to remove the marker.</value>
|
|
||||||
</data>
|
|
||||||
<data name="AutoTellTabs_UnGreetedTooltip" xml:space="preserve">
|
|
||||||
<value>Mark as greeted.</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<!-- Hellion Chat — Auto-Tell-Tabs (Chat settings tab) -->
|
|
||||||
<data name="ChatLog_AutoTellTabs_Section_Title" xml:space="preserve">
|
|
||||||
<value>Auto-Tell-Tabs</value>
|
|
||||||
</data>
|
|
||||||
<data name="ChatLog_AutoTellTabs_Enable_Name" xml:space="preserve">
|
|
||||||
<value>Open a tab automatically for each tell partner</value>
|
|
||||||
</data>
|
|
||||||
<data name="ChatLog_AutoTellTabs_Enable_Description" xml:space="preserve">
|
|
||||||
<value>When you receive or send a /tell, a temporary tab dedicated to that player is opened automatically. Tabs vanish on logout.</value>
|
|
||||||
</data>
|
|
||||||
<data name="ChatLog_AutoTellTabs_Limit_Name" xml:space="preserve">
|
|
||||||
<value>Maximum number of auto tell tabs</value>
|
|
||||||
</data>
|
|
||||||
<data name="ChatLog_AutoTellTabs_Limit_Description" xml:space="preserve">
|
|
||||||
<value>When the limit is reached, greeted tabs with the oldest activity are dropped first. The change applies on the next /tell.</value>
|
|
||||||
</data>
|
|
||||||
<data name="ChatLog_AutoTellTabs_Compact_Name" xml:space="preserve">
|
|
||||||
<value>Compact display</value>
|
|
||||||
</data>
|
|
||||||
<data name="ChatLog_AutoTellTabs_Compact_Description" xml:space="preserve">
|
|
||||||
<value>Show only a thin separator between persistent tabs and auto tell tabs, without the section header.</value>
|
|
||||||
</data>
|
|
||||||
<data name="ChatLog_AutoTellTabs_GreetedToggle_Name" xml:space="preserve">
|
|
||||||
<value>Show "mark as greeted" button</value>
|
|
||||||
</data>
|
|
||||||
<data name="ChatLog_AutoTellTabs_GreetedToggle_Description" xml:space="preserve">
|
|
||||||
<value>Adds a click-to-toggle button next to each auto tell tab to mark a partner as already greeted, dimming the tab name when set. Useful for club greeters tracking many parallel conversations; off by default.</value>
|
|
||||||
</data>
|
|
||||||
<data name="ChatLog_AutoTellTabs_PreloadHint" xml:space="preserve">
|
|
||||||
<value>The number of preloaded tells is configured in the Privacy tab.</value>
|
|
||||||
</data>
|
|
||||||
<data name="ChatLog_AutoTellTabs_ConflictHint" xml:space="preserve">
|
|
||||||
<value>Heads-up: if XIV Messanger or a similar plugin is suppressing direct messages, turn its "Suppress DMs" option off so Hellion Chat can receive tells and open the auto tabs.</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<!-- Hellion Chat — Auto-Tell-Tabs (Privacy settings tab) -->
|
|
||||||
<data name="Privacy_AutoTellTabs_Section_Title" xml:space="preserve">
|
|
||||||
<value>Tell history in auto tabs</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_AutoTellTabs_Preload_Name" xml:space="preserve">
|
|
||||||
<value>Number of preloaded tells</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_AutoTellTabs_Preload_Description" xml:space="preserve">
|
|
||||||
<value>How many earlier tell messages are loaded from the database when an auto tell tab is opened. 0 disables the preload.</value>
|
|
||||||
</data>
|
|
||||||
<data name="Privacy_AutoTellTabs_Preload_Hint" xml:space="preserve">
|
|
||||||
<value>Only takes effect when auto tell tabs are enabled in the Chat tab.</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<!-- Hellion Chat — Settings UX Polish v10 wipe migration -->
|
|
||||||
<data name="SettingsRefactor_Migration_Title" xml:space="preserve">
|
|
||||||
<value>Settings reorganised</value>
|
|
||||||
</data>
|
|
||||||
<data name="SettingsRefactor_Migration_Content" xml:space="preserve">
|
|
||||||
<value>Hellion Chat 0.5.0 reorganised the settings into themed tabs. Your chat database and your message history stay untouched. Settings have been reset to defaults; if you want to pick a privacy profile again, the reopen button is in the Privacy tab. A backup of your previous config is at HellionChat.json.pre-v10-backup next to the live config file.</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<!-- Hellion Chat — Settings UX Polish 8-tab structure -->
|
|
||||||
<data name="Settings_Tab_General" xml:space="preserve">
|
|
||||||
<value>General</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Tab_Appearance" xml:space="preserve">
|
|
||||||
<value>Appearance</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Tab_Window" xml:space="preserve">
|
|
||||||
<value>Window</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Tab_Chat" xml:space="preserve">
|
|
||||||
<value>Chat</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Tab_Tabs" xml:space="preserve">
|
|
||||||
<value>Tabs</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Tab_Database" xml:space="preserve">
|
|
||||||
<value>Database</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Tab_Information" xml:space="preserve">
|
|
||||||
<value>Information</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<!-- Hellion Chat — General-Tab section headings -->
|
|
||||||
<data name="Settings_General_Input_Heading" xml:space="preserve">
|
|
||||||
<value>Input</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_General_Audio_Heading" xml:space="preserve">
|
|
||||||
<value>Audio & Notifications</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_General_Performance_Heading" xml:space="preserve">
|
|
||||||
<value>Performance</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_General_Language_Heading" xml:space="preserve">
|
|
||||||
<value>Language & Input Helpers</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<!-- Hellion Chat — Appearance-Tab section headings -->
|
|
||||||
<data name="Settings_Appearance_Theme_Heading" xml:space="preserve">
|
|
||||||
<value>Theme</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Appearance_Fonts_Heading" xml:space="preserve">
|
|
||||||
<value>Fonts</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Appearance_Colours_Heading" xml:space="preserve">
|
|
||||||
<value>Chat Colours</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Appearance_Timestamps_Heading" xml:space="preserve">
|
|
||||||
<value>Timestamps</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<!-- Hellion Chat — Window-Tab section headings -->
|
|
||||||
<data name="Settings_Window_Hide_Heading" xml:space="preserve">
|
|
||||||
<value>Hide</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Window_InactivityHide_Heading" xml:space="preserve">
|
|
||||||
<value>Inactivity Hide</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Window_Frame_Heading" xml:space="preserve">
|
|
||||||
<value>Window Frame</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Window_Tooltips_Heading" xml:space="preserve">
|
|
||||||
<value>Tooltips</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<!-- Hellion Chat — Chat-Tab section headings -->
|
|
||||||
<data name="Settings_Chat_AutoTellTabs_Heading" xml:space="preserve">
|
|
||||||
<value>Auto-Tell-Tabs</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Chat_Behaviour_Heading" xml:space="preserve">
|
|
||||||
<value>Message Behaviour</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Chat_Preview_Heading" xml:space="preserve">
|
|
||||||
<value>Preview</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Chat_Emotes_Heading" xml:space="preserve">
|
|
||||||
<value>Emotes</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<!-- Hellion Chat — Database-Tab section headings -->
|
|
||||||
<data name="Settings_Database_Storage_Heading" xml:space="preserve">
|
|
||||||
<value>Storage</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Database_Viewer_Heading" xml:space="preserve">
|
|
||||||
<value>Overview</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Database_Stats_Heading" xml:space="preserve">
|
|
||||||
<value>Maintenance</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<!-- Hellion Chat — Information-Tab section headings -->
|
|
||||||
<data name="Settings_Information_VersionInfo_Heading" xml:space="preserve">
|
|
||||||
<value>Version Info</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Information_About_Heading" xml:space="preserve">
|
|
||||||
<value>About HellionChat</value>
|
|
||||||
</data>
|
|
||||||
<data name="Settings_Information_Changelog_Heading" xml:space="preserve">
|
|
||||||
<value>Changelog</value>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<!-- Hellion Chat — Default tab presets (channel-themed) -->
|
|
||||||
<data name="Tabs_Presets_System" xml:space="preserve">
|
|
||||||
<value>System</value>
|
|
||||||
</data>
|
|
||||||
<data name="Tabs_Presets_FreeCompany" xml:space="preserve">
|
|
||||||
<value>Free Company</value>
|
|
||||||
</data>
|
|
||||||
<data name="Tabs_Presets_Party" xml:space="preserve">
|
|
||||||
<value>Party</value>
|
|
||||||
</data>
|
|
||||||
<data name="Tabs_Presets_Beginner" xml:space="preserve">
|
|
||||||
<value>Beginner</value>
|
|
||||||
</data>
|
|
||||||
<data name="Tabs_Presets_Linkshell" xml:space="preserve">
|
|
||||||
<value>Linkshell</value>
|
|
||||||
</data>
|
|
||||||
<data name="Tabs_Presets_Linkshell_Hint" xml:space="preserve">
|
|
||||||
<value>If you use multiple linkshells, the maintainer recommends one tab per shell for cleaner readability. Duplicate this tab and narrow the channel selection per copy.</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
|
||||||
@@ -1,150 +0,0 @@
|
|||||||
using System.Numerics;
|
|
||||||
using ChatTwo.Code;
|
|
||||||
using ChatTwo.Privacy;
|
|
||||||
using ChatTwo.Resources;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Interface.Windowing;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
|
|
||||||
namespace ChatTwo.Ui;
|
|
||||||
|
|
||||||
public sealed class FirstRunWizard : Window
|
|
||||||
{
|
|
||||||
private readonly Plugin Plugin;
|
|
||||||
|
|
||||||
internal FirstRunWizard(Plugin plugin) : base($"{HellionStrings.Wizard_Title}###hellion-firstrun")
|
|
||||||
{
|
|
||||||
Plugin = plugin;
|
|
||||||
|
|
||||||
Flags = ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoDocking;
|
|
||||||
SizeCondition = ImGuiCond.Appearing;
|
|
||||||
Size = new Vector2(900, 560);
|
|
||||||
SizeConstraints = new WindowSizeConstraints
|
|
||||||
{
|
|
||||||
MinimumSize = new Vector2(720, 480),
|
|
||||||
MaximumSize = new Vector2(float.MaxValue, float.MaxValue),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnClose()
|
|
||||||
{
|
|
||||||
// Closing the wizard without picking anything = the user accepts
|
|
||||||
// whatever defaults are already in place. Mark as complete so we
|
|
||||||
// don't pester them again on the next launch.
|
|
||||||
if (!Plugin.Config.FirstRunCompleted)
|
|
||||||
{
|
|
||||||
Plugin.Config.FirstRunCompleted = true;
|
|
||||||
Plugin.SaveConfig();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Draw()
|
|
||||||
{
|
|
||||||
ImGui.TextWrapped(HellionStrings.Wizard_Intro);
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
var avail = ImGui.GetContentRegionAvail();
|
|
||||||
var cardWidth = (avail.X - ImGui.GetStyle().ItemSpacing.X * 2) / 3f;
|
|
||||||
var cardHeight = avail.Y - ImGui.GetTextLineHeightWithSpacing();
|
|
||||||
|
|
||||||
DrawCard("privacy-first", cardWidth, cardHeight,
|
|
||||||
HellionStrings.Wizard_Profile_PrivacyFirst_Heading,
|
|
||||||
HellionStrings.Wizard_Profile_PrivacyFirst_Description,
|
|
||||||
null,
|
|
||||||
HellionStrings.Wizard_Profile_PrivacyFirst_Apply,
|
|
||||||
ApplyPrivacyFirst);
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
DrawCard("casual", cardWidth, cardHeight,
|
|
||||||
HellionStrings.Wizard_Profile_Casual_Heading,
|
|
||||||
HellionStrings.Wizard_Profile_Casual_Description,
|
|
||||||
null,
|
|
||||||
HellionStrings.Wizard_Profile_Casual_Apply,
|
|
||||||
ApplyCasual);
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
DrawCard("full-history", cardWidth, cardHeight,
|
|
||||||
HellionStrings.Wizard_Profile_FullHistory_Heading,
|
|
||||||
HellionStrings.Wizard_Profile_FullHistory_Description,
|
|
||||||
HellionStrings.Wizard_Profile_FullHistory_GdprWarning,
|
|
||||||
HellionStrings.Wizard_Profile_FullHistory_Apply,
|
|
||||||
ApplyFullHistory);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawCard(string id, float width, float height, string heading, string description, string? warning, string buttonLabel, Action onApply)
|
|
||||||
{
|
|
||||||
using var child = ImRaii.Child($"##wizard-card-{id}", new Vector2(width, height), true);
|
|
||||||
if (!child.Success)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ImGui.TextUnformatted(heading);
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
ImGui.TextWrapped(description);
|
|
||||||
|
|
||||||
if (warning is not null)
|
|
||||||
{
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGuiUtil.WarningText(warning);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Push the button to the bottom of the card.
|
|
||||||
var lineHeight = ImGui.GetFrameHeightWithSpacing();
|
|
||||||
var remaining = ImGui.GetContentRegionAvail().Y - lineHeight;
|
|
||||||
if (remaining > 0)
|
|
||||||
ImGui.Dummy(new Vector2(0, remaining));
|
|
||||||
|
|
||||||
if (ImGui.Button($"{buttonLabel}##{id}", new Vector2(-1, 0)))
|
|
||||||
{
|
|
||||||
onApply();
|
|
||||||
Plugin.Config.FirstRunCompleted = true;
|
|
||||||
Plugin.SaveConfig();
|
|
||||||
IsOpen = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ApplyPrivacyFirst()
|
|
||||||
{
|
|
||||||
Plugin.Config.PrivacyFilterEnabled = true;
|
|
||||||
Plugin.Config.PrivacyPersistChannels = [..PrivacyDefaults.PrivacyFirstWhitelist];
|
|
||||||
Plugin.Config.PrivacyPersistUnknownChannels = false;
|
|
||||||
|
|
||||||
Plugin.Config.RetentionEnabled = true;
|
|
||||||
Plugin.Config.RetentionDefaultDays = 30;
|
|
||||||
Plugin.Config.RetentionPerChannelDays =
|
|
||||||
PrivacyDefaults.DefaultRetentionDays.ToDictionary(p => p.Key, p => p.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ApplyCasual()
|
|
||||||
{
|
|
||||||
Plugin.Config.PrivacyFilterEnabled = true;
|
|
||||||
Plugin.Config.PrivacyPersistChannels = [..PrivacyDefaults.CasualWhitelist];
|
|
||||||
Plugin.Config.PrivacyPersistUnknownChannels = false;
|
|
||||||
|
|
||||||
Plugin.Config.RetentionEnabled = true;
|
|
||||||
Plugin.Config.RetentionDefaultDays = 30;
|
|
||||||
var policy = PrivacyDefaults.DefaultRetentionDays.ToDictionary(p => p.Key, p => p.Value);
|
|
||||||
foreach (var (type, days) in PrivacyDefaults.CasualRetentionOverrides)
|
|
||||||
policy[type] = days;
|
|
||||||
Plugin.Config.RetentionPerChannelDays = policy;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ApplyFullHistory()
|
|
||||||
{
|
|
||||||
// Full history = upstream Chat 2 behavior. Filter off, retention off,
|
|
||||||
// everything (except battle messages, which Chat 2 itself controls)
|
|
||||||
// accumulates indefinitely.
|
|
||||||
Plugin.Config.PrivacyFilterEnabled = false;
|
|
||||||
Plugin.Config.PrivacyPersistUnknownChannels = true;
|
|
||||||
|
|
||||||
Plugin.Config.RetentionEnabled = false;
|
|
||||||
Plugin.Config.RetentionPerChannelDays.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,230 +0,0 @@
|
|||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
|
|
||||||
namespace ChatTwo.Ui;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ImGui style override for Hellion Chat. Industrial HUD palette with three
|
|
||||||
/// distinct accents — cyan-teal as the primary action color, industrial
|
|
||||||
/// amber for active state highlights, slate-violet for title bars and
|
|
||||||
/// active tabs — on a deep-slate frame background with steel borders.
|
|
||||||
///
|
|
||||||
/// Two entry points:
|
|
||||||
/// Push — local color stack, scoped via using-block. Use inside
|
|
||||||
/// Hellion-only surfaces (Privacy tab, first-run wizard).
|
|
||||||
/// PushGlobal — full color + style variable stack. Pushed once per frame
|
|
||||||
/// in Plugin.Draw so every Hellion-rendered window inherits
|
|
||||||
/// the look. Cheap to pop because ImGui keeps its own stack.
|
|
||||||
/// </summary>
|
|
||||||
internal static class HellionStyle
|
|
||||||
{
|
|
||||||
// Encoded as 0xRRGGBBAA, matching ChatTwo convention (see Settings.cs
|
|
||||||
// Ko-fi buttons). RgbaToAbgr handles the byte swap to the format ImGui
|
|
||||||
// expects. Hex values are sourced from the Hellion Online Media brand
|
|
||||||
// guide ("Arctic Cyan + Ember Glow", BRANDING.md in the website repo).
|
|
||||||
|
|
||||||
// Primary — Arctic Cyan, used for every interactive control (buttons,
|
|
||||||
// checks, sliders, separators when hovered). Three brand stages plus a
|
|
||||||
// hover that lifts to brand-color-light and a press that drops to
|
|
||||||
// brand-color-dark.
|
|
||||||
private const uint PrimaryRgba = 0x00BED2FF; // brand-color
|
|
||||||
private const uint PrimaryHoverRgba = 0x4DD9E8FF; // brand-color-light
|
|
||||||
private const uint PrimaryActiveRgba = 0x0097A7FF; // brand-color-dark
|
|
||||||
|
|
||||||
// Identity — brand-color-dark teal for window title bars and the
|
|
||||||
// active tab. Sits visibly below the primary cyan on buttons so the
|
|
||||||
// user sees "where am I" (deep teal) versus "what can I click"
|
|
||||||
// (brand cyan) without leaving the cyan family.
|
|
||||||
private const uint IdentityRgba = 0x0097A7FF; // brand-color-dark
|
|
||||||
private const uint IdentityHoverRgba = 0x4DD9E8FF; // brand-color-light
|
|
||||||
private const uint IdentityDeepRgba = 0x005670FF; // dimmer teal for unfocused-active tab
|
|
||||||
|
|
||||||
// Accent — Ember Orange for warm highlights on grips and scrollbar
|
|
||||||
// pulls. Replaces the previous industrial amber so the plugin matches
|
|
||||||
// the website's CTA palette. AccentActive is reserved for any future
|
|
||||||
// pressed-state on accent surfaces; the current slots only need
|
|
||||||
// AccentRgba and AccentHoverRgba.
|
|
||||||
private const uint AccentRgba = 0xF97316FF; // accent-color
|
|
||||||
private const uint AccentHoverRgba = 0xFB923CFF; // accent-color-light
|
|
||||||
|
|
||||||
// Surfaces — Hellion brand background ladder. Window darkest, frame
|
|
||||||
// hover ladder climbs into surface tones. Matches the website's
|
|
||||||
// background / background-medium / background-light / surface vars.
|
|
||||||
private const uint WindowBgRgba = 0x070B12FF; // background
|
|
||||||
private const uint ChildBgRgba = 0x0C1220FF; // background-medium
|
|
||||||
private const uint PopupBgRgba = 0x0C1220FF; // background-medium
|
|
||||||
private const uint FrameBgRgba = 0x141E30FF; // background-light
|
|
||||||
private const uint FrameBgHoverRgba = 0x1A2538FF; // surface
|
|
||||||
private const uint FrameBgActiveRgba = 0x22303FFF; // surface-hover
|
|
||||||
// Cyan-tinted border — matches website --border-brand (cyan @ 40% α).
|
|
||||||
private const uint BorderRgba = 0x00BED266;
|
|
||||||
private const uint BorderShadowRgba = 0x00000000;
|
|
||||||
|
|
||||||
// Headers / collapsing-headers / tree nodes / selectables — same
|
|
||||||
// surface ladder as frames so panels feel consistent.
|
|
||||||
private const uint HeaderRgba = 0x141E30FF;
|
|
||||||
private const uint HeaderHoverRgba = 0x1A2538FF;
|
|
||||||
private const uint HeaderActiveRgba = 0x22303FFF;
|
|
||||||
|
|
||||||
// Title bars — Identity teal on active so the focused window reads
|
|
||||||
// as "yours" without using accent or primary slots.
|
|
||||||
private const uint TitleBgRgba = 0x070B12FF;
|
|
||||||
private const uint TitleBgActiveRgba = IdentityRgba;
|
|
||||||
private const uint TitleBgCollapsedRgba = 0x05080EFF;
|
|
||||||
|
|
||||||
// Tabs — neutral inactive, Identity-light on hover, Identity teal on
|
|
||||||
// active. Unfocused-active uses the deeper Identity stage so an
|
|
||||||
// unfocused window's active tab still reads but does not pull focus.
|
|
||||||
private const uint TabRgba = 0x141E30FF;
|
|
||||||
private const uint TabHoveredRgba = IdentityHoverRgba;
|
|
||||||
private const uint TabActiveRgba = IdentityRgba;
|
|
||||||
private const uint TabUnfocusedRgba = 0x0C1220FF;
|
|
||||||
private const uint TabUnfocusedActiveRgba = IdentityDeepRgba;
|
|
||||||
|
|
||||||
// Scrollbar — Ember on grab so the pull stands out without competing
|
|
||||||
// with the cyan action buttons. Idle grab is a subtle surface tone,
|
|
||||||
// hover/active climb into accent.
|
|
||||||
private const uint ScrollbarBgRgba = 0x070B12FF;
|
|
||||||
private const uint ScrollbarGrabRgba = 0x22303FFF; // surface-hover
|
|
||||||
private const uint ScrollbarGrabHoveredRgba = AccentHoverRgba;
|
|
||||||
private const uint ScrollbarGrabActiveRgba = AccentRgba;
|
|
||||||
|
|
||||||
// Resize grip — same Ember treatment as the scrollbar.
|
|
||||||
private const uint ResizeGripRgba = 0x141E30FF;
|
|
||||||
private const uint ResizeGripHoveredRgba = AccentHoverRgba;
|
|
||||||
private const uint ResizeGripActiveRgba = AccentRgba;
|
|
||||||
|
|
||||||
// Separator and check mark / slider follow the primary cyan.
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Local color stack for Hellion-only surfaces. Cheap. Use inside a
|
|
||||||
/// `using var _ = HellionStyle.Push();` block.
|
|
||||||
/// </summary>
|
|
||||||
internal static IDisposable Push()
|
|
||||||
{
|
|
||||||
var stack = new StackHandle();
|
|
||||||
stack.PushColor(ImGuiCol.Button, PrimaryRgba);
|
|
||||||
stack.PushColor(ImGuiCol.ButtonHovered, PrimaryHoverRgba);
|
|
||||||
stack.PushColor(ImGuiCol.ButtonActive, PrimaryActiveRgba);
|
|
||||||
stack.PushColor(ImGuiCol.FrameBg, FrameBgRgba);
|
|
||||||
stack.PushColor(ImGuiCol.FrameBgHovered, FrameBgHoverRgba);
|
|
||||||
stack.PushColor(ImGuiCol.FrameBgActive, FrameBgActiveRgba);
|
|
||||||
stack.PushColor(ImGuiCol.Border, BorderRgba);
|
|
||||||
stack.PushColor(ImGuiCol.Header, HeaderRgba);
|
|
||||||
stack.PushColor(ImGuiCol.HeaderHovered, HeaderHoverRgba);
|
|
||||||
stack.PushColor(ImGuiCol.HeaderActive, HeaderActiveRgba);
|
|
||||||
stack.PushColor(ImGuiCol.CheckMark, PrimaryRgba);
|
|
||||||
stack.PushColor(ImGuiCol.SliderGrab, PrimaryRgba);
|
|
||||||
stack.PushColor(ImGuiCol.SliderGrabActive, PrimaryHoverRgba);
|
|
||||||
return stack;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Global color and style-variable stack pushed once per frame in
|
|
||||||
/// Plugin.Draw. Covers every ImGui surface the plugin renders so the
|
|
||||||
/// Hellion look is consistent across upstream and Hellion tabs.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="windowOpacity">Window background alpha (0.5–1.0). Lower
|
|
||||||
/// values let the game shine through the plugin panes.</param>
|
|
||||||
internal static IDisposable PushGlobal(float windowOpacity = 1.0f)
|
|
||||||
{
|
|
||||||
var stack = new StackHandle();
|
|
||||||
|
|
||||||
// Mix the configured opacity into both the outer window and the
|
|
||||||
// inner content child backgrounds — without ChildBg following the
|
|
||||||
// slider the chat log stays opaque inside even when the user
|
|
||||||
// wants to see the game behind it during combat. Form fields and
|
|
||||||
// popups (FrameBg, PopupBg) still stay opaque so input is readable.
|
|
||||||
var alphaByte = (uint)Math.Clamp((int)(windowOpacity * 255f), 0x55, 0xFF);
|
|
||||||
var windowBgWithAlpha = (WindowBgRgba & 0xFFFFFF00u) | alphaByte;
|
|
||||||
var childBgWithAlpha = (ChildBgRgba & 0xFFFFFF00u) | alphaByte;
|
|
||||||
|
|
||||||
// Layout — geometric edges, modest rounding, single-pixel borders.
|
|
||||||
stack.PushStyleVar(ImGuiStyleVar.WindowRounding, 4f);
|
|
||||||
stack.PushStyleVar(ImGuiStyleVar.ChildRounding, 3f);
|
|
||||||
stack.PushStyleVar(ImGuiStyleVar.PopupRounding, 3f);
|
|
||||||
stack.PushStyleVar(ImGuiStyleVar.FrameRounding, 2f);
|
|
||||||
stack.PushStyleVar(ImGuiStyleVar.GrabRounding, 2f);
|
|
||||||
stack.PushStyleVar(ImGuiStyleVar.TabRounding, 2f);
|
|
||||||
stack.PushStyleVar(ImGuiStyleVar.ScrollbarRounding, 2f);
|
|
||||||
stack.PushStyleVar(ImGuiStyleVar.WindowBorderSize, 1f);
|
|
||||||
stack.PushStyleVar(ImGuiStyleVar.FrameBorderSize, 1f);
|
|
||||||
|
|
||||||
// Surfaces.
|
|
||||||
stack.PushColor(ImGuiCol.WindowBg, windowBgWithAlpha);
|
|
||||||
stack.PushColor(ImGuiCol.ChildBg, childBgWithAlpha);
|
|
||||||
stack.PushColor(ImGuiCol.PopupBg, PopupBgRgba);
|
|
||||||
stack.PushColor(ImGuiCol.Border, BorderRgba);
|
|
||||||
stack.PushColor(ImGuiCol.BorderShadow, BorderShadowRgba);
|
|
||||||
|
|
||||||
// Frames (input fields, combos, sliders).
|
|
||||||
stack.PushColor(ImGuiCol.FrameBg, FrameBgRgba);
|
|
||||||
stack.PushColor(ImGuiCol.FrameBgHovered, FrameBgHoverRgba);
|
|
||||||
stack.PushColor(ImGuiCol.FrameBgActive, FrameBgActiveRgba);
|
|
||||||
|
|
||||||
// Title bars — tertiary identity on active.
|
|
||||||
stack.PushColor(ImGuiCol.TitleBg, TitleBgRgba);
|
|
||||||
stack.PushColor(ImGuiCol.TitleBgActive, TitleBgActiveRgba);
|
|
||||||
stack.PushColor(ImGuiCol.TitleBgCollapsed, TitleBgCollapsedRgba);
|
|
||||||
|
|
||||||
// Buttons — primary cyan.
|
|
||||||
stack.PushColor(ImGuiCol.Button, PrimaryRgba);
|
|
||||||
stack.PushColor(ImGuiCol.ButtonHovered, PrimaryHoverRgba);
|
|
||||||
stack.PushColor(ImGuiCol.ButtonActive, PrimaryActiveRgba);
|
|
||||||
|
|
||||||
// Headers / selectables — slate with subtle steps.
|
|
||||||
stack.PushColor(ImGuiCol.Header, HeaderRgba);
|
|
||||||
stack.PushColor(ImGuiCol.HeaderHovered, HeaderHoverRgba);
|
|
||||||
stack.PushColor(ImGuiCol.HeaderActive, HeaderActiveRgba);
|
|
||||||
|
|
||||||
// Tabs — tertiary identity for the active tab.
|
|
||||||
stack.PushColor(ImGuiCol.Tab, TabRgba);
|
|
||||||
stack.PushColor(ImGuiCol.TabHovered, TabHoveredRgba);
|
|
||||||
stack.PushColor(ImGuiCol.TabActive, TabActiveRgba);
|
|
||||||
stack.PushColor(ImGuiCol.TabUnfocused, TabUnfocusedRgba);
|
|
||||||
stack.PushColor(ImGuiCol.TabUnfocusedActive, TabUnfocusedActiveRgba);
|
|
||||||
|
|
||||||
// Scrollbar.
|
|
||||||
stack.PushColor(ImGuiCol.ScrollbarBg, ScrollbarBgRgba);
|
|
||||||
stack.PushColor(ImGuiCol.ScrollbarGrab, ScrollbarGrabRgba);
|
|
||||||
stack.PushColor(ImGuiCol.ScrollbarGrabHovered, ScrollbarGrabHoveredRgba);
|
|
||||||
stack.PushColor(ImGuiCol.ScrollbarGrabActive, ScrollbarGrabActiveRgba);
|
|
||||||
|
|
||||||
// Resize grip — secondary amber on active.
|
|
||||||
stack.PushColor(ImGuiCol.ResizeGrip, ResizeGripRgba);
|
|
||||||
stack.PushColor(ImGuiCol.ResizeGripHovered, ResizeGripHoveredRgba);
|
|
||||||
stack.PushColor(ImGuiCol.ResizeGripActive, ResizeGripActiveRgba);
|
|
||||||
|
|
||||||
// Check mark + slider grab — primary cyan.
|
|
||||||
stack.PushColor(ImGuiCol.CheckMark, PrimaryRgba);
|
|
||||||
stack.PushColor(ImGuiCol.SliderGrab, PrimaryRgba);
|
|
||||||
stack.PushColor(ImGuiCol.SliderGrabActive, PrimaryHoverRgba);
|
|
||||||
|
|
||||||
// Separator — primary cyan when hovered/active so the eye
|
|
||||||
// immediately sees that splitters are interactive.
|
|
||||||
stack.PushColor(ImGuiCol.Separator, BorderRgba);
|
|
||||||
stack.PushColor(ImGuiCol.SeparatorHovered, PrimaryHoverRgba);
|
|
||||||
stack.PushColor(ImGuiCol.SeparatorActive, PrimaryRgba);
|
|
||||||
|
|
||||||
return stack;
|
|
||||||
}
|
|
||||||
|
|
||||||
private sealed class StackHandle : IDisposable
|
|
||||||
{
|
|
||||||
private readonly List<IDisposable> _items = new(64);
|
|
||||||
|
|
||||||
internal void PushColor(ImGuiCol slot, uint rgba)
|
|
||||||
=> _items.Add(ImRaii.PushColor(slot, ColourUtil.RgbaToAbgr(rgba)));
|
|
||||||
|
|
||||||
internal void PushStyleVar(ImGuiStyleVar var, float value)
|
|
||||||
=> _items.Add(ImRaii.PushStyle(var, value));
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
for (var i = _items.Count - 1; i >= 0; i--)
|
|
||||||
_items[i].Dispose();
|
|
||||||
_items.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,162 +0,0 @@
|
|||||||
using System.Numerics;
|
|
||||||
using Dalamud.Interface.Style;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Interface.Windowing;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
|
|
||||||
namespace ChatTwo.Ui;
|
|
||||||
|
|
||||||
internal class Popout : Window
|
|
||||||
{
|
|
||||||
private readonly ChatLogWindow ChatLogWindow;
|
|
||||||
private readonly Tab Tab;
|
|
||||||
private readonly int Idx;
|
|
||||||
|
|
||||||
private long FrameTime; // set every frame
|
|
||||||
private long LastActivityTime = Environment.TickCount64;
|
|
||||||
|
|
||||||
public Popout(ChatLogWindow chatLogWindow, Tab tab, int idx) : base($"{tab.Name}##popout")
|
|
||||||
{
|
|
||||||
ChatLogWindow = chatLogWindow;
|
|
||||||
Tab = tab;
|
|
||||||
Idx = idx;
|
|
||||||
|
|
||||||
Size = new Vector2(350, 350);
|
|
||||||
SizeCondition = ImGuiCond.FirstUseEver;
|
|
||||||
|
|
||||||
IsOpen = true;
|
|
||||||
RespectCloseHotkey = false;
|
|
||||||
DisableWindowSounds = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void PreOpenCheck()
|
|
||||||
{
|
|
||||||
if (!Tab.PopOut)
|
|
||||||
IsOpen = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool DrawConditions()
|
|
||||||
{
|
|
||||||
FrameTime = Environment.TickCount64;
|
|
||||||
if (Tab.IndependentHide ? HideStateCheck() : ChatLogWindow.IsHidden)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!Plugin.Config.HideWhenInactive || (!Plugin.Config.InactivityHideActiveDuringBattle && Plugin.InBattle) || !Tab.UnhideOnActivity)
|
|
||||||
{
|
|
||||||
LastActivityTime = FrameTime;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Activity in the tab, this popout window, or the main chat log window.
|
|
||||||
var lastActivityTime = Math.Max(Tab.LastActivity, LastActivityTime);
|
|
||||||
lastActivityTime = Math.Max(lastActivityTime, ChatLogWindow.LastActivityTime);
|
|
||||||
return FrameTime - lastActivityTime <= 1000 * Plugin.Config.InactivityHideTimeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void PreDraw()
|
|
||||||
{
|
|
||||||
if (Plugin.Config is { OverrideStyle: true, ChosenStyle: not null })
|
|
||||||
StyleModel.GetConfiguredStyles()?.FirstOrDefault(style => style.Name == Plugin.Config.ChosenStyle)?.Push();
|
|
||||||
|
|
||||||
Flags = ImGuiWindowFlags.None;
|
|
||||||
if (!Plugin.Config.ShowPopOutTitleBar)
|
|
||||||
Flags |= ImGuiWindowFlags.NoTitleBar;
|
|
||||||
|
|
||||||
if (!Tab.CanMove)
|
|
||||||
Flags |= ImGuiWindowFlags.NoMove;
|
|
||||||
|
|
||||||
if (!Tab.CanResize)
|
|
||||||
Flags |= ImGuiWindowFlags.NoResize;
|
|
||||||
|
|
||||||
if (!ChatLogWindow.PopOutDocked[Idx])
|
|
||||||
{
|
|
||||||
if (Tab.IndependentOpacity)
|
|
||||||
{
|
|
||||||
BgAlpha = Tab.Opacity / 100f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BgAlpha = Plugin.Config.HellionThemeEnabled
|
|
||||||
? Plugin.Config.HellionThemeWindowOpacity
|
|
||||||
: Plugin.Config.WindowAlpha / 100f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Draw()
|
|
||||||
{
|
|
||||||
using var id = ImRaii.PushId($"popout-{Tab.Identifier}");
|
|
||||||
|
|
||||||
if (!Plugin.Config.ShowPopOutTitleBar)
|
|
||||||
{
|
|
||||||
ImGui.TextUnformatted(Tab.Name);
|
|
||||||
ImGui.Separator();
|
|
||||||
}
|
|
||||||
|
|
||||||
var handler = ChatLogWindow.HandlerLender.Borrow();
|
|
||||||
ChatLogWindow.DrawMessageLog(Tab, handler, ImGui.GetContentRegionAvail().Y, false);
|
|
||||||
|
|
||||||
if (ImGui.IsWindowHovered(ImGuiHoveredFlags.ChildWindows))
|
|
||||||
LastActivityTime = FrameTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void PostDraw()
|
|
||||||
{
|
|
||||||
ChatLogWindow.PopOutDocked[Idx] = ImGui.IsWindowDocked();
|
|
||||||
|
|
||||||
if (Plugin.Config is { OverrideStyle: true, ChosenStyle: not null })
|
|
||||||
StyleModel.GetConfiguredStyles()?.FirstOrDefault(style => style.Name == Plugin.Config.ChosenStyle)?.Pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnClose()
|
|
||||||
{
|
|
||||||
ChatLogWindow.PopOutWindows.Remove(Tab.Identifier);
|
|
||||||
ChatLogWindow.Plugin.WindowSystem.RemoveWindow(this);
|
|
||||||
|
|
||||||
Tab.PopOut = false;
|
|
||||||
ChatLogWindow.Plugin.SaveConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
private enum HideState
|
|
||||||
{
|
|
||||||
None,
|
|
||||||
Cutscene,
|
|
||||||
CutsceneOverride,
|
|
||||||
User,
|
|
||||||
Battle
|
|
||||||
}
|
|
||||||
|
|
||||||
private HideState CurrentHideState = HideState.None;
|
|
||||||
|
|
||||||
private bool HideStateCheck()
|
|
||||||
{
|
|
||||||
// if the chat has no hide state set, and the player has entered battle, we hide chat if they have configured it
|
|
||||||
if (Tab.HideInBattle && CurrentHideState == HideState.None && Plugin.InBattle)
|
|
||||||
CurrentHideState = HideState.Battle;
|
|
||||||
|
|
||||||
// If the chat is hidden because of battle, we reset it here
|
|
||||||
if (CurrentHideState is HideState.Battle && !Plugin.InBattle)
|
|
||||||
CurrentHideState = HideState.None;
|
|
||||||
|
|
||||||
// if the chat has no hide state and in a cutscene, set the hide state to cutscene
|
|
||||||
if (Tab.HideDuringCutscenes && CurrentHideState == HideState.None && (Plugin.CutsceneActive || Plugin.GposeActive))
|
|
||||||
{
|
|
||||||
if (ChatLogWindow.Plugin.Functions.Chat.CheckHideFlags())
|
|
||||||
CurrentHideState = HideState.Cutscene;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if the chat is hidden because of a cutscene and no longer in a cutscene, set the hide state to none
|
|
||||||
if (CurrentHideState is HideState.Cutscene or HideState.CutsceneOverride && !Plugin.CutsceneActive && !Plugin.GposeActive)
|
|
||||||
CurrentHideState = HideState.None;
|
|
||||||
|
|
||||||
// if the chat is hidden because of a cutscene and the chat has been activated, show chat
|
|
||||||
if (CurrentHideState == HideState.Cutscene && ChatLogWindow.Activate)
|
|
||||||
CurrentHideState = HideState.CutsceneOverride;
|
|
||||||
|
|
||||||
// if the user hid the chat and is now activating chat, reset the hide state
|
|
||||||
if (CurrentHideState == HideState.User && ChatLogWindow.Activate)
|
|
||||||
CurrentHideState = HideState.None;
|
|
||||||
|
|
||||||
return CurrentHideState is HideState.Cutscene or HideState.User or HideState.Battle || (Tab.HideWhenNotLoggedIn && !Plugin.ClientState.IsLoggedIn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,326 +0,0 @@
|
|||||||
using System.Globalization;
|
|
||||||
using System.Numerics;
|
|
||||||
using System.Text;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Interface.Windowing;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using Dalamud.Utility;
|
|
||||||
using DalamudPartyFinderPayload = Dalamud.Game.Text.SeStringHandling.Payloads.PartyFinderPayload;
|
|
||||||
|
|
||||||
namespace ChatTwo.Ui;
|
|
||||||
|
|
||||||
public class SeStringDebugger : Window
|
|
||||||
{
|
|
||||||
private readonly Plugin Plugin;
|
|
||||||
|
|
||||||
public SeStringDebugger(Plugin plugin) : base("SeString Debugger###chat2-sestringdebugger")
|
|
||||||
{
|
|
||||||
Plugin = plugin;
|
|
||||||
|
|
||||||
SizeConstraints = new WindowSizeConstraints
|
|
||||||
{
|
|
||||||
MinimumSize = new Vector2(475, 600),
|
|
||||||
MaximumSize = new Vector2(float.MaxValue, float.MaxValue)
|
|
||||||
};
|
|
||||||
|
|
||||||
RespectCloseHotkey = false;
|
|
||||||
DisableWindowSounds = true;
|
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
Plugin.Commands.Register("/hellionSeString", showInHelp: false).Execute += Toggle;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
#if DEBUG
|
|
||||||
Plugin.Commands.Register("/hellionSeString", showInHelp: false).Execute -= Toggle;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Toggle(string _, string __) => Toggle();
|
|
||||||
|
|
||||||
public override void Draw()
|
|
||||||
{
|
|
||||||
if (Plugin.MessageManager.LastMessage.Sender == null)
|
|
||||||
{
|
|
||||||
ImGui.TextUnformatted("Nothing to show");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Make SeString freely selectable through chat
|
|
||||||
ImGui.TextUnformatted("Sender Content");
|
|
||||||
ImGui.Spacing();
|
|
||||||
if (Plugin.MessageManager.LastMessage.Sender != null)
|
|
||||||
ProcessPayloads(Plugin.MessageManager.LastMessage.Sender.Payloads);
|
|
||||||
else
|
|
||||||
ImGui.TextUnformatted("Nothing to show");
|
|
||||||
|
|
||||||
ImGui.TextUnformatted("Message Content");
|
|
||||||
ImGui.Spacing();
|
|
||||||
if (Plugin.MessageManager.LastMessage.Message != null)
|
|
||||||
ProcessPayloads(Plugin.MessageManager.LastMessage.Message.Payloads);
|
|
||||||
else
|
|
||||||
ImGui.TextUnformatted("Nothing to show");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProcessPayloads(List<Payload> payloads)
|
|
||||||
{
|
|
||||||
foreach (var payload in payloads)
|
|
||||||
{
|
|
||||||
switch (payload)
|
|
||||||
{
|
|
||||||
case UIForegroundPayload color:
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Link ForegroundColor", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "Enabled?", color.IsEnabled.ToString() },
|
|
||||||
{ "ColorKey", color.IsEnabled ? color.ColorKey.ToString() : "Color Ended" },
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case MapLinkPayload map:
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Link MapLinkPayload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "Map.RowId", map.Map.RowId.ToString() },
|
|
||||||
{ "Map.PlaceName", map.Map.Value.PlaceName.Value.Name.ToString() },
|
|
||||||
{ "Map.PlaceNameRegion", map.Map.Value.PlaceNameRegion.Value.Name.ToString() },
|
|
||||||
{ "Map.PlaceNameSub", map.Map.Value.PlaceNameSub.Value.Name.ToString() },
|
|
||||||
{ "TerritoryType.RowId", map.TerritoryType.RowId.ToString() },
|
|
||||||
{ "RawX", map.RawX.ToString() },
|
|
||||||
{ "RawY", map.RawY.ToString() },
|
|
||||||
{ "XCoord", map.XCoord.ToString(CultureInfo.InvariantCulture) },
|
|
||||||
{ "YCoord", map.YCoord.ToString(CultureInfo.InvariantCulture) },
|
|
||||||
{ "CoordinateString", map.CoordinateString },
|
|
||||||
{ "DataString", map.DataString },
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case QuestPayload quest:
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Link QuestPayload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "Quest.RowId", quest.Quest.RowId.ToString() },
|
|
||||||
{ "Quest.Name", quest.Quest.Value.Name.ToString() },
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DalamudLinkPayload link:
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Link DalamudLinkPayload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "CommandId", link.CommandId.ToString() },
|
|
||||||
{ "Plugin", link.Plugin },
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case DalamudPartyFinderPayload pf:
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Link PartyFinderPayload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "ListingId", pf.ListingId.ToString() },
|
|
||||||
{ "LinkType", EnumName(pf.LinkType) },
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case PlayerPayload player:
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Link PlayerPayload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "Displayed", player.DisplayedName },
|
|
||||||
{ "Player Name", player.PlayerName },
|
|
||||||
{ "World Name", player.World.Value.Name.ExtractText() },
|
|
||||||
{ "Data", string.Join(" ", player.Encode().Select(b => b.ToString("X2"))) },
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ItemPayload item:
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Link ItemPayload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "ItemId", item.ItemId.ToString() },
|
|
||||||
{ "RawItemId", item.RawItemId.ToString() },
|
|
||||||
{ "Kind", EnumName(item.Kind) },
|
|
||||||
{ "IsHQ", item.IsHQ.ToString() },
|
|
||||||
{ "Item.Name", item.Kind == ItemKind.EventItem ? Sheets.EventItemSheet.GetRow(item.ItemId).Name.ExtractText() : Sheets.ItemSheet.GetRow(item.ItemId).Name.ExtractText() },
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case AutoTranslatePayload at:
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Link AutoTranslatePayload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "Text", at.Text },
|
|
||||||
{ "Key/Group", $"{at.Key}/{at.Group}" },
|
|
||||||
{ "Data", string.Join(" ", at.Encode().Select(b => b.ToString("X2"))) },
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case IconPayload icon:
|
|
||||||
{
|
|
||||||
var found = IconUtil.GfdFileView.TryGetEntry((uint) icon.Icon, out _);
|
|
||||||
RenderMetadataDictionary("Link IconPayload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "Found", found.ToString() },
|
|
||||||
{ "Icon ID", ((uint) icon.Icon).ToString() },
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case RawPayload raw:
|
|
||||||
{
|
|
||||||
var colorPayload = ColorPayload.From(raw.Data);
|
|
||||||
if (colorPayload != null)
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Link ColorPayload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "Unshifted", colorPayload.UnshiftedColor.ToString("X8") },
|
|
||||||
{ "Color", colorPayload.Color.ToString("X8") },
|
|
||||||
{ "Enabled?", colorPayload.Enabled.ToString() },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Link RawPayload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "Data", string.Join(" ", raw.Data.Select(b => b.ToString("X2"))) },
|
|
||||||
{ "Type", EnumName(raw.Type) },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case StatusPayload status:
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Link StatusPayload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "Status.RowId", status.Status.RowId.ToString() },
|
|
||||||
{ "Status.Name", status.Status.Value.Name.ExtractText() },
|
|
||||||
{ "Status.Icon", status.Status.Value.Icon.ToString() }
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case Util.PartyFinderPayload pf:
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Link PartyFinderPayload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "Id", pf.Id.ToString() }
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case AchievementPayload achievement:
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Link AchievementPayload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "Id", achievement.Id.ToString() }
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
var payloadData = payload.Encode();
|
|
||||||
|
|
||||||
var initialByte = payloadData.First();
|
|
||||||
if (initialByte != 0x02)
|
|
||||||
{
|
|
||||||
RenderMetadataDictionary("Text Payload", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "Content", Encoding.UTF8.GetString(payloadData) },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var unknown = new RawPayload(payloadData);
|
|
||||||
RenderMetadataDictionary("Link Unknown", new Dictionary<string, string?>
|
|
||||||
{
|
|
||||||
{ "Unknown", string.Join(" ", unknown.Data.Select(b => b.ToString("X2"))) },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string? EnumName<T>(T? value) where T : Enum
|
|
||||||
{
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
var rawValue = Convert.ChangeType(value, value.GetTypeCode());
|
|
||||||
return (Enum.GetName(value.GetType(), value) ?? "Unknown") + $" ({rawValue})";
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void RenderMetadataDictionary(string name, Dictionary<string, string?> metadata)
|
|
||||||
{
|
|
||||||
var style = ImGui.GetStyle();
|
|
||||||
|
|
||||||
ImGui.Text($"{name}:");
|
|
||||||
using var indent = ImRaii.PushIndent(style.IndentSpacing);
|
|
||||||
using (var table = ImRaii.Table($"##chat2-{name}", 2))
|
|
||||||
{
|
|
||||||
if (!table.Success)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ImGui.TableSetupColumn($"##chat2-{name}-key", ImGuiTableColumnFlags.WidthStretch, 0.4f);
|
|
||||||
ImGui.TableSetupColumn($"##chat2-{name}-value");
|
|
||||||
for (var i = 0; i < metadata.Count; i++)
|
|
||||||
{
|
|
||||||
using var id = ImRaii.PushId(i);
|
|
||||||
|
|
||||||
var (key, value) = metadata.ElementAt(i);
|
|
||||||
ImGui.TableNextColumn();
|
|
||||||
ImGui.Text(key);
|
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
|
||||||
ImGuiTextVisibleWhitespace(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.NewLine();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ImGuiTextVisibleWhitespace replaces leading and trailing whitespace with
|
|
||||||
// visible characters. The extra characters are rendered with a muted font.
|
|
||||||
private static void ImGuiTextVisibleWhitespace(string? original)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(original))
|
|
||||||
{
|
|
||||||
using var pushedColor = ImRaii.PushColor(ImGuiCol.Text, new Vector4(1, 1, 1, 0.5f));
|
|
||||||
ImGui.TextUnformatted(original == null ? "(null)" : "(empty)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var text = original;
|
|
||||||
var start = 0;
|
|
||||||
var end = text.Length;
|
|
||||||
|
|
||||||
using var pushedStyle = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, new Vector2(0, 0));
|
|
||||||
|
|
||||||
while (start < end && char.IsWhiteSpace(text[start]))
|
|
||||||
start++;
|
|
||||||
|
|
||||||
if (start > 0)
|
|
||||||
{
|
|
||||||
using var pushedColor = ImRaii.PushColor(ImGuiCol.Text, new Vector4(1, 1, 1, 0.5f));
|
|
||||||
ImGui.TextWrapped(new string('_', start));
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
}
|
|
||||||
|
|
||||||
while (end > start && char.IsWhiteSpace(text[end - 1]))
|
|
||||||
end--;
|
|
||||||
|
|
||||||
ImGui.TextWrapped(text[start..end]);
|
|
||||||
|
|
||||||
if (end < text.Length)
|
|
||||||
{
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
using var pushedColor = ImRaii.PushColor(ImGuiCol.Text, new Vector4(1, 1, 1, 0.5f));
|
|
||||||
ImGui.TextWrapped(new string('_', text.Length - end));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,184 +0,0 @@
|
|||||||
using System.Numerics;
|
|
||||||
using ChatTwo.Resources;
|
|
||||||
using ChatTwo.Ui.SettingsTabs;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Interface.Windowing;
|
|
||||||
using Dalamud.Utility;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
|
|
||||||
namespace ChatTwo.Ui;
|
|
||||||
|
|
||||||
public sealed class SettingsWindow : Dalamud.Interface.Windowing.Window
|
|
||||||
{
|
|
||||||
private readonly Plugin Plugin;
|
|
||||||
|
|
||||||
private Configuration Mutable { get; }
|
|
||||||
private List<ISettingsTab> Tabs { get; }
|
|
||||||
private int CurrentTab;
|
|
||||||
|
|
||||||
internal SettingsWindow(Plugin plugin) : base($"{Language.Settings_Title.Format(Plugin.PluginName)}###chat2-settings")
|
|
||||||
{
|
|
||||||
Flags = ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse;
|
|
||||||
|
|
||||||
SizeCondition = ImGuiCond.FirstUseEver;
|
|
||||||
SizeConstraints = new WindowSizeConstraints
|
|
||||||
{
|
|
||||||
MinimumSize = new Vector2(475, 600),
|
|
||||||
MaximumSize = new Vector2(float.MaxValue, float.MaxValue)
|
|
||||||
};
|
|
||||||
|
|
||||||
Plugin = plugin;
|
|
||||||
Mutable = new Configuration();
|
|
||||||
|
|
||||||
Tabs =
|
|
||||||
[
|
|
||||||
new General(Plugin, Mutable),
|
|
||||||
new Appearance(Plugin, Mutable),
|
|
||||||
new SettingsTabs.Window(Plugin, Mutable),
|
|
||||||
new Chat(Plugin, Mutable),
|
|
||||||
new SettingsTabs.Tabs(Plugin, Mutable),
|
|
||||||
new SettingsTabs.Privacy(Plugin, Mutable),
|
|
||||||
new Database(Plugin, Mutable),
|
|
||||||
new Information(Mutable),
|
|
||||||
];
|
|
||||||
|
|
||||||
RespectCloseHotkey = false;
|
|
||||||
DisableWindowSounds = true;
|
|
||||||
|
|
||||||
Initialise();
|
|
||||||
|
|
||||||
Plugin.Commands.Register("/hellion", "Perform various actions with Hellion Chat.").Execute += Command;
|
|
||||||
Plugin.Interface.UiBuilder.OpenConfigUi += Toggle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
Plugin.Interface.UiBuilder.OpenConfigUi -= Toggle;
|
|
||||||
Plugin.Commands.Register("/hellion").Execute -= Command;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Command(string command, string args)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(args))
|
|
||||||
Toggle();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Initialise()
|
|
||||||
{
|
|
||||||
Mutable.UpdateFrom(Plugin.Config, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Draw()
|
|
||||||
{
|
|
||||||
if (ImGui.IsWindowAppearing())
|
|
||||||
Initialise();
|
|
||||||
|
|
||||||
using (var table = ImRaii.Table("##chat2-settings-table", 2))
|
|
||||||
{
|
|
||||||
if (table.Success)
|
|
||||||
{
|
|
||||||
ImGui.TableSetupColumn("tab", ImGuiTableColumnFlags.WidthFixed);
|
|
||||||
ImGui.TableSetupColumn("settings", ImGuiTableColumnFlags.WidthStretch);
|
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
|
||||||
|
|
||||||
var changed = false;
|
|
||||||
for (var i = 0; i < Tabs.Count; i++)
|
|
||||||
{
|
|
||||||
if (!ImGui.Selectable($"{Tabs[i].Name}###tab-{i}", CurrentTab == i))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
CurrentTab = i;
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
|
||||||
|
|
||||||
var style = ImGui.GetStyle();
|
|
||||||
var height = ImGui.GetContentRegionAvail().Y - style.FramePadding.Y * 2 - style.ItemSpacing.Y - style.ItemInnerSpacing.Y * 2 - ImGui.CalcTextSize("A").Y;
|
|
||||||
|
|
||||||
using var child = ImRaii.Child("##chat2-settings", new Vector2(-1, height));
|
|
||||||
if (child.Success)
|
|
||||||
Tabs[CurrentTab].Draw(changed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Separator();
|
|
||||||
|
|
||||||
var save = ImGui.Button(Language.Settings_Save);
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
if (ImGui.Button(Language.Settings_SaveAndClose))
|
|
||||||
{
|
|
||||||
save = true;
|
|
||||||
IsOpen = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
if (ImGui.Button(Language.Settings_Discard))
|
|
||||||
{
|
|
||||||
IsOpen = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const string buttonLabel = "Anna's Ko-fi";
|
|
||||||
const string buttonLabel2 = "Infi's Ko-fi";
|
|
||||||
|
|
||||||
using (ImRaii.PushColor(ImGuiCol.Button, ColourUtil.RgbaToAbgr(0xFF5E5BFF)))
|
|
||||||
using (ImRaii.PushColor(ImGuiCol.ButtonHovered, ColourUtil.RgbaToAbgr(0xFF7775FF)))
|
|
||||||
using (ImRaii.PushColor(ImGuiCol.ButtonActive, ColourUtil.RgbaToAbgr(0xFF4542FF)))
|
|
||||||
using (ImRaii.PushColor(ImGuiCol.Text, 0xFFFFFFFF))
|
|
||||||
{
|
|
||||||
var buttonWidth = ImGui.CalcTextSize(buttonLabel).X + ImGui.GetStyle().FramePadding.X * 2;
|
|
||||||
var buttonWidth2 = ImGui.CalcTextSize(buttonLabel2).X + ImGui.GetStyle().FramePadding.X * 2;
|
|
||||||
ImGui.SameLine(ImGui.GetContentRegionAvail().X - buttonWidth - buttonWidth2 - ImGui.GetStyle().ItemSpacing.X);
|
|
||||||
|
|
||||||
if (ImGui.Button(buttonLabel2))
|
|
||||||
Dalamud.Utility.Util.OpenLink("https://ko-fi.com/infiii");
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
if (ImGui.Button(buttonLabel))
|
|
||||||
Dalamud.Utility.Util.OpenLink("https://ko-fi.com/lojewalo");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!save)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// calculate all conditions before updating config
|
|
||||||
var hideChanged = !Mutable.HideChat && Mutable.HideChat != Plugin.Config.HideChat;
|
|
||||||
var languageChanged = Mutable.LanguageOverride != Plugin.Config.LanguageOverride;
|
|
||||||
var fontChanged = Mutable.GlobalFontV2 != Plugin.Config.GlobalFontV2
|
|
||||||
|| Mutable.JapaneseFontV2 != Plugin.Config.JapaneseFontV2
|
|
||||||
|| Mutable.ItalicFontV2 != Plugin.Config.ItalicFontV2
|
|
||||||
|| Mutable.ExtraGlyphRanges != Plugin.Config.ExtraGlyphRanges
|
|
||||||
|| Mutable.UseHellionFont != Plugin.Config.UseHellionFont;
|
|
||||||
var fontSizeChanged = Math.Abs(Mutable.SymbolsFontSizeV2 - Plugin.Config.SymbolsFontSizeV2) > 0.001
|
|
||||||
|| Math.Abs(Mutable.FontSizeV2 - Plugin.Config.FontSizeV2) > 0.001;
|
|
||||||
var italicStateChanged = Mutable.ItalicEnabled != Plugin.Config.ItalicEnabled;
|
|
||||||
|
|
||||||
Plugin.Config.UpdateFrom(Mutable, true);
|
|
||||||
|
|
||||||
// save after 60 frames have passed, which should hopefully not
|
|
||||||
// commit any changes that cause a crash
|
|
||||||
Plugin.DeferredSaveFrames = 60;
|
|
||||||
Plugin.MessageManager.ClearAllTabs();
|
|
||||||
Plugin.MessageManager.FilterAllTabsAsync();
|
|
||||||
|
|
||||||
if (fontChanged || fontSizeChanged || italicStateChanged)
|
|
||||||
Plugin.FontManager.BuildFonts();
|
|
||||||
|
|
||||||
if (languageChanged)
|
|
||||||
Plugin.LanguageChanged(Plugin.Interface.UiLanguage);
|
|
||||||
|
|
||||||
if (hideChanged)
|
|
||||||
GameFunctions.GameFunctions.SetChatInteractable(true);
|
|
||||||
|
|
||||||
if (Plugin.Config.ShowEmotes)
|
|
||||||
_ = EmoteCache.LoadData(); // Fire-and-forget intentional, exceptions are caught inside
|
|
||||||
|
|
||||||
Initialise();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,292 +0,0 @@
|
|||||||
using ChatTwo.Code;
|
|
||||||
using ChatTwo.Resources;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud;
|
|
||||||
using Dalamud.Interface;
|
|
||||||
using Dalamud.Interface.FontIdentifier;
|
|
||||||
using Dalamud.Interface.Style;
|
|
||||||
using Dalamud.Interface.Utility;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
|
|
||||||
namespace ChatTwo.Ui.SettingsTabs;
|
|
||||||
|
|
||||||
internal sealed class Appearance : ISettingsTab
|
|
||||||
{
|
|
||||||
private Plugin Plugin { get; }
|
|
||||||
private Configuration Mutable { get; }
|
|
||||||
|
|
||||||
public string Name => HellionStrings.Settings_Tab_Appearance + "###tabs-appearance";
|
|
||||||
|
|
||||||
internal Appearance(Plugin plugin, Configuration mutable)
|
|
||||||
{
|
|
||||||
Plugin = plugin;
|
|
||||||
Mutable = mutable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Draw(bool changed)
|
|
||||||
{
|
|
||||||
DrawThemeSection();
|
|
||||||
ImGui.Spacing();
|
|
||||||
DrawFontsSection();
|
|
||||||
ImGui.Spacing();
|
|
||||||
DrawColoursSection();
|
|
||||||
ImGui.Spacing();
|
|
||||||
DrawTimestampsSection();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawThemeSection()
|
|
||||||
{
|
|
||||||
using var tree = ImRaii.TreeNode(HellionStrings.Settings_Appearance_Theme_Heading);
|
|
||||||
if (!tree.Success)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
ImGui.Checkbox(HellionStrings.Theme_Enabled_Name, ref Mutable.HellionThemeEnabled);
|
|
||||||
ImGuiUtil.HelpMarker(HellionStrings.Theme_Enabled_Description);
|
|
||||||
|
|
||||||
// Clamp 0.5–1.0 stays consistent with Privacy.cs which already
|
|
||||||
// shipped this slider; lower values would let chat windows
|
|
||||||
// disappear behind game UI.
|
|
||||||
using (ImRaii.Disabled(!Mutable.HellionThemeEnabled))
|
|
||||||
{
|
|
||||||
ImGui.SetNextItemWidth(200f * ImGuiHelpers.GlobalScale);
|
|
||||||
var opacity = Mutable.HellionThemeWindowOpacity;
|
|
||||||
if (ImGui.SliderFloat($"{HellionStrings.Theme_WindowOpacity_Label}##theme-opacity", ref opacity, 0.5f, 1.0f, "%.2f"))
|
|
||||||
{
|
|
||||||
Mutable.HellionThemeWindowOpacity = Math.Clamp(opacity, 0.5f, 1.0f);
|
|
||||||
}
|
|
||||||
ImGuiUtil.HelpMarker(HellionStrings.Theme_WindowOpacity_Help);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_OverrideStyle_Name, ref Mutable.OverrideStyle);
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_OverrideStyle_Name_Desc);
|
|
||||||
|
|
||||||
if (Mutable.OverrideStyle)
|
|
||||||
{
|
|
||||||
DrawStyleCombo();
|
|
||||||
}
|
|
||||||
|
|
||||||
// The Bestand-Slider WindowAlpha targets the chat log window's
|
|
||||||
// background only. The Hellion theme opacity above already covers
|
|
||||||
// every plugin window globally, so the two sliders fight each
|
|
||||||
// other when the theme is active. Disable the legacy slider in
|
|
||||||
// that case to make Hellion theme the single source of truth.
|
|
||||||
using (ImRaii.Disabled(Mutable.HellionThemeEnabled))
|
|
||||||
{
|
|
||||||
ImGuiUtil.DragFloatVertical(Language.Options_WindowOpacity_Name, ref Mutable.WindowAlpha, .25f, 0f, 100f, $"{Mutable.WindowAlpha:N2}%%", ImGuiSliderFlags.AlwaysClamp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawStyleCombo()
|
|
||||||
{
|
|
||||||
var styles = StyleModel.GetConfiguredStyles();
|
|
||||||
if (styles == null)
|
|
||||||
{
|
|
||||||
ImGui.TextUnformatted(Language.Options_OverrideStyle_NotAvailable);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var currentStyle = Mutable.ChosenStyle ?? Language.Options_OverrideStyle_NotSelected;
|
|
||||||
using var combo = ImRaii.Combo(Language.Options_OverrideStyleDropdown_Name, currentStyle);
|
|
||||||
if (!combo)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var style in styles)
|
|
||||||
{
|
|
||||||
if (ImGui.Selectable(style.Name, Mutable.ChosenStyle == style.Name))
|
|
||||||
{
|
|
||||||
Mutable.ChosenStyle = style.Name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawFontsSection()
|
|
||||||
{
|
|
||||||
using var tree = ImRaii.TreeNode(HellionStrings.Settings_Appearance_Fonts_Heading);
|
|
||||||
if (!tree.Success)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
if (ImGui.Checkbox(HellionStrings.Theme_UseHellionFont_Name, ref Mutable.UseHellionFont))
|
|
||||||
{
|
|
||||||
// Mutex with the Bestand custom-font stack. Leaving FontsEnabled
|
|
||||||
// checked alongside UseHellionFont made both checkboxes look
|
|
||||||
// active even though the lower stack was greyed out, which
|
|
||||||
// confused the user during the v0.5.0 walkthrough.
|
|
||||||
if (Mutable.UseHellionFont)
|
|
||||||
Mutable.FontsEnabled = false;
|
|
||||||
}
|
|
||||||
ImGuiUtil.HelpMarker(HellionStrings.Theme_UseHellionFont_Description);
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
using var fontDisabled = ImRaii.Disabled(Mutable.UseHellionFont);
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_FontsEnabled, ref Mutable.FontsEnabled);
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
var unused = false;
|
|
||||||
if (!Mutable.FontsEnabled)
|
|
||||||
{
|
|
||||||
ImGuiUtil.FontSizeCombo(Language.Options_FontSize_Name, ref Mutable.FontSizeV2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var globalChooser = ImGuiUtil.FontChooser(Language.Options_Font_Name, Mutable.GlobalFontV2, false, ref unused);
|
|
||||||
globalChooser?.ResultTask.ContinueWith(r =>
|
|
||||||
{
|
|
||||||
if (r.IsCompletedSuccessfully)
|
|
||||||
{
|
|
||||||
Plugin.Framework.Run(() => Mutable.GlobalFontV2 = r.Result);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ImGui.SameLine();
|
|
||||||
if (ImGui.Button("Reset##global"))
|
|
||||||
{
|
|
||||||
Mutable.GlobalFontV2 = new SingleFontSpec { FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkRegular), SizePt = 12.75f };
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_Font_Description, Plugin.PluginName));
|
|
||||||
ImGuiUtil.WarningText(Language.Options_Font_Warning);
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
// LocaleNames being null means it is likely a game font which all support JP symbols.
|
|
||||||
var japaneseChooser = ImGuiUtil.FontChooser(Language.Options_JapaneseFont_Name, Mutable.JapaneseFontV2, false, ref unused, id => !id.LocaleNames?.ContainsKey("ja-jp") ?? false, "いろはにほへと ちりぬるを");
|
|
||||||
japaneseChooser?.ResultTask.ContinueWith(r =>
|
|
||||||
{
|
|
||||||
if (r.IsCompletedSuccessfully)
|
|
||||||
{
|
|
||||||
Plugin.Framework.Run(() => Mutable.JapaneseFontV2 = r.Result);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ImGui.SameLine();
|
|
||||||
if (ImGui.Button("Reset##japanese"))
|
|
||||||
{
|
|
||||||
Mutable.JapaneseFontV2 = new SingleFontSpec { FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkMedium), SizePt = 12.75f };
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_JapaneseFont_Description, Plugin.PluginName));
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
var italicChooser = ImGuiUtil.FontChooser(Language.Options_ItalicFont_Name, Mutable.ItalicFontV2, true, ref Mutable.ItalicEnabled);
|
|
||||||
italicChooser?.ResultTask.ContinueWith(r =>
|
|
||||||
{
|
|
||||||
if (r.IsCompletedSuccessfully)
|
|
||||||
{
|
|
||||||
Plugin.Framework.Run(() => Mutable.ItalicFontV2 = r.Result);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ImGui.SameLine();
|
|
||||||
if (ImGui.Button("Reset##italic"))
|
|
||||||
{
|
|
||||||
Mutable.ItalicEnabled = false;
|
|
||||||
Mutable.ItalicFontV2 = new SingleFontSpec { FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkRegular), SizePt = 12.75f };
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_Italic_Description, Plugin.PluginName));
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
if (ImGui.CollapsingHeader(Language.Options_ExtraGlyphs_Name))
|
|
||||||
{
|
|
||||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_ExtraGlyphs_Description, Plugin.PluginName));
|
|
||||||
|
|
||||||
var range = (int)Mutable.ExtraGlyphRanges;
|
|
||||||
foreach (var extra in Enum.GetValues<ExtraGlyphRanges>())
|
|
||||||
{
|
|
||||||
ImGui.CheckboxFlags(extra.Name(), ref range, (int)extra);
|
|
||||||
}
|
|
||||||
|
|
||||||
Mutable.ExtraGlyphRanges = (ExtraGlyphRanges)range;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGuiUtil.FontSizeCombo(Language.Options_SymbolsFontSize_Name, ref Mutable.SymbolsFontSizeV2);
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_SymbolsFontSize_Description);
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawColoursSection()
|
|
||||||
{
|
|
||||||
using var tree = ImRaii.TreeNode(HellionStrings.Settings_Appearance_Colours_Heading);
|
|
||||||
if (!tree.Success)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
foreach (var (_, types) in ChatTypeExt.SortOrder)
|
|
||||||
{
|
|
||||||
foreach (var type in types)
|
|
||||||
{
|
|
||||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.UndoAlt, $"{type}", Language.Options_ChatColours_Reset))
|
|
||||||
{
|
|
||||||
Mutable.ChatColours.Remove(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.LongArrowAltDown, $"{type}", Language.Options_ChatColours_Import))
|
|
||||||
{
|
|
||||||
var gameColour = Plugin.Functions.Chat.GetChannelColor(type);
|
|
||||||
Mutable.ChatColours[type] = gameColour ?? type.DefaultColor() ?? 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
var vec = Mutable.ChatColours.TryGetValue(type, out var colour)
|
|
||||||
? ColourUtil.RgbaToVector3(colour)
|
|
||||||
: ColourUtil.RgbaToVector3(type.DefaultColor() ?? 0);
|
|
||||||
if (ImGui.ColorEdit3(type.Name(), ref vec, ImGuiColorEditFlags.NoInputs))
|
|
||||||
{
|
|
||||||
Mutable.ChatColours[type] = ColourUtil.Vector3ToRgba(vec);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawTimestampsSection()
|
|
||||||
{
|
|
||||||
using var tree = ImRaii.TreeNode(HellionStrings.Settings_Appearance_Timestamps_Heading);
|
|
||||||
if (!tree.Success)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
ImGui.Checkbox(Language.Options_PrettierTimestamps_Name, ref Mutable.PrettierTimestamps);
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_PrettierTimestamps_Description);
|
|
||||||
|
|
||||||
if (Mutable.PrettierTimestamps)
|
|
||||||
{
|
|
||||||
ImGui.Checkbox(Language.Options_MoreCompactPretty_Name, ref Mutable.MoreCompactPretty);
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_MoreCompactPretty_Description);
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_HideSameTimestamps_Name, ref Mutable.HideSameTimestamps);
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_HideSameTimestamps_Description);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_Use24HourClock_Name, ref Mutable.Use24HourClock);
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_Use24HourClock_Description);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,259 +0,0 @@
|
|||||||
using System.Diagnostics;
|
|
||||||
using ChatTwo.Code;
|
|
||||||
using ChatTwo.Resources;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using Dalamud.Game.Text;
|
|
||||||
|
|
||||||
namespace ChatTwo.Ui.SettingsTabs;
|
|
||||||
|
|
||||||
internal sealed class Database : ISettingsTab
|
|
||||||
{
|
|
||||||
private Plugin Plugin { get; }
|
|
||||||
private Configuration Mutable { get; }
|
|
||||||
|
|
||||||
public string Name => HellionStrings.Settings_Tab_Database + "###tabs-database";
|
|
||||||
|
|
||||||
internal Database(Plugin plugin, Configuration mutable)
|
|
||||||
{
|
|
||||||
Plugin = plugin;
|
|
||||||
Mutable = mutable;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool ShowAdvanced;
|
|
||||||
|
|
||||||
private long DatabaseLastRefreshTicks;
|
|
||||||
private long DatabaseSize;
|
|
||||||
private long DatabaseLogSize;
|
|
||||||
private int DatabaseMessageCount;
|
|
||||||
|
|
||||||
public void Draw(bool changed)
|
|
||||||
{
|
|
||||||
// Shift-on-open keeps the Advanced tools available without a permanent
|
|
||||||
// toggle in the UI, mirroring upstream Chat 2 behaviour.
|
|
||||||
if (changed)
|
|
||||||
ShowAdvanced = ImGui.GetIO().KeyShift;
|
|
||||||
|
|
||||||
DrawStorageSection();
|
|
||||||
ImGui.Spacing();
|
|
||||||
DrawViewerSection();
|
|
||||||
ImGui.Spacing();
|
|
||||||
DrawStatsSection();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawStorageSection()
|
|
||||||
{
|
|
||||||
using var tree = ImRaii.TreeNode(HellionStrings.Settings_Database_Storage_Heading);
|
|
||||||
if (!tree.Success)
|
|
||||||
return;
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
ImGui.Checkbox(Language.Options_DatabaseBattleMessages_Name, ref Mutable.DatabaseBattleMessages);
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_DatabaseBattleMessages_Description);
|
|
||||||
|
|
||||||
if (ImGui.Checkbox(Language.Options_LoadPreviousSession_Name, ref Mutable.LoadPreviousSession))
|
|
||||||
if (Mutable.LoadPreviousSession)
|
|
||||||
Mutable.FilterIncludePreviousSessions = true;
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_LoadPreviousSession_Description);
|
|
||||||
|
|
||||||
if (ImGui.Checkbox(Language.Options_FilterIncludePreviousSessions_Name, ref Mutable.FilterIncludePreviousSessions))
|
|
||||||
if (!Mutable.FilterIncludePreviousSessions)
|
|
||||||
Mutable.LoadPreviousSession = false;
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_FilterIncludePreviousSessions_Description);
|
|
||||||
|
|
||||||
var old = new FileInfo(Path.Join(Plugin.Interface.ConfigDirectory.FullName, "chat.db"));
|
|
||||||
var migratedOld = new FileInfo(Path.Join(Plugin.Interface.ConfigDirectory.FullName, "chat-litedb.db"));
|
|
||||||
if (old.Exists || migratedOld.Exists)
|
|
||||||
{
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
ImGui.TextUnformatted(Language.Options_Database_Old_Heading);
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
if (ImGuiUtil.CtrlShiftButton(Language.Options_Database_Old_Delete, Language.Options_Database_Old_Delete_Tooltip))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (old.Exists)
|
|
||||||
old.Delete();
|
|
||||||
else
|
|
||||||
migratedOld.Delete();
|
|
||||||
WrapperUtil.AddNotification(Language.Options_Database_Old_Delete_Success, NotificationType.Success);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Plugin.Log.Error(e, "Unable to delete old database");
|
|
||||||
WrapperUtil.AddNotification(Language.Options_Database_Old_Delete_Error, NotificationType.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawViewerSection()
|
|
||||||
{
|
|
||||||
using var tree = ImRaii.TreeNode(HellionStrings.Settings_Database_Viewer_Heading);
|
|
||||||
if (!tree.Success)
|
|
||||||
return;
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
// Refresh the database size and message count every 5 seconds to avoid
|
|
||||||
// constant stat calls and spamming the database.
|
|
||||||
if (DatabaseLastRefreshTicks + 5 * 1000 < Environment.TickCount64)
|
|
||||||
{
|
|
||||||
DatabaseSize = Plugin.MessageManager.Store.DatabaseSize();
|
|
||||||
DatabaseLogSize = Plugin.MessageManager.Store.DatabaseLogSize();
|
|
||||||
DatabaseMessageCount = Plugin.MessageManager.Store.MessageCount();
|
|
||||||
DatabaseLastRefreshTicks = Environment.TickCount64;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy the directory path instead of the file path so people can
|
|
||||||
// paste it into their file explorer.
|
|
||||||
ImGuiUtil.HelpText(string.Format(Language.Options_Database_Metadata_Path, MessageManager.DatabasePath()));
|
|
||||||
if (ImGui.IsItemClicked(ImGuiMouseButton.Left))
|
|
||||||
{
|
|
||||||
var path = Path.GetDirectoryName(MessageManager.DatabasePath());
|
|
||||||
ImGui.SetClipboardText(path);
|
|
||||||
WrapperUtil.AddNotification(Language.Options_Database_Metadata_CopyConfigPathNotification, NotificationType.Info);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGui.IsItemHovered())
|
|
||||||
{
|
|
||||||
ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
|
|
||||||
ImGuiUtil.Tooltip(Language.Options_Database_Metadata_CopyConfigPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGuiUtil.HelpText(string.Format(Language.Options_Database_Metadata_Size, StringUtil.BytesToString(DatabaseSize)));
|
|
||||||
if (ImGui.IsItemHovered())
|
|
||||||
ImGuiUtil.Tooltip(StringUtil.BytesToString(DatabaseSize));
|
|
||||||
|
|
||||||
ImGuiUtil.HelpText(string.Format(Language.Options_Database_Metadata_LogSize, StringUtil.BytesToString(DatabaseLogSize)));
|
|
||||||
if (ImGui.IsItemHovered())
|
|
||||||
ImGuiUtil.Tooltip(StringUtil.BytesToString(DatabaseLogSize));
|
|
||||||
|
|
||||||
ImGuiUtil.HelpText(string.Format(Language.Options_Database_Metadata_MessageCount, DatabaseMessageCount));
|
|
||||||
|
|
||||||
if (ImGuiUtil.CtrlShiftButton(Language.Options_ClearDatabase_Button, Language.Options_ClearDatabase_Tooltip))
|
|
||||||
{
|
|
||||||
Plugin.Log.Warning("Clearing messages from database");
|
|
||||||
Plugin.MessageManager.Store.ClearMessages();
|
|
||||||
Plugin.MessageManager.ClearAllTabs();
|
|
||||||
|
|
||||||
// Refresh on next draw
|
|
||||||
DatabaseLastRefreshTicks = 0;
|
|
||||||
WrapperUtil.AddNotification(Language.Options_ClearDatabase_Success, NotificationType.Info);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawStatsSection()
|
|
||||||
{
|
|
||||||
if (!ShowAdvanced)
|
|
||||||
return;
|
|
||||||
|
|
||||||
using var tree = ImRaii.TreeNode(HellionStrings.Settings_Database_Stats_Heading);
|
|
||||||
if (!tree.Success)
|
|
||||||
return;
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
using var wrap = ImRaii.TextWrapPos(0.0f);
|
|
||||||
|
|
||||||
ImGuiUtil.WarningText(Language.Options_Database_Advanced_Warning);
|
|
||||||
if (ImGuiUtil.CtrlShiftButton("Perform maintenance", "Ctrl+Shift: MessageManager.Store.PerformMaintenance()"))
|
|
||||||
Plugin.MessageManager.Store.PerformMaintenance();
|
|
||||||
|
|
||||||
if (ImGuiUtil.CtrlShiftButton("Reload messages from database", "Ctrl+Shift: MessageManager.FilterAllTabs()"))
|
|
||||||
{
|
|
||||||
Plugin.MessageManager.ClearAllTabs();
|
|
||||||
Plugin.MessageManager.FilterAllTabsAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGuiUtil.CtrlShiftButton("Inject 10,000 messages", "Ctrl+Shift: creates 10,000 unique messages (async)"))
|
|
||||||
new Thread(() => InsertMessages(10_000)).Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void InsertMessages(int count)
|
|
||||||
{
|
|
||||||
Plugin.Log.Info($"Inserting {count} messages due to user request");
|
|
||||||
|
|
||||||
// Generate
|
|
||||||
var stopwatch = Stopwatch.StartNew();
|
|
||||||
var playerName = Plugin.PlayerState.CharacterName;
|
|
||||||
var worldId = Plugin.PlayerState.HomeWorld.ValueNullable?.RowId ?? 0;
|
|
||||||
var senderSource = new SeStringBuilder()
|
|
||||||
.AddText("<")
|
|
||||||
.Add(new PlayerPayload(playerName, worldId))
|
|
||||||
.AddText("Random Message")
|
|
||||||
.Add(RawPayload.LinkTerminator)
|
|
||||||
.AddText(">: ")
|
|
||||||
.Build();
|
|
||||||
var senderChunks = ChunkUtil.ToChunks(senderSource, ChunkSource.Sender, ChatType.Debug).ToList();
|
|
||||||
var messages = new List<Message>(count);
|
|
||||||
for (var i = 0; i < count; i++)
|
|
||||||
{
|
|
||||||
var contentSource = new SeStringBuilder()
|
|
||||||
.AddText("Random message payload - ")
|
|
||||||
.AddItalics(Guid.NewGuid().ToString())
|
|
||||||
.Build();
|
|
||||||
var contentChunks = ChunkUtil.ToChunks(contentSource, ChunkSource.Content, ChatType.Debug).ToList();
|
|
||||||
|
|
||||||
var chatCode = new ChatCode(XivChatType.Say, 0, 0);
|
|
||||||
messages.Add(new Message(
|
|
||||||
Guid.NewGuid(),
|
|
||||||
Plugin.MessageManager.CurrentContentId,
|
|
||||||
Plugin.MessageManager.CurrentContentId,
|
|
||||||
DateTimeOffset.UtcNow,
|
|
||||||
chatCode,
|
|
||||||
senderChunks,
|
|
||||||
contentChunks,
|
|
||||||
senderSource,
|
|
||||||
contentSource,
|
|
||||||
Guid.Empty
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
var elapsedTicks = stopwatch.ElapsedTicks;
|
|
||||||
stopwatch.Stop();
|
|
||||||
Plugin.Log.Info($"Crafted {count} messages in {elapsedTicks} ticks ({elapsedTicks / TimeSpan.TicksPerMillisecond}ms)");
|
|
||||||
|
|
||||||
// Insert
|
|
||||||
stopwatch = Stopwatch.StartNew();
|
|
||||||
foreach (var message in messages)
|
|
||||||
Plugin.MessageManager.Store.UpsertMessage(message);
|
|
||||||
|
|
||||||
elapsedTicks = stopwatch.ElapsedTicks;
|
|
||||||
stopwatch.Stop();
|
|
||||||
Plugin.Log.Info($"Upserted {count} messages in {elapsedTicks} ticks ({elapsedTicks / TimeSpan.TicksPerMillisecond}ms)");
|
|
||||||
|
|
||||||
// Clear tabs during framework frame
|
|
||||||
Plugin.Framework.Run(() =>
|
|
||||||
{
|
|
||||||
stopwatch = Stopwatch.StartNew();
|
|
||||||
Plugin.MessageManager.ClearAllTabs();
|
|
||||||
elapsedTicks = stopwatch.ElapsedTicks;
|
|
||||||
stopwatch.Stop();
|
|
||||||
Plugin.Log.Info($"Cleared {Plugin.Config.Tabs.Count} tabs in {elapsedTicks} ticks ({elapsedTicks / TimeSpan.TicksPerMillisecond}ms)");
|
|
||||||
}).Wait();
|
|
||||||
|
|
||||||
// Fetch and filter during framework frame
|
|
||||||
Plugin.Framework.Run(() =>
|
|
||||||
{
|
|
||||||
stopwatch = Stopwatch.StartNew();
|
|
||||||
// Intentionally synchronous
|
|
||||||
Plugin.MessageManager.FilterAllTabs();
|
|
||||||
elapsedTicks = stopwatch.ElapsedTicks;
|
|
||||||
stopwatch.Stop();
|
|
||||||
Plugin.Log.Info($"Fetched and filtered all tabs in {elapsedTicks} ticks ({elapsedTicks / TimeSpan.TicksPerMillisecond}ms)");
|
|
||||||
}).Wait();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,638 +0,0 @@
|
|||||||
using ChatTwo.Code;
|
|
||||||
using ChatTwo.Export;
|
|
||||||
using ChatTwo.Privacy;
|
|
||||||
using ChatTwo.Resources;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Interface.Colors;
|
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
|
||||||
using Dalamud.Interface.Utility;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
|
|
||||||
namespace ChatTwo.Ui.SettingsTabs;
|
|
||||||
|
|
||||||
internal sealed class Privacy : ISettingsTab
|
|
||||||
{
|
|
||||||
private Plugin Plugin { get; }
|
|
||||||
private Configuration Mutable { get; }
|
|
||||||
|
|
||||||
public string Name => HellionStrings.Privacy_Tab_Title + "###tabs-privacy";
|
|
||||||
|
|
||||||
internal Privacy(Plugin plugin, Configuration mutable)
|
|
||||||
{
|
|
||||||
Plugin = plugin;
|
|
||||||
Mutable = mutable;
|
|
||||||
}
|
|
||||||
|
|
||||||
// (HeadingKey lookup, ChatType list). Heading is resolved per-frame so
|
|
||||||
// a runtime LanguageChanged call updates the labels immediately.
|
|
||||||
private static readonly (Func<string> Heading, ChatType[] Types)[] Groups =
|
|
||||||
[
|
|
||||||
(() => HellionStrings.Privacy_Group_DirectMessages, [ChatType.TellIncoming, ChatType.TellOutgoing]),
|
|
||||||
(() => HellionStrings.Privacy_Group_PartyAlliance, [ChatType.Party, ChatType.CrossParty, ChatType.Alliance, ChatType.PvpTeam]),
|
|
||||||
(() => HellionStrings.Privacy_Group_FreeCompany, [ChatType.FreeCompany, ChatType.FreeCompanyAnnouncement, ChatType.FreeCompanyLoginLogout]),
|
|
||||||
(() => HellionStrings.Privacy_Group_Linkshells, [
|
|
||||||
ChatType.Linkshell1, ChatType.Linkshell2, ChatType.Linkshell3, ChatType.Linkshell4,
|
|
||||||
ChatType.Linkshell5, ChatType.Linkshell6, ChatType.Linkshell7, ChatType.Linkshell8,
|
|
||||||
]),
|
|
||||||
(() => HellionStrings.Privacy_Group_CrossLinkshells, [
|
|
||||||
ChatType.CrossLinkshell1, ChatType.CrossLinkshell2, ChatType.CrossLinkshell3, ChatType.CrossLinkshell4,
|
|
||||||
ChatType.CrossLinkshell5, ChatType.CrossLinkshell6, ChatType.CrossLinkshell7, ChatType.CrossLinkshell8,
|
|
||||||
]),
|
|
||||||
(() => HellionStrings.Privacy_Group_ExtraChat, [
|
|
||||||
ChatType.ExtraChatLinkshell1, ChatType.ExtraChatLinkshell2, ChatType.ExtraChatLinkshell3, ChatType.ExtraChatLinkshell4,
|
|
||||||
ChatType.ExtraChatLinkshell5, ChatType.ExtraChatLinkshell6, ChatType.ExtraChatLinkshell7, ChatType.ExtraChatLinkshell8,
|
|
||||||
]),
|
|
||||||
(() => HellionStrings.Privacy_Group_PublicChat, [ChatType.Say, ChatType.Shout, ChatType.Yell, ChatType.NoviceNetwork, ChatType.CustomEmote, ChatType.StandardEmote]),
|
|
||||||
(() => HellionStrings.Privacy_Group_SystemLogs, [
|
|
||||||
ChatType.System, ChatType.Notice, ChatType.Urgent, ChatType.Echo,
|
|
||||||
ChatType.NpcDialogue, ChatType.NpcAnnouncement,
|
|
||||||
ChatType.LootNotice, ChatType.LootRoll, ChatType.RetainerSale,
|
|
||||||
ChatType.Crafting, ChatType.Gathering, ChatType.Sign, ChatType.RandomNumber,
|
|
||||||
]),
|
|
||||||
];
|
|
||||||
|
|
||||||
private Dictionary<int, long>? CleanupCounts;
|
|
||||||
private long CleanupKeepCount;
|
|
||||||
private long CleanupDeleteCount;
|
|
||||||
private bool CleanupRunning;
|
|
||||||
private bool CleanupPreviewStale;
|
|
||||||
private HashSet<ChatType>? CleanupPreviewSnapshot;
|
|
||||||
|
|
||||||
// The retention-running state lives on Plugin so the auto-sweep and
|
|
||||||
// this manual button see the same flag. UI reads stay lock-free
|
|
||||||
// because ImGui is single-threaded and bool reads are atomic in .NET.
|
|
||||||
private bool RetentionRunning => Plugin.RetentionSweepRunning;
|
|
||||||
|
|
||||||
// Export form state
|
|
||||||
private int ExportRangeDays = 30;
|
|
||||||
private string ExportSenderSubstring = string.Empty;
|
|
||||||
private readonly HashSet<ChatType> ExportSelectedChannels = [];
|
|
||||||
private ExportFormat ExportFormat = ExportFormat.Markdown;
|
|
||||||
private bool ExportRunning;
|
|
||||||
|
|
||||||
public void Draw(bool changed)
|
|
||||||
{
|
|
||||||
if (ImGui.Button(HellionStrings.Wizard_Reopen_Button))
|
|
||||||
Plugin.FirstRunWizard.IsOpen = true;
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
DrawPrivacyFilterSection();
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
DrawRetentionSection();
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
DrawCleanupSection();
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
DrawExportSection();
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
DrawAutoTellTabsPreloadSection();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawAutoTellTabsPreloadSection()
|
|
||||||
{
|
|
||||||
using var tree = ImRaii.TreeNode(HellionStrings.Privacy_AutoTellTabs_Section_Title);
|
|
||||||
if (!tree.Success)
|
|
||||||
return;
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
var preload = Mutable.AutoTellTabsHistoryPreload;
|
|
||||||
ImGui.SetNextItemWidth(200f * ImGuiHelpers.GlobalScale);
|
|
||||||
if (ImGui.SliderInt(HellionStrings.Privacy_AutoTellTabs_Preload_Name, ref preload, 0, 100))
|
|
||||||
{
|
|
||||||
Mutable.AutoTellTabsHistoryPreload = preload;
|
|
||||||
}
|
|
||||||
ImGuiUtil.HelpMarker(HellionStrings.Privacy_AutoTellTabs_Preload_Description);
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGuiUtil.HelpText(HellionStrings.Privacy_AutoTellTabs_Preload_Hint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawPrivacyFilterSection()
|
|
||||||
{
|
|
||||||
using var tree = ImRaii.TreeNode(HellionStrings.Privacy_Filter_Tree_Heading);
|
|
||||||
if (!tree.Success)
|
|
||||||
return;
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
ImGuiUtil.OptionCheckbox(
|
|
||||||
ref Mutable.PrivacyFilterEnabled,
|
|
||||||
HellionStrings.Privacy_FilterEnabled_Name,
|
|
||||||
HellionStrings.Privacy_FilterEnabled_Description);
|
|
||||||
ImGuiUtil.HelpMarker(HellionStrings.Privacy_FilterEnabled_StorageOnly_Help);
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
using (ImRaii.Disabled(!Mutable.PrivacyFilterEnabled))
|
|
||||||
{
|
|
||||||
ImGuiUtil.HelpText(HellionStrings.Privacy_Whitelist_Help);
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
if (ImGui.Button(HellionStrings.Privacy_Preset_PrivacyFirst))
|
|
||||||
Mutable.PrivacyPersistChannels = [..PrivacyDefaults.PrivacyFirstWhitelist];
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
if (ImGui.Button(HellionStrings.Privacy_Preset_ClearAll))
|
|
||||||
Mutable.PrivacyPersistChannels.Clear();
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
if (ImGui.Button(HellionStrings.Privacy_Preset_SelectAll))
|
|
||||||
foreach (var group in Groups)
|
|
||||||
foreach (var t in group.Types)
|
|
||||||
Mutable.PrivacyPersistChannels.Add(t);
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
foreach (var (heading, types) in Groups)
|
|
||||||
{
|
|
||||||
using var groupTree = ImRaii.TreeNode(heading());
|
|
||||||
if (!groupTree.Success)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
foreach (var type in types)
|
|
||||||
{
|
|
||||||
var enabled = Mutable.PrivacyPersistChannels.Contains(type);
|
|
||||||
var label = type.ToString();
|
|
||||||
if (ImGui.Checkbox($"{label}##privacy-{(int)type}", ref enabled))
|
|
||||||
{
|
|
||||||
if (enabled)
|
|
||||||
Mutable.PrivacyPersistChannels.Add(type);
|
|
||||||
else
|
|
||||||
Mutable.PrivacyPersistChannels.Remove(type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(
|
|
||||||
ref Mutable.PrivacyPersistUnknownChannels,
|
|
||||||
HellionStrings.Privacy_PersistUnknown_Name,
|
|
||||||
HellionStrings.Privacy_PersistUnknown_Description);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawExportSection()
|
|
||||||
{
|
|
||||||
ImGui.TextUnformatted(HellionStrings.Export_Heading);
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
ImGuiUtil.HelpText(HellionStrings.Export_Help);
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
if (ImGui.InputInt(HellionStrings.Export_Range_Label, ref ExportRangeDays))
|
|
||||||
ExportRangeDays = Math.Max(0, ExportRangeDays);
|
|
||||||
|
|
||||||
ImGui.InputText(HellionStrings.Export_Sender_Label, ref ExportSenderSubstring, 256);
|
|
||||||
|
|
||||||
using (var tree = ImRaii.TreeNode(HellionStrings.Export_Channels_Heading))
|
|
||||||
{
|
|
||||||
if (tree.Success)
|
|
||||||
{
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
ImGuiUtil.HelpText(HellionStrings.Export_Channels_AllOff);
|
|
||||||
foreach (var (heading, types) in Groups)
|
|
||||||
{
|
|
||||||
using var subTree = ImRaii.TreeNode($"{heading()}##export-group-{heading()}");
|
|
||||||
if (!subTree.Success)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
foreach (var type in types)
|
|
||||||
{
|
|
||||||
var enabled = ExportSelectedChannels.Contains(type);
|
|
||||||
if (ImGui.Checkbox($"{type}##export-{(int)type}", ref enabled))
|
|
||||||
{
|
|
||||||
if (enabled)
|
|
||||||
ExportSelectedChannels.Add(type);
|
|
||||||
else
|
|
||||||
ExportSelectedChannels.Remove(type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGui.TextUnformatted(HellionStrings.Export_Format_Label);
|
|
||||||
ImGui.SameLine();
|
|
||||||
var fmt = (int)ExportFormat;
|
|
||||||
if (ImGui.RadioButton(HellionStrings.Export_Format_Markdown, ref fmt, (int)ExportFormat.Markdown))
|
|
||||||
ExportFormat = ExportFormat.Markdown;
|
|
||||||
ImGui.SameLine();
|
|
||||||
if (ImGui.RadioButton(HellionStrings.Export_Format_Json, ref fmt, (int)ExportFormat.Json))
|
|
||||||
ExportFormat = ExportFormat.Json;
|
|
||||||
ImGui.SameLine();
|
|
||||||
if (ImGui.RadioButton(HellionStrings.Export_Format_Csv, ref fmt, (int)ExportFormat.Csv))
|
|
||||||
ExportFormat = ExportFormat.Csv;
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
using (ImRaii.Disabled(ExportRunning))
|
|
||||||
{
|
|
||||||
if (ImGui.Button(HellionStrings.Export_Button))
|
|
||||||
PromptExport();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ExportRunning)
|
|
||||||
ImGuiUtil.HelpText(HellionStrings.Export_Running);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PromptExport()
|
|
||||||
{
|
|
||||||
var defaultName = $"hellion-chat-export-{DateTimeOffset.Now:yyyyMMdd-HHmm}";
|
|
||||||
var ext = ExportFormat.Extension();
|
|
||||||
|
|
||||||
Plugin.FileDialogManager.SaveFileDialog(
|
|
||||||
HellionStrings.Export_Dialog_Title,
|
|
||||||
ExportFormat.Filter(),
|
|
||||||
defaultName,
|
|
||||||
ext,
|
|
||||||
(success, path) =>
|
|
||||||
{
|
|
||||||
if (!success || string.IsNullOrWhiteSpace(path))
|
|
||||||
return;
|
|
||||||
StartExport(path);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void StartExport(string path)
|
|
||||||
{
|
|
||||||
if (ExportRunning)
|
|
||||||
return;
|
|
||||||
ExportRunning = true;
|
|
||||||
|
|
||||||
var types = ExportSelectedChannels.Count > 0
|
|
||||||
? ExportSelectedChannels.Select(t => (int)(ushort)t).ToList()
|
|
||||||
: null;
|
|
||||||
|
|
||||||
DateTimeOffset? from = ExportRangeDays > 0
|
|
||||||
? DateTimeOffset.UtcNow.AddDays(-ExportRangeDays)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
var senderSubstring = string.IsNullOrWhiteSpace(ExportSenderSubstring) ? null : ExportSenderSubstring.Trim();
|
|
||||||
var format = ExportFormat;
|
|
||||||
var filterDesc = new MessageExporter.FilterDescription(types, from, null, senderSubstring);
|
|
||||||
|
|
||||||
new Thread(() =>
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using var enumerator = Plugin.MessageManager.Store.StreamForExport(types, from, null);
|
|
||||||
var written = MessageExporter.ExportToFile(path, format, enumerator, filterDesc);
|
|
||||||
|
|
||||||
if (written > 0)
|
|
||||||
WrapperUtil.AddNotification(string.Format(HellionStrings.Export_Success, written, path), NotificationType.Success);
|
|
||||||
else
|
|
||||||
WrapperUtil.AddNotification(HellionStrings.Export_Empty, NotificationType.Info);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Plugin.Log.Error(e, "Export failed");
|
|
||||||
WrapperUtil.AddNotification(HellionStrings.Export_Error, NotificationType.Error);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
ExportRunning = false;
|
|
||||||
}
|
|
||||||
}) { IsBackground = true }.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawRetentionSection()
|
|
||||||
{
|
|
||||||
ImGui.TextUnformatted(HellionStrings.Retention_Heading);
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
ImGuiUtil.OptionCheckbox(
|
|
||||||
ref Mutable.RetentionEnabled,
|
|
||||||
HellionStrings.Retention_Enabled_Name,
|
|
||||||
HellionStrings.Retention_Enabled_Description);
|
|
||||||
|
|
||||||
using (ImRaii.Disabled(!Mutable.RetentionEnabled))
|
|
||||||
{
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
var defaultDays = Mutable.RetentionDefaultDays;
|
|
||||||
if (ImGui.InputInt(HellionStrings.Retention_Default_Label, ref defaultDays))
|
|
||||||
Mutable.RetentionDefaultDays = Math.Max(0, defaultDays);
|
|
||||||
ImGuiUtil.HelpMarker(HellionStrings.Retention_Default_Help);
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
if (ImGui.Button(HellionStrings.Retention_Reset_Spec))
|
|
||||||
{
|
|
||||||
Mutable.RetentionPerChannelDays =
|
|
||||||
PrivacyDefaults.DefaultRetentionDays.ToDictionary(p => p.Key, p => p.Value);
|
|
||||||
}
|
|
||||||
ImGui.SameLine();
|
|
||||||
if (ImGui.Button(HellionStrings.Retention_Clear_Overrides))
|
|
||||||
Mutable.RetentionPerChannelDays.Clear();
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
using (var tree = ImRaii.TreeNode(HellionStrings.Retention_Tree_Heading))
|
|
||||||
{
|
|
||||||
if (tree.Success)
|
|
||||||
{
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
foreach (var (heading, types) in Groups)
|
|
||||||
{
|
|
||||||
using var subTree = ImRaii.TreeNode(heading());
|
|
||||||
if (!subTree.Success)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
foreach (var type in types)
|
|
||||||
{
|
|
||||||
var hasOverride = Mutable.RetentionPerChannelDays.TryGetValue(type, out var days);
|
|
||||||
var hasSpecDefault = PrivacyDefaults.DefaultRetentionDays.TryGetValue(type, out var specDays);
|
|
||||||
if (!hasOverride)
|
|
||||||
days = hasSpecDefault ? specDays : Mutable.RetentionDefaultDays;
|
|
||||||
|
|
||||||
var tag = hasOverride
|
|
||||||
? HellionStrings.Retention_Tag_Override
|
|
||||||
: hasSpecDefault
|
|
||||||
? HellionStrings.Retention_Tag_Spec
|
|
||||||
: HellionStrings.Retention_Tag_Global;
|
|
||||||
if (ImGui.InputInt($"{type} {tag}##retention-{(int)type}", ref days))
|
|
||||||
{
|
|
||||||
days = Math.Max(0, days);
|
|
||||||
Mutable.RetentionPerChannelDays[type] = days;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasOverride)
|
|
||||||
{
|
|
||||||
ImGui.SameLine();
|
|
||||||
if (ImGui.Button($"{HellionStrings.Retention_Reset_Button}##retention-reset-{(int)type}"))
|
|
||||||
Mutable.RetentionPerChannelDays.Remove(type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
ImGuiUtil.HelpText(HellionStrings.Retention_Help_SavedNote);
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
using (ImRaii.Disabled(RetentionRunning))
|
|
||||||
{
|
|
||||||
if (ImGuiUtil.CtrlShiftButton(HellionStrings.Retention_Apply_Label, HellionStrings.Retention_Apply_Tooltip))
|
|
||||||
StartRetentionRun();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (RetentionRunning)
|
|
||||||
ImGuiUtil.HelpText(HellionStrings.Retention_Running);
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
var lastRun = Plugin.Config.RetentionLastRunAt;
|
|
||||||
ImGuiUtil.HelpText(lastRun == DateTimeOffset.MinValue
|
|
||||||
? HellionStrings.Retention_LastRun_Never
|
|
||||||
: string.Format(HellionStrings.Retention_LastRun_At, lastRun.ToLocalTime()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void StartRetentionRun()
|
|
||||||
{
|
|
||||||
// Take the shared retention lock so we cannot fight the auto-sweep
|
|
||||||
// for the database connection. If the auto-sweep is already in
|
|
||||||
// flight we just bail — the user can press the button again once
|
|
||||||
// it finishes.
|
|
||||||
lock (Plugin.RetentionSweepLock)
|
|
||||||
{
|
|
||||||
if (Plugin.RetentionSweepRunning)
|
|
||||||
return;
|
|
||||||
Plugin.RetentionSweepRunning = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var policy = Plugin.Config.RetentionPerChannelDays.ToDictionary(p => (int)(ushort)p.Key, p => p.Value);
|
|
||||||
var defaultDays = Plugin.Config.RetentionDefaultDays;
|
|
||||||
|
|
||||||
new Thread(() =>
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var deleted = Plugin.MessageManager.Store.DeleteByRetentionPolicy(policy, defaultDays);
|
|
||||||
Plugin.Config.RetentionLastRunAt = DateTimeOffset.UtcNow;
|
|
||||||
Plugin.SaveConfig();
|
|
||||||
|
|
||||||
Plugin.Log.Information($"Manual retention run deleted {deleted} expired messages.");
|
|
||||||
|
|
||||||
if (deleted > 0)
|
|
||||||
{
|
|
||||||
Plugin.Framework.Run(() =>
|
|
||||||
{
|
|
||||||
Plugin.MessageManager.ClearAllTabs();
|
|
||||||
Plugin.MessageManager.FilterAllTabsAsync();
|
|
||||||
}).Wait();
|
|
||||||
}
|
|
||||||
|
|
||||||
WrapperUtil.AddNotification(string.Format(HellionStrings.Retention_Success, deleted), NotificationType.Success);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Plugin.Log.Error(e, "Manual retention run failed");
|
|
||||||
WrapperUtil.AddNotification(HellionStrings.Retention_Error, NotificationType.Error);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
lock (Plugin.RetentionSweepLock)
|
|
||||||
Plugin.RetentionSweepRunning = false;
|
|
||||||
}
|
|
||||||
}) { IsBackground = true }.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawCleanupSection()
|
|
||||||
{
|
|
||||||
ImGui.TextUnformatted(HellionStrings.Cleanup_Heading);
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
ImGuiUtil.HelpText(HellionStrings.Cleanup_Help_Intro);
|
|
||||||
ImGuiUtil.HelpText(HellionStrings.Cleanup_Help_SavedNote);
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
// Drift-detection between the snapshot taken at last refresh
|
|
||||||
// and the current Mutable whitelist. Cleanup itself runs on
|
|
||||||
// the SAVED policy (Cleanup_Help_SavedNote covers that), but
|
|
||||||
// the user usually expects "the preview reflects what I just
|
|
||||||
// ticked" — so we surface the divergence instead of silently
|
|
||||||
// showing stale numbers.
|
|
||||||
if (CleanupPreviewSnapshot is not null
|
|
||||||
&& !CleanupPreviewSnapshot.SetEquals(Mutable.PrivacyPersistChannels))
|
|
||||||
{
|
|
||||||
CleanupPreviewStale = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
using (var emphasis = CleanupPreviewStale
|
|
||||||
? ImRaii.PushColor(ImGuiCol.Button, ImGuiColors.HealerGreen with { W = 0.6f })
|
|
||||||
: null)
|
|
||||||
using (ImRaii.Disabled(CleanupRunning))
|
|
||||||
{
|
|
||||||
if (ImGui.Button(HellionStrings.Cleanup_RefreshPreview))
|
|
||||||
RefreshCleanupPreview();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CleanupCounts is null)
|
|
||||||
{
|
|
||||||
ImGuiUtil.HelpText(HellionStrings.Cleanup_NoPreview);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CleanupPreviewStale)
|
|
||||||
{
|
|
||||||
ImGui.Spacing();
|
|
||||||
ImGuiUtil.HelpText(HellionStrings.Cleanup_Preview_Stale);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
using (var staleColor = CleanupPreviewStale
|
|
||||||
? ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudGrey)
|
|
||||||
: null)
|
|
||||||
{
|
|
||||||
ImGuiUtil.HelpText(string.Format(HellionStrings.Cleanup_TotalStored, CleanupKeepCount + CleanupDeleteCount));
|
|
||||||
ImGuiUtil.HelpText(string.Format(HellionStrings.Cleanup_WillKeep, CleanupKeepCount));
|
|
||||||
ImGuiUtil.HelpText(string.Format(HellionStrings.Cleanup_WillDelete, CleanupDeleteCount));
|
|
||||||
}
|
|
||||||
|
|
||||||
using (var tree = ImRaii.TreeNode(HellionStrings.Cleanup_Breakdown))
|
|
||||||
{
|
|
||||||
if (tree.Success)
|
|
||||||
{
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
foreach (var (chatType, count) in CleanupCounts.OrderByDescending(p => p.Value))
|
|
||||||
{
|
|
||||||
var name = Enum.IsDefined(typeof(ChatType), (ushort)chatType)
|
|
||||||
? ((ChatType)(ushort)chatType).ToString()
|
|
||||||
: $"Unknown({chatType})";
|
|
||||||
var keeps = WouldBeKept(chatType);
|
|
||||||
var marker = keeps ? HellionStrings.Cleanup_Marker_Keep : HellionStrings.Cleanup_Marker_Delete;
|
|
||||||
ImGuiUtil.HelpText($"{marker} {name} — {count:N0}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
using (ImRaii.Disabled(CleanupRunning || CleanupDeleteCount == 0))
|
|
||||||
{
|
|
||||||
if (ImGuiUtil.CtrlShiftButton(HellionStrings.Cleanup_Apply_Label,
|
|
||||||
string.Format(HellionStrings.Cleanup_Apply_Tooltip, CleanupDeleteCount)))
|
|
||||||
StartCleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CleanupRunning)
|
|
||||||
ImGuiUtil.HelpText(HellionStrings.Cleanup_Running);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool WouldBeKept(int chatType)
|
|
||||||
{
|
|
||||||
if (!Plugin.Config.PrivacyFilterEnabled)
|
|
||||||
return true;
|
|
||||||
if (Plugin.Config.PrivacyPersistChannels.Contains((ChatType)(ushort)chatType))
|
|
||||||
return true;
|
|
||||||
return Plugin.Config.PrivacyPersistUnknownChannels;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RefreshCleanupPreview()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
CleanupCounts = Plugin.MessageManager.Store.GetMessageCountsByChatType();
|
|
||||||
CleanupKeepCount = 0;
|
|
||||||
CleanupDeleteCount = 0;
|
|
||||||
foreach (var (chatType, count) in CleanupCounts)
|
|
||||||
{
|
|
||||||
if (WouldBeKept(chatType))
|
|
||||||
CleanupKeepCount += count;
|
|
||||||
else
|
|
||||||
CleanupDeleteCount += count;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Snapshot the whitelist as it stood at preview-time so the
|
|
||||||
// render pass can flag the user about subsequent edits. Only
|
|
||||||
// updated on success — if the preview throws, the previous
|
|
||||||
// snapshot stays in place so stale-detection keeps working.
|
|
||||||
CleanupPreviewSnapshot = new HashSet<ChatType>(Mutable.PrivacyPersistChannels);
|
|
||||||
CleanupPreviewStale = false;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Plugin.Log.Error(e, "Failed to compute cleanup preview");
|
|
||||||
WrapperUtil.AddNotification(HellionStrings.Cleanup_PreviewError, NotificationType.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void StartCleanup()
|
|
||||||
{
|
|
||||||
if (CleanupRunning)
|
|
||||||
return;
|
|
||||||
|
|
||||||
CleanupRunning = true;
|
|
||||||
var allowed = Plugin.Config.PrivacyPersistChannels.Select(t => (int)(ushort)t).ToList();
|
|
||||||
|
|
||||||
new Thread(() =>
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var deleted = Plugin.MessageManager.Store.CleanupRetainOnly(allowed);
|
|
||||||
Plugin.Log.Information($"Privacy cleanup: deleted {deleted} messages");
|
|
||||||
|
|
||||||
Plugin.Framework.Run(() =>
|
|
||||||
{
|
|
||||||
Plugin.MessageManager.ClearAllTabs();
|
|
||||||
Plugin.MessageManager.FilterAllTabsAsync();
|
|
||||||
}).Wait();
|
|
||||||
|
|
||||||
WrapperUtil.AddNotification(string.Format(HellionStrings.Cleanup_Success, deleted), NotificationType.Success);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Plugin.Log.Error(e, "Privacy cleanup failed");
|
|
||||||
WrapperUtil.AddNotification(HellionStrings.Cleanup_Error, NotificationType.Error);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
CleanupRunning = false;
|
|
||||||
CleanupCounts = null;
|
|
||||||
}
|
|
||||||
}).Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,233 +0,0 @@
|
|||||||
using ChatTwo.Code;
|
|
||||||
using ChatTwo.Resources;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Interface;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
using Dalamud.Game.ClientState.Objects.SubKinds;
|
|
||||||
|
|
||||||
namespace ChatTwo.Ui.SettingsTabs;
|
|
||||||
|
|
||||||
internal sealed class Tabs : ISettingsTab
|
|
||||||
{
|
|
||||||
private Plugin Plugin { get; }
|
|
||||||
private Configuration Mutable { get; }
|
|
||||||
|
|
||||||
public string Name => HellionStrings.Settings_Tab_Tabs + "###tabs-tabs";
|
|
||||||
|
|
||||||
private int ToOpen = -2;
|
|
||||||
|
|
||||||
internal Tabs(Plugin plugin, Configuration mutable)
|
|
||||||
{
|
|
||||||
Plugin = plugin;
|
|
||||||
Mutable = mutable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Draw(bool changed)
|
|
||||||
{
|
|
||||||
const string addTabPopup = "add-tab-popup";
|
|
||||||
|
|
||||||
ImGuiUtil.HelpText(HellionStrings.Tabs_Presets_Linkshell_Hint);
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.Plus, tooltip: Language.Options_Tabs_Add))
|
|
||||||
ImGui.OpenPopup(addTabPopup);
|
|
||||||
|
|
||||||
using (var popup = ImRaii.Popup(addTabPopup))
|
|
||||||
{
|
|
||||||
if (popup)
|
|
||||||
{
|
|
||||||
if (ImGui.Selectable(Language.Options_Tabs_NewTab))
|
|
||||||
Mutable.Tabs.Add(new Tab());
|
|
||||||
|
|
||||||
ImGui.Separator();
|
|
||||||
|
|
||||||
if (ImGui.Selectable(string.Format(Language.Options_Tabs_Preset, Language.Tabs_Presets_General)))
|
|
||||||
Mutable.Tabs.Add(TabsUtil.VanillaGeneral);
|
|
||||||
|
|
||||||
if (ImGui.Selectable(string.Format(Language.Options_Tabs_Preset, Language.Tabs_Presets_Event)))
|
|
||||||
Mutable.Tabs.Add(TabsUtil.VanillaEvent);
|
|
||||||
|
|
||||||
if (ImGui.Selectable(string.Format(Language.Options_Tabs_Preset, Language.Tabs_Presets_Tell)))
|
|
||||||
Mutable.Tabs.Add(TabsUtil.VanillaTellExclusive);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var toRemove = -1;
|
|
||||||
var doOpens = ToOpen > -2;
|
|
||||||
for (var i = 0; i < Mutable.Tabs.Count; i++)
|
|
||||||
{
|
|
||||||
var tab = Mutable.Tabs[i];
|
|
||||||
|
|
||||||
if (doOpens)
|
|
||||||
ImGui.SetNextItemOpen(i == ToOpen);
|
|
||||||
|
|
||||||
using var treeNode = ImRaii.TreeNode($"{tab.Name}###tab-{i}");
|
|
||||||
if (!treeNode.Success)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
using var pushedId = ImRaii.PushId($"tab-{i}");
|
|
||||||
|
|
||||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.TrashAlt, tooltip: Language.Options_Tabs_Delete))
|
|
||||||
{
|
|
||||||
toRemove = i;
|
|
||||||
ToOpen = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.ArrowUp, tooltip: Language.Options_Tabs_MoveUp) && i > 0)
|
|
||||||
{
|
|
||||||
(Mutable.Tabs[i - 1], Mutable.Tabs[i]) = (Mutable.Tabs[i], Mutable.Tabs[i - 1]);
|
|
||||||
ToOpen = i - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.ArrowDown, tooltip: Language.Options_Tabs_MoveDown) && i < Mutable.Tabs.Count - 1)
|
|
||||||
{
|
|
||||||
(Mutable.Tabs[i + 1], Mutable.Tabs[i]) = (Mutable.Tabs[i], Mutable.Tabs[i + 1]);
|
|
||||||
ToOpen = i + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.InputText(Language.Options_Tabs_Name, ref tab.Name, 512, ImGuiInputTextFlags.EnterReturnsTrue);
|
|
||||||
ImGui.Checkbox(Language.Options_Tabs_ShowTimestamps, ref tab.DisplayTimestamp);
|
|
||||||
ImGui.Checkbox(Language.Options_Tabs_PopOut, ref tab.PopOut);
|
|
||||||
if (tab.PopOut)
|
|
||||||
{
|
|
||||||
using var _ = ImRaii.PushIndent(10.0f);
|
|
||||||
ImGui.Checkbox(Language.Options_Tabs_IndependentOpacity, ref tab.IndependentOpacity);
|
|
||||||
if (tab.IndependentOpacity)
|
|
||||||
ImGuiUtil.DragFloatVertical(Language.Options_Tabs_Opacity, ref tab.Opacity, 0.25f, 0f, 100f, $"{tab.Opacity:N2}%%", ImGuiSliderFlags.AlwaysClamp);
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_Tabs_IndependentHide, ref tab.IndependentHide);
|
|
||||||
if (tab.IndependentHide)
|
|
||||||
{
|
|
||||||
using var __ = ImRaii.PushIndent(10.0f);
|
|
||||||
ImGuiUtil.OptionCheckbox(ref tab.HideDuringCutscenes, Language.Options_HideDuringCutscenes_Name);
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref tab.HideWhenNotLoggedIn, Language.Options_HideWhenNotLoggedIn_Name);
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref tab.HideWhenUiHidden, Language.Options_HideWhenUiHidden_Name);
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref tab.HideInLoadingScreens, Language.Options_HideInLoadingScreens_Name);
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref tab.HideInBattle, Language.Options_HideInBattle_Name);
|
|
||||||
ImGui.Spacing();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref tab.CanMove, Language.Popout_CanMove_Name);
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref tab.CanResize, Language.Popout_CanResize_Name);
|
|
||||||
ImGui.Spacing();
|
|
||||||
}
|
|
||||||
|
|
||||||
using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_Tabs_UnreadMode, tab.UnreadMode.Name()))
|
|
||||||
{
|
|
||||||
if (combo.Success)
|
|
||||||
{
|
|
||||||
foreach (var mode in Enum.GetValues<UnreadMode>())
|
|
||||||
{
|
|
||||||
if (ImGui.Selectable(mode.Name(), tab.UnreadMode == mode))
|
|
||||||
tab.UnreadMode = mode;
|
|
||||||
|
|
||||||
if (mode.Tooltip() is { } tooltip && ImGui.IsItemHovered())
|
|
||||||
ImGuiUtil.Tooltip(tooltip);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Mutable.HideWhenInactive)
|
|
||||||
ImGui.Checkbox(Language.Options_Tabs_InactivityBehaviour, ref tab.UnhideOnActivity);
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_Tabs_NoInput, ref tab.InputDisabled);
|
|
||||||
if (!tab.InputDisabled)
|
|
||||||
{
|
|
||||||
var input = tab.Channel?.ToChatType().Name() ?? Language.Options_Tabs_NoInputChannel;
|
|
||||||
using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_Tabs_InputChannel, input))
|
|
||||||
{
|
|
||||||
if (combo.Success)
|
|
||||||
{
|
|
||||||
if (ImGui.Selectable(Language.Options_Tabs_NoInputChannel, tab.Channel == null))
|
|
||||||
tab.Channel = null;
|
|
||||||
|
|
||||||
foreach (var channel in Enum.GetValues<InputChannel>())
|
|
||||||
if (ImGui.Selectable(channel.ToChatType().Name(), tab.Channel == channel))
|
|
||||||
tab.Channel = channel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var player = Plugin.ObjectTable.LocalPlayer;
|
|
||||||
if (tab.Channel == InputChannel.Tell && player != null)
|
|
||||||
{
|
|
||||||
ImGui.Checkbox(Language.Options_Tabs_SenderMessages, ref tab.AllSenderMessages);
|
|
||||||
ImGuiUtil.HelpText(Language.Options_Help_SenderMessages);
|
|
||||||
|
|
||||||
var worlds = Sheets.WorldsOnDatacenter(player).OrderByDescending(world => world.DataCenter.RowId).ThenBy(world => world.Name.ToString()).ToList();
|
|
||||||
|
|
||||||
using (ImRaii.ItemWidth(ImGui.GetWindowWidth() / 3f))
|
|
||||||
{
|
|
||||||
ImGui.Text(Language.Options_Header_Target);
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
var name = tab.TellTarget.Name;
|
|
||||||
if (ImGui.InputText("##targetInput", ref name, 21))
|
|
||||||
tab.TellTarget.Name = name;
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
var selectedWorld = worlds.FindIndex(world => world.RowId == tab.TellTarget.World);
|
|
||||||
if (selectedWorld == -1)
|
|
||||||
selectedWorld = 0;
|
|
||||||
|
|
||||||
using (var combo = ImRaii.Combo("###player-world", worlds[selectedWorld].Name.ToString()))
|
|
||||||
{
|
|
||||||
if (combo.Success)
|
|
||||||
{
|
|
||||||
var lastDc = worlds.First().DataCenter.RowId;
|
|
||||||
foreach (var (idx, world) in worlds.Index())
|
|
||||||
{
|
|
||||||
if (ImGui.Selectable(world.Name.ToString(), selectedWorld == idx))
|
|
||||||
{
|
|
||||||
selectedWorld = idx;
|
|
||||||
tab.TellTarget.World = worlds[selectedWorld].RowId;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lastDc == world.DataCenter.RowId)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
lastDc = world.DataCenter.RowId;
|
|
||||||
ImGui.Separator();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var target = (Plugin.TargetManager.SoftTarget ?? Plugin.TargetManager.Target) as IPlayerCharacter;
|
|
||||||
using (ImRaii.Disabled(target == null))
|
|
||||||
{
|
|
||||||
if (ImGui.Button("Set to target") && target != null)
|
|
||||||
tab.TellTarget.FromTarget(target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGuiUtil.ChannelSelector(Language.Options_Tabs_Channels, tab.SelectedChannels);
|
|
||||||
ImGuiUtil.ExtraChatSelector(Language.Options_Tabs_ExtraChatChannels, ref tab.ExtraChatAll, tab.ExtraChatChannels);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (toRemove > -1)
|
|
||||||
{
|
|
||||||
Mutable.Tabs.RemoveAt(toRemove);
|
|
||||||
Plugin.WantedTab = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (doOpens)
|
|
||||||
ToOpen = -2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,163 +0,0 @@
|
|||||||
using ChatTwo.Resources;
|
|
||||||
using ChatTwo.Util;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Bindings.ImGui;
|
|
||||||
|
|
||||||
namespace ChatTwo.Ui.SettingsTabs;
|
|
||||||
|
|
||||||
internal sealed class Window : ISettingsTab
|
|
||||||
{
|
|
||||||
private Plugin Plugin { get; }
|
|
||||||
private Configuration Mutable { get; }
|
|
||||||
|
|
||||||
public string Name => HellionStrings.Settings_Tab_Window + "###tabs-window";
|
|
||||||
|
|
||||||
internal Window(Plugin plugin, Configuration mutable)
|
|
||||||
{
|
|
||||||
Plugin = plugin;
|
|
||||||
Mutable = mutable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Draw(bool changed)
|
|
||||||
{
|
|
||||||
DrawHideSection();
|
|
||||||
ImGui.Spacing();
|
|
||||||
DrawInactivityHideSection();
|
|
||||||
ImGui.Spacing();
|
|
||||||
DrawFrameSection();
|
|
||||||
ImGui.Spacing();
|
|
||||||
DrawTooltipsSection();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawHideSection()
|
|
||||||
{
|
|
||||||
using var tree = ImRaii.TreeNode(HellionStrings.Settings_Window_Hide_Heading);
|
|
||||||
if (!tree.Success)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
ImGui.Checkbox(Language.Options_HideChat_Name, ref Mutable.HideChat);
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_HideChat_Description);
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_HideDuringCutscenes_Name, ref Mutable.HideDuringCutscenes);
|
|
||||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_HideDuringCutscenes_Description, Plugin.PluginName));
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_HideWhenNotLoggedIn_Name, ref Mutable.HideWhenNotLoggedIn);
|
|
||||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_HideWhenNotLoggedIn_Description, Plugin.PluginName));
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_HideWhenUiHidden_Name, ref Mutable.HideWhenUiHidden);
|
|
||||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_HideWhenUiHidden_Description, Plugin.PluginName));
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_HideInLoadingScreens_Name, ref Mutable.HideInLoadingScreens);
|
|
||||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_HideInLoadingScreens_Description, Plugin.PluginName));
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_HideInBattle_Name, ref Mutable.HideInBattle);
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_HideInBattle_Description);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawInactivityHideSection()
|
|
||||||
{
|
|
||||||
using var tree = ImRaii.TreeNode(HellionStrings.Settings_Window_InactivityHide_Heading);
|
|
||||||
if (!tree.Success)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
ImGui.Checkbox(Language.Options_HideWhenInactive_Name, ref Mutable.HideWhenInactive);
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_HideWhenInactive_Description);
|
|
||||||
|
|
||||||
if (!Mutable.HideWhenInactive)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGuiUtil.InputIntVertical(Language.Options_InactivityHideTimeout_Name, Language.Options_InactivityHideTimeout_Description, ref Mutable.InactivityHideTimeout, 1, 10);
|
|
||||||
// Untergrenze von 2 Sekunden gegen Selbst-Soft-Lock.
|
|
||||||
Mutable.InactivityHideTimeout = Math.Max(2, Mutable.InactivityHideTimeout);
|
|
||||||
|
|
||||||
using (ImRaii.Disabled(Mutable.HideInBattle))
|
|
||||||
{
|
|
||||||
ImGui.Checkbox(Language.Options_InactivityHideActiveDuringBattle_Name, ref Mutable.InactivityHideActiveDuringBattle);
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_InactivityHideActiveDuringBattle_Description);
|
|
||||||
}
|
|
||||||
|
|
||||||
using var channelTree = ImRaii.TreeNode(Language.Options_InactivityHideChannels_Name);
|
|
||||||
if (!channelTree.Success)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGuiUtil.CtrlShiftButton(Language.Options_InactivityHideChannels_All_Label, Language.Options_InactivityHideChannels_Button_Tooltip))
|
|
||||||
{
|
|
||||||
Mutable.InactivityHideChannelsV2 = TabsUtil.AllChannels();
|
|
||||||
Mutable.InactivityHideExtraChatAll = true;
|
|
||||||
Mutable.InactivityHideExtraChatChannels = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
if (ImGuiUtil.CtrlShiftButton(Language.Options_InactivityHideChannels_None_Label, Language.Options_InactivityHideChannels_Button_Tooltip))
|
|
||||||
{
|
|
||||||
Mutable.InactivityHideChannelsV2 = [];
|
|
||||||
Mutable.InactivityHideExtraChatAll = false;
|
|
||||||
Mutable.InactivityHideExtraChatChannels = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.Spacing();
|
|
||||||
|
|
||||||
ImGuiUtil.ChannelSelector(Language.Options_Tabs_Channels, Mutable.InactivityHideChannelsV2);
|
|
||||||
ImGuiUtil.ExtraChatSelector(Language.Options_Tabs_ExtraChatChannels, ref Mutable.InactivityHideExtraChatAll, Mutable.InactivityHideExtraChatChannels);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawFrameSection()
|
|
||||||
{
|
|
||||||
using var tree = ImRaii.TreeNode(HellionStrings.Settings_Window_Frame_Heading);
|
|
||||||
if (!tree.Success)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
ImGui.Checkbox(Language.Options_CanMove_Name, ref Mutable.CanMove);
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_CanResize_Name, ref Mutable.CanResize);
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_ShowTitleBar_Name, ref Mutable.ShowTitleBar);
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_ShowPopOutTitleBar_Name, ref Mutable.ShowPopOutTitleBar);
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_ShowHideButton_Name, ref Mutable.ShowHideButton);
|
|
||||||
ImGuiUtil.HelpMarker(Language.Options_ShowHideButton_Description);
|
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Options_SidebarTabView_Name, ref Mutable.SidebarTabView);
|
|
||||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_SidebarTabView_Description, Plugin.PluginName));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawTooltipsSection()
|
|
||||||
{
|
|
||||||
using var tree = ImRaii.TreeNode(HellionStrings.Settings_Window_Tooltips_Heading);
|
|
||||||
if (!tree.Success)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false))
|
|
||||||
{
|
|
||||||
ImGui.Checkbox(Language.Options_NativeItemTooltips_Name, ref Mutable.NativeItemTooltips);
|
|
||||||
ImGuiUtil.HelpMarker(string.Format(Language.Options_NativeItemTooltips_Description, Plugin.PluginName));
|
|
||||||
|
|
||||||
if (Mutable.NativeItemTooltips)
|
|
||||||
{
|
|
||||||
ImGuiUtil.DragFloatVertical(Language.Options_TooltipOffset_Name, Language.Options_TooltipOffset_Desc, ref Mutable.TooltipOffset, 1, 0f, 400f, $"{Mutable.TooltipOffset:N0}px", ImGuiSliderFlags.AlwaysClamp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
using System.Buffers.Binary;
|
|
||||||
using System.Numerics;
|
|
||||||
|
|
||||||
namespace ChatTwo.Util;
|
|
||||||
|
|
||||||
internal static class ColourUtil {
|
|
||||||
private static (byte r, byte g, byte b) RgbaToRgbComponents(uint rgba)
|
|
||||||
{
|
|
||||||
var r = (byte) ((rgba & 0xFF000000) >> 24);
|
|
||||||
var g = (byte) ((rgba & 0xFF0000) >> 16);
|
|
||||||
var b = (byte) ((rgba & 0xFF00) >> 8);
|
|
||||||
return (r, g, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static uint RgbaToAbgr(uint rgba) => BinaryPrimitives.ReverseEndianness(rgba);
|
|
||||||
|
|
||||||
internal static Vector3 RgbaToVector3(uint rgba)
|
|
||||||
{
|
|
||||||
var (r, g, b) = RgbaToRgbComponents(rgba);
|
|
||||||
return new Vector3((float) r / 255, (float) g / 255, (float) b / 255);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static uint Vector3ToRgba(Vector3 col)
|
|
||||||
{
|
|
||||||
return ComponentsToRgba(
|
|
||||||
(byte) Math.Round(col.X * 255),
|
|
||||||
(byte) Math.Round(col.Y * 255),
|
|
||||||
(byte) Math.Round(col.Z * 255)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static uint Vector4ToAbgr(Vector4 col)
|
|
||||||
{
|
|
||||||
return RgbaToAbgr(ComponentsToRgba(
|
|
||||||
(byte) Math.Round(col.X * 255),
|
|
||||||
(byte) Math.Round(col.Y * 255),
|
|
||||||
(byte) Math.Round(col.Z * 255),
|
|
||||||
(byte) Math.Round(col.W * 255)
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static unsafe uint ArgbToRgba(uint x)
|
|
||||||
{
|
|
||||||
var buf = (byte*)&x;
|
|
||||||
(buf[1], buf[2], buf[3], buf[0]) = (buf[0], buf[1], buf[2], buf[3]);
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static uint ComponentsToRgba(byte red, byte green, byte blue, byte alpha = 0xFF)
|
|
||||||
=> alpha | (uint) (red << 24) | (uint) (green << 16) | (uint) (blue << 8);
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
using System.Numerics;
|
|
||||||
|
|
||||||
namespace ChatTwo.Util;
|
|
||||||
|
|
||||||
public static class MathUtil
|
|
||||||
{
|
|
||||||
public record Rectangle
|
|
||||||
{
|
|
||||||
public int X;
|
|
||||||
public int Y;
|
|
||||||
public int Width;
|
|
||||||
public int Height;
|
|
||||||
|
|
||||||
public int SizeX;
|
|
||||||
public int SizeY;
|
|
||||||
|
|
||||||
public Rectangle(int x, int y, int width, int height)
|
|
||||||
{
|
|
||||||
X = x;
|
|
||||||
Y = y;
|
|
||||||
Width = width;
|
|
||||||
Height = height;
|
|
||||||
|
|
||||||
SizeX = X + Width;
|
|
||||||
SizeY = Y + Height;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Rectangle(Vector2 pos, Vector2 size) : this((int) pos.X, (int) pos.Y, (int) size.X, (int) size.Y) { }
|
|
||||||
|
|
||||||
public override string ToString()
|
|
||||||
=> $"X: {X} Y: {Y} Width: {Width} Height: {Height}";
|
|
||||||
}
|
|
||||||
|
|
||||||
// From: https://stackoverflow.com/a/306379
|
|
||||||
/// <summary>
|
|
||||||
/// Checks if two rectangles overlap at any point.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="a"></param>
|
|
||||||
/// <param name="b"></param>
|
|
||||||
/// <returns>True if overlapping</returns>
|
|
||||||
public static bool HasOverlap(this Rectangle a, Rectangle b)
|
|
||||||
{
|
|
||||||
bool ValueInRange(int value, int min, int max)
|
|
||||||
=> value > min && value < max;
|
|
||||||
|
|
||||||
var xOverlap = ValueInRange(a.X, b.X, b.X + b.Width) || ValueInRange(b.X, a.X, a.X + a.Width);
|
|
||||||
var yOverlap = ValueInRange(a.Y, b.Y, b.Y + b.Height) || ValueInRange(b.Y, a.Y, a.Y + a.Height);
|
|
||||||
|
|
||||||
return xOverlap && yOverlap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace ChatTwo.Util;
|
|
||||||
|
|
||||||
public static class MemoryUtil
|
|
||||||
{
|
|
||||||
public static unsafe void PrintMemoryArea(nint address, int length)
|
|
||||||
{
|
|
||||||
var ptr = (byte*)address;
|
|
||||||
var str = new StringBuilder("\n");
|
|
||||||
for(var i = 0; i < length; i++)
|
|
||||||
{
|
|
||||||
str.Append($"{ptr![i]:X02}");
|
|
||||||
|
|
||||||
if (i == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ((i+1) % 16 == 0)
|
|
||||||
str.Append('\n');
|
|
||||||
else if ((i+1) % 4 == 0)
|
|
||||||
str.Append(' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
Plugin.Log.Information(str.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace ChatTwo.Util;
|
|
||||||
|
|
||||||
internal static class StringUtil
|
|
||||||
{
|
|
||||||
internal static byte[] ToTerminatedBytes(this string s)
|
|
||||||
{
|
|
||||||
var utf8 = Encoding.UTF8;
|
|
||||||
var bytes = new byte[utf8.GetByteCount(s) + 1];
|
|
||||||
utf8.GetBytes(s, 0, s.Length, bytes, 0);
|
|
||||||
bytes[^1] = 0;
|
|
||||||
return bytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Taken from https://stackoverflow.com/a/4975942
|
|
||||||
internal static string BytesToString(long byteCount)
|
|
||||||
{
|
|
||||||
string[] suf = ["B", "KB", "MB", "GB", "TB", "PB", "EB"]; // Longs run out around EB
|
|
||||||
if (byteCount == 0)
|
|
||||||
return "0" + suf[0];
|
|
||||||
|
|
||||||
var bytes = Math.Abs(byteCount);
|
|
||||||
var place = Convert.ToInt32(Math.Floor(Math.Log(bytes, 1024)));
|
|
||||||
var num = Math.Round(bytes / Math.Pow(1024, place), 1);
|
|
||||||
return (Math.Sign(byteCount) * num).ToString("N0") + suf[place];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,224 +0,0 @@
|
|||||||
using ChatTwo.Code;
|
|
||||||
using ChatTwo.Resources;
|
|
||||||
|
|
||||||
namespace ChatTwo.Util;
|
|
||||||
|
|
||||||
public static class TabsUtil
|
|
||||||
{
|
|
||||||
public static Dictionary<ChatType, (ChatSource, ChatSource)> AllChannels()
|
|
||||||
{
|
|
||||||
var channels = new Dictionary<ChatType, (ChatSource, ChatSource)>();
|
|
||||||
foreach (var chatType in Enum.GetValues<ChatType>())
|
|
||||||
channels[chatType] = (ChatSourceExt.All, ChatSourceExt.All);
|
|
||||||
|
|
||||||
return channels;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hellion-tuned General preset. The pure player-talk catch-all plus
|
|
||||||
// the active-gameplay event streams (loot, crafting, gathering, NPC
|
|
||||||
// dialogue, party-finder pings). Pure technical noise (System, Error,
|
|
||||||
// Login/Logout spam, retainer sales, alarms, sign messages) lives in
|
|
||||||
// the dedicated System tab so it doesn't bury actual conversation.
|
|
||||||
public static Tab VanillaGeneral => new()
|
|
||||||
{
|
|
||||||
Name = Language.Tabs_Presets_General,
|
|
||||||
SelectedChannels = new Dictionary<ChatType, (ChatSource, ChatSource)>
|
|
||||||
{
|
|
||||||
// Player chat
|
|
||||||
[ChatType.Say] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Yell] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Shout] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Party] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossParty] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Alliance] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.FreeCompany] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.PvpTeam] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell1] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell2] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell3] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell4] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell5] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell6] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell7] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell8] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell1] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell2] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell3] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell4] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell5] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell6] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell7] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell8] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
// Active-gameplay events
|
|
||||||
[ChatType.NpcDialogue] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.LootNotice] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.LootRoll] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Crafting] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Gathering] = (ChatSource.LocalPlayer, ChatSource.LocalPlayer),
|
|
||||||
[ChatType.PeriodicRecruitmentNotification] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public static Tab VanillaEvent => new()
|
|
||||||
{
|
|
||||||
Name = Language.Tabs_Presets_Event,
|
|
||||||
SelectedChannels = new Dictionary<ChatType, (ChatSource, ChatSource)> { [ChatType.NpcDialogue] = (ChatSourceExt.All, ChatSourceExt.All), },
|
|
||||||
};
|
|
||||||
|
|
||||||
public static Tab VanillaTellExclusive => new()
|
|
||||||
{
|
|
||||||
Name = Language.Tabs_Presets_Tell,
|
|
||||||
SelectedChannels = new Dictionary<ChatType, (ChatSource, ChatSource)>
|
|
||||||
{
|
|
||||||
[ChatType.TellIncoming] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.TellOutgoing] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
},
|
|
||||||
Channel = InputChannel.Tell,
|
|
||||||
AllSenderMessages = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Hellion default-tab presets used by the v10 wipe migration. Names are
|
|
||||||
// kept in HellionStrings (EN+DE) instead of Language.* so the upstream
|
|
||||||
// resource files stay untouched. Channel selections cover the channels
|
|
||||||
// a typical Eorzea raider uses without forcing the user to hand-tick
|
|
||||||
// each box on first start.
|
|
||||||
public static Tab HellionFreeCompany => new()
|
|
||||||
{
|
|
||||||
Name = HellionStrings.Tabs_Presets_FreeCompany,
|
|
||||||
SelectedChannels = new Dictionary<ChatType, (ChatSource, ChatSource)>
|
|
||||||
{
|
|
||||||
[ChatType.FreeCompany] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.FreeCompanyAnnouncement] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.FreeCompanyLoginLogout] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
},
|
|
||||||
Channel = InputChannel.FreeCompany,
|
|
||||||
};
|
|
||||||
|
|
||||||
public static Tab HellionParty => new()
|
|
||||||
{
|
|
||||||
Name = HellionStrings.Tabs_Presets_Party,
|
|
||||||
SelectedChannels = new Dictionary<ChatType, (ChatSource, ChatSource)>
|
|
||||||
{
|
|
||||||
[ChatType.Party] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossParty] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Alliance] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.PvpTeam] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.PvpTeamAnnouncement] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.PvpTeamLoginLogout] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.LootNotice] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.LootRoll] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
},
|
|
||||||
Channel = InputChannel.Party,
|
|
||||||
};
|
|
||||||
|
|
||||||
public static Tab HellionBeginner => new()
|
|
||||||
{
|
|
||||||
Name = HellionStrings.Tabs_Presets_Beginner,
|
|
||||||
SelectedChannels = new Dictionary<ChatType, (ChatSource, ChatSource)>
|
|
||||||
{
|
|
||||||
[ChatType.NoviceNetwork] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.NoviceNetworkSystem] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
},
|
|
||||||
Channel = InputChannel.NoviceNetwork,
|
|
||||||
};
|
|
||||||
|
|
||||||
public static Tab HellionSystem => new()
|
|
||||||
{
|
|
||||||
Name = HellionStrings.Tabs_Presets_System,
|
|
||||||
SelectedChannels = new Dictionary<ChatType, (ChatSource, ChatSource)>
|
|
||||||
{
|
|
||||||
[ChatType.Debug] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Urgent] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Notice] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.System] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Error] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Echo] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.GatheringSystem] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.NoviceNetworkSystem] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.NpcAnnouncement] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.FreeCompanyLoginLogout] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.PvpTeamLoginLogout] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.RetainerSale] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Progress] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.RandomNumber] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Orchestrion] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.MessageBook] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Alarm] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Sign] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.GlamourNotifications] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
public static Tab HellionLinkshell => new()
|
|
||||||
{
|
|
||||||
Name = HellionStrings.Tabs_Presets_Linkshell,
|
|
||||||
SelectedChannels = new Dictionary<ChatType, (ChatSource, ChatSource)>
|
|
||||||
{
|
|
||||||
[ChatType.Linkshell1] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell2] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell3] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell4] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell5] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell6] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell7] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell8] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell1] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell2] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell3] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell4] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell5] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell6] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell7] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell8] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
public static Dictionary<ChatType, (ChatSource, ChatSource)> MostlyPlayer => new()
|
|
||||||
{
|
|
||||||
// Special
|
|
||||||
[ChatType.Debug] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Urgent] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Notice] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
// Chat
|
|
||||||
[ChatType.Say] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Yell] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Shout] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.TellIncoming] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.TellOutgoing] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Party] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossParty] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Alliance] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.FreeCompany] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.PvpTeam] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell1] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell2] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell3] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell4] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell5] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell6] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell7] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CrossLinkshell8] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell1] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell2] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell3] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell4] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell5] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell6] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell7] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Linkshell8] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.NoviceNetwork] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.StandardEmote] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.CustomEmote] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
// Announcements
|
|
||||||
[ChatType.System] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Error] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.Echo] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.NoviceNetworkSystem] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.FreeCompanyAnnouncement] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.PvpTeamAnnouncement] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.FreeCompanyLoginLogout] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.PvpTeamLoginLogout] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.RandomNumber] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
[ChatType.MessageBook] = (ChatSourceExt.All, ChatSourceExt.All),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
using ChatTwo.Resources;
|
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
|
||||||
|
|
||||||
namespace ChatTwo.Util;
|
|
||||||
|
|
||||||
public static class WrapperUtil
|
|
||||||
{
|
|
||||||
public static void AddNotification(string content, NotificationType type, bool minimized = true)
|
|
||||||
{
|
|
||||||
Plugin.Notification.AddNotification(new Notification { Content = content, Type = type, Minimized = minimized });
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void TryOpenUri(Uri uri)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Plugin.Log.Debug($"Opening URI {uri} in default browser");
|
|
||||||
Dalamud.Utility.Util.OpenLink(uri.ToString());
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Plugin.Log.Error($"Error opening URI: {ex}");
|
|
||||||
AddNotification(Language.Context_OpenInBrowserError, NotificationType.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 52 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 53 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 51 KiB |
@@ -1,109 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 1,
|
|
||||||
"dependencies": {
|
|
||||||
"net10.0-windows7.0": {
|
|
||||||
"DalamudPackager": {
|
|
||||||
"type": "Direct",
|
|
||||||
"requested": "[15.0.0, )",
|
|
||||||
"resolved": "15.0.0",
|
|
||||||
"contentHash": "411vwC8/X8Z/sQ2TI6v3SvOn66xFPeOjFn3Zn+h0d3Ox2t1kFm66AhDvmx/qcMwVrR+Hidxj0dadpQ2dgyXMBQ=="
|
|
||||||
},
|
|
||||||
"DotNet.ReproducibleBuilds": {
|
|
||||||
"type": "Direct",
|
|
||||||
"requested": "[1.2.39, )",
|
|
||||||
"resolved": "1.2.39",
|
|
||||||
"contentHash": "fcFN01tDTIQqDuTwr1jUQK/geofiwjG5DycJQOnC72i1SsLAk1ELe+apBOuZ11UMQG8YKFZG1FgvjZPbqHyatg=="
|
|
||||||
},
|
|
||||||
"MessagePack": {
|
|
||||||
"type": "Direct",
|
|
||||||
"requested": "[3.1.4, )",
|
|
||||||
"resolved": "3.1.4",
|
|
||||||
"contentHash": "BH0wlHWmVoZpbAPyyt2Awbq30C+ZsS3eHSkYdnyUAbqVJ22fAJDzn2xTieBeoT5QlcBzp61vHcv878YJGfi3mg==",
|
|
||||||
"dependencies": {
|
|
||||||
"MessagePack.Annotations": "3.1.4",
|
|
||||||
"MessagePackAnalyzer": "3.1.4",
|
|
||||||
"Microsoft.NET.StringTools": "17.11.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Microsoft.Data.Sqlite": {
|
|
||||||
"type": "Direct",
|
|
||||||
"requested": "[9.0.0, )",
|
|
||||||
"resolved": "9.0.0",
|
|
||||||
"contentHash": "lw6wthgXGx3r/U775k1UkUAWIn0kAT0wj4ZRq0WlhPx4WAOiBsIjgDKgWkXcNTGT0KfHiClkM+tyPVFDvxeObw==",
|
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.Data.Sqlite.Core": "9.0.0",
|
|
||||||
"SQLitePCLRaw.bundle_e_sqlite3": "2.1.10",
|
|
||||||
"SQLitePCLRaw.core": "2.1.10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"morelinq": {
|
|
||||||
"type": "Direct",
|
|
||||||
"requested": "[4.4.0, )",
|
|
||||||
"resolved": "4.4.0",
|
|
||||||
"contentHash": "QX3bsK9oFeUXk8tFsc9NkI6NnCr8Ar/ex027p+ZZ/jdLCdX2RlryDtxUqZW5j45NVwn4E4Z4hzupsoMQd6Yxtg=="
|
|
||||||
},
|
|
||||||
"Pidgin": {
|
|
||||||
"type": "Direct",
|
|
||||||
"requested": "[3.3.0, )",
|
|
||||||
"resolved": "3.3.0",
|
|
||||||
"contentHash": "2rvIoIogQG1+vqvXCuz1xiAVljaiacG/wCz/TNpN74TzWw+9iSCjhBLf7kVg24sBi6tArRdrcklHq49ovW2NLA=="
|
|
||||||
},
|
|
||||||
"SixLabors.ImageSharp": {
|
|
||||||
"type": "Direct",
|
|
||||||
"requested": "[3.1.12, )",
|
|
||||||
"resolved": "3.1.12",
|
|
||||||
"contentHash": "iAg6zifihXEFS/t7fiHhZBGAdCp3FavsF4i2ZIDp0JfeYeDVzvmlbY1CNhhIKimaIzrzSi5M/NBFcWvZT2rB/A=="
|
|
||||||
},
|
|
||||||
"MessagePack.Annotations": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "3.1.4",
|
|
||||||
"contentHash": "aVWrDAkCdqxwQsz/q0ldPh2EFn48M99YUzE9OvZjMq2RNLKz4o2z88iGFvSvbMqOWRweRvKPHBJZe22PRqzslQ=="
|
|
||||||
},
|
|
||||||
"MessagePackAnalyzer": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "3.1.4",
|
|
||||||
"contentHash": "CTaSsN/liJ7MhLCAB7Z4ZLBNuVGCq9lt2BT/cbrc9vzGv89yK3CqIA+z9T19a11eQYl9etZHL6MQJgCqECRVpg=="
|
|
||||||
},
|
|
||||||
"Microsoft.Data.Sqlite.Core": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "9.0.0",
|
|
||||||
"contentHash": "cFfZjFL+tqzGYw9lB31EkV1IWF5xRQNk2k+MQd+Cf86Gl6zTeAoiZIFw5sRB1Z8OxpEC7nu+nTDsLSjieBAPTw==",
|
|
||||||
"dependencies": {
|
|
||||||
"SQLitePCLRaw.core": "2.1.10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Microsoft.NET.StringTools": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "17.11.4",
|
|
||||||
"contentHash": "mudqUHhNpeqIdJoUx2YDWZO/I9uEDYVowan89R6wsomfnUJQk6HteoQTlNjZDixhT2B4IXMkMtgZtoceIjLRmA=="
|
|
||||||
},
|
|
||||||
"SQLitePCLRaw.bundle_e_sqlite3": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "2.1.10",
|
|
||||||
"contentHash": "UxWuisvZ3uVcVOLJQv7urM/JiQH+v3TmaJc1BLKl5Dxfm/nTzTUrqswCqg/INiYLi61AXnHo1M1JPmPqqLnAdg==",
|
|
||||||
"dependencies": {
|
|
||||||
"SQLitePCLRaw.lib.e_sqlite3": "2.1.10",
|
|
||||||
"SQLitePCLRaw.provider.e_sqlite3": "2.1.10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"SQLitePCLRaw.core": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "2.1.10",
|
|
||||||
"contentHash": "Ii8JCbC7oiVclaE/mbDEK000EFIJ+ShRPwAvvV89GOZhQ+ZLtlnSWl6ksCNMKu/VGXA4Nfi2B7LhN/QFN9oBcw=="
|
|
||||||
},
|
|
||||||
"SQLitePCLRaw.lib.e_sqlite3": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "2.1.10",
|
|
||||||
"contentHash": "mAr69tDbnf3QJpRy2nJz8Qdpebdil00fvycyByR58Cn9eARvR+UiG2Vzsp+4q1tV3ikwiYIjlXCQFc12GfebbA=="
|
|
||||||
},
|
|
||||||
"SQLitePCLRaw.provider.e_sqlite3": {
|
|
||||||
"type": "Transitive",
|
|
||||||
"resolved": "2.1.10",
|
|
||||||
"contentHash": "uZVTi02C1SxqzgT0HqTWatIbWGb40iIkfc3FpFCpE/r7g6K0PqzDUeefL6P6HPhDtc6BacN3yQysfzP7ks+wSQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"SQLitePCLRaw.core": "2.1.10"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Executable
+31
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HellionChat", "HellionChat\HellionChat.csproj", "{739F75E6-B65F-41EF-9D90-F7BC519E4875}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{739F75E6-B65F-41EF-9D90-F7BC519E4875}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@@ -0,0 +1,523 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
using Dalamud.Game.Text;
|
||||||
|
using Dalamud.Game.Text.SeStringHandling;
|
||||||
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
|
using HellionChat.Code;
|
||||||
|
using HellionChat.GameFunctions.Types;
|
||||||
|
using HellionChat.Resources;
|
||||||
|
using HellionChat.Util;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
namespace HellionChat;
|
||||||
|
|
||||||
|
// Auto-Tell-Tabs: spawns session-only tabs per /tell partner.
|
||||||
|
// Subscribes to MessageManager.MessageProcessed and ClientState.Logout.
|
||||||
|
internal sealed class AutoTellTabsService : IDisposable
|
||||||
|
{
|
||||||
|
private readonly Plugin _plugin;
|
||||||
|
private readonly MessageManager _messageManager;
|
||||||
|
private readonly MessageStore _store;
|
||||||
|
private readonly ILogger<AutoTellTabsService> _logger;
|
||||||
|
private readonly object _tempTabsLock = new();
|
||||||
|
|
||||||
|
// Hard cap on pinned TempTabs so the sidebar doesn't inflate over years
|
||||||
|
// of usage. Separate pool from AutoTellTabsLimit (15) — pinned tabs live
|
||||||
|
// in their own bucket. A configurable cap is a vault-backlog anchor for
|
||||||
|
// a later cycle if tester feedback demands it.
|
||||||
|
internal const int MaxPinnedTempTabs = 5;
|
||||||
|
|
||||||
|
private bool _initialized;
|
||||||
|
|
||||||
|
internal AutoTellTabsService(
|
||||||
|
Plugin plugin,
|
||||||
|
MessageManager messageManager,
|
||||||
|
MessageStore store,
|
||||||
|
ILogger<AutoTellTabsService> logger
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_plugin = plugin;
|
||||||
|
_messageManager = messageManager;
|
||||||
|
_store = store;
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Derived from the tab list on read. Pin/Unpin/Promote/Logout simply
|
||||||
|
// mutate IsPinned or remove tabs — the count adapts automatically.
|
||||||
|
// Replaces the F2.1 Interlocked counter because the new pin-state
|
||||||
|
// transitions are cold-path and don't need lock-free reads.
|
||||||
|
internal int ActiveTempTabCount =>
|
||||||
|
Plugin.Config.Tabs.Count(TabLifecycleHelpers.IsInUnpinnedPool);
|
||||||
|
|
||||||
|
internal int PinnedTempTabCount => Plugin.Config.Tabs.Count(TabLifecycleHelpers.IsInPinnedPool);
|
||||||
|
|
||||||
|
internal void Initialize()
|
||||||
|
{
|
||||||
|
if (_initialized)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pinned tabs come out of the JSON with TellTarget set but
|
||||||
|
// CurrentChannel reset (NonSerialized). Without re-seeding, the chat
|
||||||
|
// input has no tell-target on the active pinned tab, and the
|
||||||
|
// game-side channel hook only repaints CurrentChannel once the user
|
||||||
|
// triggers a /tell or channel switch.
|
||||||
|
RehydratePinnedTabs();
|
||||||
|
|
||||||
|
_messageManager.MessageProcessed += HandleTell;
|
||||||
|
Plugin.ClientState.Logout += OnLogout;
|
||||||
|
_initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RehydratePinnedTabs()
|
||||||
|
{
|
||||||
|
var pinned = Plugin.Config.Tabs.Count(TabLifecycleHelpers.IsInPinnedPool);
|
||||||
|
_logger.LogDebug($"[Pin] Rehydrate scan: {pinned} pinned tab(s) found");
|
||||||
|
|
||||||
|
foreach (var tab in Plugin.Config.Tabs)
|
||||||
|
{
|
||||||
|
if (!TabLifecycleHelpers.IsInPinnedPool(tab))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (tab.TellTarget is null || !tab.TellTarget.IsSet())
|
||||||
|
{
|
||||||
|
_logger.LogWarning(
|
||||||
|
$"[Pin] Pinned tab '{tab.Name}' has no usable TellTarget "
|
||||||
|
+ $"(Name={tab.TellTarget?.Name ?? "<null>"} World={tab.TellTarget?.World ?? 0}). "
|
||||||
|
+ "Chat input on this tab will be empty until the partner sends a tell or you /tell manually."
|
||||||
|
);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
tab.Channel ??= InputChannel.Tell;
|
||||||
|
tab.CurrentChannel.Channel = InputChannel.Tell;
|
||||||
|
tab.CurrentChannel.TellTarget = tab.TellTarget.Clone();
|
||||||
|
|
||||||
|
// MessageList is NonSerialized so pinned tabs come back empty.
|
||||||
|
// Preload the same history window the spawn path uses so the user
|
||||||
|
// sees the recent conversation, not a blank tab.
|
||||||
|
PreloadHistory(tab, tab.TellTarget.Name, tab.TellTarget.World, Guid.Empty);
|
||||||
|
|
||||||
|
_logger.LogDebug(
|
||||||
|
$"[Pin] Rehydrated '{tab.Name}' -> Tell target {tab.TellTarget.Name}@{tab.TellTarget.World}"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (!_initialized)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin.ClientState.Logout -= OnLogout;
|
||||||
|
_messageManager.MessageProcessed -= HandleTell;
|
||||||
|
_initialized = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void HandleTell(Message message)
|
||||||
|
{
|
||||||
|
if (!Plugin.Config.EnableAutoTellTabs)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
message.Code.Type != ChatType.TellIncoming
|
||||||
|
&& message.Code.Type != ChatType.TellOutgoing
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var partner = ExtractTellPartner(message);
|
||||||
|
if (partner == null)
|
||||||
|
{
|
||||||
|
// Diagnostics: helps detect regressions (FFXIV payload changes, new edge cases)
|
||||||
|
_logger.LogWarning(
|
||||||
|
$"[AutoTellTabs] Could not extract tell partner. type={message.Code.Type}, "
|
||||||
|
+ $"senderChunks={message.Sender.Count}, contentChunks={message.Content.Count}, "
|
||||||
|
+ $"senderSourcePayloads={message.SenderSource?.Payloads?.Count ?? 0}, "
|
||||||
|
+ $"contentSourcePayloads={message.ContentSource?.Payloads?.Count ?? 0}"
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
lock (_tempTabsLock)
|
||||||
|
{
|
||||||
|
var existing = FindTempTab(partner.Value.Name, partner.Value.World);
|
||||||
|
if (existing != null)
|
||||||
|
{
|
||||||
|
// Already routed via MessageManager pipeline. Repair the
|
||||||
|
// tell-target if the fallback hit a pinned tab whose
|
||||||
|
// TellTarget didn't survive a previous round-trip — keeps
|
||||||
|
// FindTempTab fast on the next message.
|
||||||
|
if (
|
||||||
|
existing.IsPinned
|
||||||
|
&& (existing.TellTarget is null || !existing.TellTarget.IsSet())
|
||||||
|
)
|
||||||
|
{
|
||||||
|
existing.TellTarget = new TellTarget(
|
||||||
|
partner.Value.Name,
|
||||||
|
partner.Value.World,
|
||||||
|
0,
|
||||||
|
TellReason.Direct
|
||||||
|
);
|
||||||
|
_plugin.SaveConfig();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ActiveTempTabCount >= Plugin.Config.AutoTellTabsLimit)
|
||||||
|
{
|
||||||
|
DropOldestTempTab();
|
||||||
|
}
|
||||||
|
|
||||||
|
SpawnTempTab(partner.Value, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private (string Name, uint World)? ExtractTellPartner(Message message)
|
||||||
|
{
|
||||||
|
if (message.Code.Type == ChatType.TellIncoming)
|
||||||
|
{
|
||||||
|
// Sender is the partner; check chunks first, then raw SeString as fallback
|
||||||
|
var fromSender =
|
||||||
|
ChunkUtil.TryGetPlayerPayload(message.Sender)
|
||||||
|
?? ChunkUtil.TryGetPlayerPayload(message.SenderSource);
|
||||||
|
if (fromSender != null)
|
||||||
|
{
|
||||||
|
return (fromSender.PlayerName, fromSender.World.RowId);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Outgoing tell: check content first, then channels's TellTarget as fallback
|
||||||
|
var fromContent =
|
||||||
|
ChunkUtil.TryGetPlayerPayload(message.Content)
|
||||||
|
?? ChunkUtil.TryGetPlayerPayload(message.ContentSource)
|
||||||
|
?? ChunkUtil.TryGetPlayerPayload(message.Sender)
|
||||||
|
?? ChunkUtil.TryGetPlayerPayload(message.SenderSource);
|
||||||
|
if (fromContent != null)
|
||||||
|
{
|
||||||
|
return (fromContent.PlayerName, fromContent.World.RowId);
|
||||||
|
}
|
||||||
|
|
||||||
|
var current =
|
||||||
|
_plugin.CurrentTab.CurrentChannel.TellTarget
|
||||||
|
?? _plugin.CurrentTab.CurrentChannel.TempTellTarget;
|
||||||
|
if (current != null && current.IsSet())
|
||||||
|
{
|
||||||
|
return (current.Name, current.World);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Tab? FindTempTab(string name, uint world)
|
||||||
|
{
|
||||||
|
var byTarget = Plugin.Config.Tabs.FirstOrDefault(t =>
|
||||||
|
t.IsTempTab
|
||||||
|
&& t.TellTarget != null
|
||||||
|
&& string.Equals(t.TellTarget.Name, name, StringComparison.OrdinalIgnoreCase)
|
||||||
|
&& t.TellTarget.World == world
|
||||||
|
);
|
||||||
|
if (byTarget != null)
|
||||||
|
return byTarget;
|
||||||
|
|
||||||
|
// Fallback: match by tab name. Pinned tabs are named via
|
||||||
|
// FormatTabName(player, world) at spawn time, so the name is a
|
||||||
|
// stable secondary key when TellTarget didn't survive a save/load
|
||||||
|
// (older configs from a renamed pin, malformed migrations, etc.).
|
||||||
|
var expectedName = FormatTabName(name, world);
|
||||||
|
return Plugin.Config.Tabs.FirstOrDefault(t =>
|
||||||
|
t.IsTempTab && string.Equals(t.Name, expectedName, StringComparison.OrdinalIgnoreCase)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void DropOldestTempTab()
|
||||||
|
{
|
||||||
|
// Pinned tabs live in their own bucket (MaxPinnedTempTabs) and are
|
||||||
|
// never drop candidates. They leave the bucket only via Unpin or
|
||||||
|
// PromoteToPermanent.
|
||||||
|
var victim = Plugin
|
||||||
|
.Config.Tabs.Select((tab, idx) => (Tab: tab, Index: idx))
|
||||||
|
.Where(t => TabLifecycleHelpers.IsInUnpinnedPool(t.Tab))
|
||||||
|
.OrderByDescending(t => t.Tab.IsGreeted)
|
||||||
|
.ThenBy(t => t.Tab.LastActivity)
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
if (victim.Tab == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clean up pop-out window if tab is popped out
|
||||||
|
if (victim.Tab.PopOut)
|
||||||
|
{
|
||||||
|
var popout = _plugin.ChatLogWindow.ActivePopouts.FirstOrDefault(p =>
|
||||||
|
p.TabIdentifier == victim.Tab.Identifier
|
||||||
|
);
|
||||||
|
if (popout != null)
|
||||||
|
{
|
||||||
|
popout.IsOpen = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin.Config.Tabs.RemoveAt(victim.Index);
|
||||||
|
|
||||||
|
// Re-anchor active tab to avoid silent switch when tab is dropped
|
||||||
|
if (victim.Index <= _plugin.LastTab)
|
||||||
|
{
|
||||||
|
_plugin.WantedTab = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SpawnTempTab((string Name, uint World) partner, Message currentMessage)
|
||||||
|
{
|
||||||
|
var tab = BuildTempTab(partner.Name, partner.World);
|
||||||
|
|
||||||
|
// Preload history: chronological order with current message already persisted
|
||||||
|
PreloadHistory(tab, partner.Name, partner.World, currentMessage.Id);
|
||||||
|
|
||||||
|
tab.AddMessage(currentMessage, unread: true);
|
||||||
|
|
||||||
|
// Open as pop-out if configured (set before Tabs.Add for next render-tick)
|
||||||
|
if (Plugin.Config.AutoTellTabsOpenAsPopout)
|
||||||
|
{
|
||||||
|
tab.PopOut = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin.Config.Tabs.Add(tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Tab BuildTempTab(string playerName, uint worldRowId)
|
||||||
|
{
|
||||||
|
return new Tab
|
||||||
|
{
|
||||||
|
Name = FormatTabName(playerName, worldRowId),
|
||||||
|
IsTempTab = true,
|
||||||
|
AllSenderMessages = true,
|
||||||
|
TellTarget = new TellTarget(playerName, worldRowId, 0, TellReason.Direct),
|
||||||
|
Channel = InputChannel.Tell,
|
||||||
|
DisplayTimestamp = true,
|
||||||
|
UnreadMode = UnreadMode.Unseen,
|
||||||
|
HideWhenInactive = false,
|
||||||
|
SelectedChannels = new Dictionary<ChatType, (ChatSource, ChatSource)>
|
||||||
|
{
|
||||||
|
[ChatType.TellIncoming] = (ChatSourceExt.All, ChatSourceExt.All),
|
||||||
|
[ChatType.TellOutgoing] = (ChatSourceExt.All, ChatSourceExt.All),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string FormatTabName(string playerName, uint worldRowId)
|
||||||
|
{
|
||||||
|
if (Sheets.WorldSheet.TryGetRow(worldRowId, out var worldRow))
|
||||||
|
{
|
||||||
|
return $"{playerName}@{worldRow.Name}";
|
||||||
|
}
|
||||||
|
// Fallback if world lookup misses (rare; only for unseen worlds)
|
||||||
|
return $"{playerName}@World{worldRowId}";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PreloadHistory(Tab tab, string senderName, uint senderWorld, Guid currentMessageId)
|
||||||
|
{
|
||||||
|
var preloadCount = Plugin.Config.AutoTellTabsHistoryPreload;
|
||||||
|
if (preloadCount <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Pull one extra row: current message is already in store and would eat a preload slot
|
||||||
|
var history = _store.GetTellHistoryWithSender(
|
||||||
|
_messageManager.CurrentContentId,
|
||||||
|
senderName,
|
||||||
|
senderWorld,
|
||||||
|
preloadCount + 1
|
||||||
|
);
|
||||||
|
|
||||||
|
var historicMessages = history
|
||||||
|
.Where(m => m.Id != currentMessageId)
|
||||||
|
.Take(preloadCount)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (historicMessages.Count == 0)
|
||||||
|
{
|
||||||
|
// No prior tells; leave tab empty to avoid orphaned "history loaded" marker
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// History is oldest-first; add in order for chronological display
|
||||||
|
foreach (var message in historicMessages)
|
||||||
|
{
|
||||||
|
tab.Messages.AddPrune(message, MessageManager.MessageDisplayLimit);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Separator between history and live tell (sorts after history but before current)
|
||||||
|
tab.Messages.AddPrune(
|
||||||
|
MakeSystemMarker(HellionStrings.AutoTellTabs_HistorySeparator),
|
||||||
|
MessageManager.MessageDisplayLimit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
// Non-fatal: tab still spawns with visible error notice instead of silent history loss
|
||||||
|
_logger.LogError(ex, "[AutoTellTabs] History preload failed");
|
||||||
|
tab.Messages.AddPrune(
|
||||||
|
MakeSystemMarker(HellionStrings.AutoTellTabs_HistoryLoadError),
|
||||||
|
MessageManager.MessageDisplayLimit
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Message MakeSystemMarker(string text)
|
||||||
|
{
|
||||||
|
var seString = new SeStringBuilder().AddText(text).Build();
|
||||||
|
var chunks = ChunkUtil.ToChunks(seString, ChunkSource.Content, ChatType.System).ToList();
|
||||||
|
var code = new ChatCode((XivChatType)ChatType.System, 0, 0);
|
||||||
|
return Message.FakeMessage(chunks, code);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void MarkGreeted(Tab tab)
|
||||||
|
{
|
||||||
|
SetGreeted(tab, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void UnmarkGreeted(Tab tab)
|
||||||
|
{
|
||||||
|
SetGreeted(tab, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal bool IsGreeted(Tab tab)
|
||||||
|
{
|
||||||
|
return tab.IsGreeted;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetGreeted(Tab tab, bool greeted)
|
||||||
|
{
|
||||||
|
if (tab == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
lock (_tempTabsLock)
|
||||||
|
{
|
||||||
|
// Guard against frame-race: sidebar might render a tab already removed by LRU or logout
|
||||||
|
if (!Plugin.Config.Tabs.Contains(tab))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
tab.IsGreeted = greeted;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnLogout(int type, int code)
|
||||||
|
{
|
||||||
|
lock (_tempTabsLock)
|
||||||
|
{
|
||||||
|
// Pinned TempTabs must survive char-switch — that's the whole point
|
||||||
|
// of pinning. Only unpinned ones get stripped.
|
||||||
|
var lastIndex = _plugin.LastTab;
|
||||||
|
var lastIndexValid = lastIndex >= 0 && lastIndex < Plugin.Config.Tabs.Count;
|
||||||
|
var currentWasUnpinnedTempTab =
|
||||||
|
lastIndexValid
|
||||||
|
&& TabLifecycleHelpers.IsInUnpinnedPool(Plugin.Config.Tabs[lastIndex]);
|
||||||
|
|
||||||
|
var poppedTempTabIds = Plugin
|
||||||
|
.Config.Tabs.Where(t => TabLifecycleHelpers.IsInUnpinnedPool(t) && t.PopOut)
|
||||||
|
.Select(t => t.Identifier)
|
||||||
|
.ToList();
|
||||||
|
if (poppedTempTabIds.Count > 0)
|
||||||
|
{
|
||||||
|
var poppedSet = poppedTempTabIds.ToHashSet();
|
||||||
|
foreach (
|
||||||
|
var popout in _plugin
|
||||||
|
.ChatLogWindow.ActivePopouts.Where(p => poppedSet.Contains(p.TabIdentifier))
|
||||||
|
.ToList()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
popout.IsOpen = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin.Config.Tabs.RemoveAll(TabLifecycleHelpers.IsInUnpinnedPool);
|
||||||
|
|
||||||
|
// Force switch to tab 0 if active tab was an unpinned temp tab or
|
||||||
|
// index is now out of range. Pinned tabs survive — no switch needed.
|
||||||
|
var stillValid = lastIndex >= 0 && lastIndex < Plugin.Config.Tabs.Count;
|
||||||
|
if (currentWasUnpinnedTempTab || !stillValid)
|
||||||
|
{
|
||||||
|
_plugin.WantedTab = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal bool TryPin(Tab tab)
|
||||||
|
{
|
||||||
|
if (!tab.IsTempTab || tab.IsPinned)
|
||||||
|
{
|
||||||
|
_logger.LogDebug(
|
||||||
|
$"[Pin] TryPin skipped: IsTempTab={tab.IsTempTab} IsPinned={tab.IsPinned}"
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PinnedTempTabCount >= MaxPinnedTempTabs)
|
||||||
|
{
|
||||||
|
WrapperUtil.AddNotification(
|
||||||
|
string.Format(HellionStrings.PinTab_LimitReached, MaxPinnedTempTabs),
|
||||||
|
NotificationType.Warning
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
tab.IsPinned = true;
|
||||||
|
_logger.LogDebug(
|
||||||
|
$"[Pin] Pinned tab '{tab.Name}' target={tab.TellTarget?.Name}@{tab.TellTarget?.World}"
|
||||||
|
);
|
||||||
|
_plugin.SaveConfig();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void Unpin(Tab tab)
|
||||||
|
{
|
||||||
|
if (!tab.IsPinned)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the unpinned pool is already full, dropping the oldest before
|
||||||
|
// flipping the flag avoids counting the just-unpinned tab as a drop
|
||||||
|
// candidate.
|
||||||
|
if (ActiveTempTabCount >= Plugin.Config.AutoTellTabsLimit)
|
||||||
|
{
|
||||||
|
DropOldestTempTab();
|
||||||
|
}
|
||||||
|
|
||||||
|
tab.IsPinned = false;
|
||||||
|
_logger.LogDebug("[Pin] Unpinned tab '{TabName}'", tab.Name);
|
||||||
|
_plugin.SaveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void PromoteToPermanent(Tab tab)
|
||||||
|
{
|
||||||
|
if (!tab.IsTempTab)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
tab.IsTempTab = false;
|
||||||
|
tab.IsPinned = false;
|
||||||
|
tab.TellTarget = TellTarget.Empty();
|
||||||
|
_logger.LogDebug($"[Pin] Promoted tab '{tab.Name}' to permanent (tell-binding dropped)");
|
||||||
|
_plugin.SaveConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using HellionChat.Util;
|
||||||
|
|
||||||
|
namespace HellionChat.Branding;
|
||||||
|
|
||||||
|
// Centralised — a future invite/URL rotation only touches this file.
|
||||||
|
internal static class BrandingLinks
|
||||||
|
{
|
||||||
|
public const string HellionForgeDiscordInvite = "https://discord.gg/X9V7Kcv5gR";
|
||||||
|
public const string HellionForgeGitea = "https://gitea.hellion-forge.cloud/Hellion-Forge";
|
||||||
|
public const string HellionChatRepo =
|
||||||
|
"https://gitea.hellion-forge.cloud/JonKazama-Hellion/HellionChat";
|
||||||
|
public const string HellionForgeWebsite = "https://hellion-forge.cloud";
|
||||||
|
public const string HellionMediaWebsite = "https://hellion-media.de/de";
|
||||||
|
|
||||||
|
// CA2255 warns against [ModuleInitializer] in library code, but Dalamud
|
||||||
|
// loads the plugin DLL directly so the module-init pass is the right hook
|
||||||
|
// for a one-shot URL sanity check at plugin load.
|
||||||
|
#pragma warning disable CA2255
|
||||||
|
[ModuleInitializer]
|
||||||
|
#pragma warning restore CA2255
|
||||||
|
internal static void ValidateUrls()
|
||||||
|
{
|
||||||
|
UrlValidation.ValidateAll(
|
||||||
|
nameof(BrandingLinks),
|
||||||
|
HellionForgeDiscordInvite,
|
||||||
|
HellionForgeGitea,
|
||||||
|
HellionChatRepo,
|
||||||
|
HellionForgeWebsite,
|
||||||
|
HellionMediaWebsite
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
namespace HellionChat.Branding;
|
||||||
|
|
||||||
|
// Lazy-loaded provenance art that ships embedded with the DLL. Two
|
||||||
|
// variants:
|
||||||
|
//
|
||||||
|
// - FoxBanner: the full-size silhouette with "Hellion Forge" inside
|
||||||
|
// the body — rendered in the first-run wizard and the Information
|
||||||
|
// tab as a small "about the makers" anchor.
|
||||||
|
// - FoxMini: the four-line fox-head + curly-tail that gets stitched
|
||||||
|
// into the DI-logger bootstrap line so an xllog reader sees the
|
||||||
|
// same signature on every plugin load.
|
||||||
|
//
|
||||||
|
// Both files live as embedded resources under HellionChat.Branding.* so
|
||||||
|
// the plugin DLL is self-contained — no on-disk asset lookup that could
|
||||||
|
// silently miss after a partial deploy.
|
||||||
|
internal static class HellionForgeAscii
|
||||||
|
{
|
||||||
|
private static string? _foxBanner;
|
||||||
|
private static string? _foxMini;
|
||||||
|
|
||||||
|
public static string FoxBanner => _foxBanner ??= Load("HellionChat.Branding.fox-banner.txt");
|
||||||
|
|
||||||
|
public static string FoxMini => _foxMini ??= Load("HellionChat.Branding.fox-mini.txt");
|
||||||
|
|
||||||
|
private static string Load(string resourceName)
|
||||||
|
{
|
||||||
|
using var stream = typeof(HellionForgeAscii).Assembly.GetManifestResourceStream(
|
||||||
|
resourceName
|
||||||
|
);
|
||||||
|
if (stream is null)
|
||||||
|
return string.Empty;
|
||||||
|
|
||||||
|
using var reader = new StreamReader(stream);
|
||||||
|
return reader.ReadToEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Dalamud.Plugin;
|
||||||
|
using HellionChat.Resources;
|
||||||
|
|
||||||
|
namespace HellionChat;
|
||||||
|
|
||||||
|
internal static class ChatTwoConflictDetector
|
||||||
|
{
|
||||||
|
private const string UpstreamInternalName = "ChatTwo";
|
||||||
|
|
||||||
|
public static void ThrowIfChatTwoIsLoaded(IDalamudPluginInterface pluginInterface)
|
||||||
|
{
|
||||||
|
var conflict = pluginInterface.InstalledPlugins.FirstOrDefault(p =>
|
||||||
|
p.InternalName == UpstreamInternalName && p.IsLoaded
|
||||||
|
);
|
||||||
|
|
||||||
|
if (conflict is null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var message =
|
||||||
|
HellionStrings.ChatTwoConflictTitle
|
||||||
|
+ "\n\n"
|
||||||
|
+ HellionStrings.ChatTwoConflictBody
|
||||||
|
+ "\n\n"
|
||||||
|
+ HellionStrings.ChatTwoConflictAction;
|
||||||
|
|
||||||
|
throw new System.InvalidOperationException(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using ChatTwo.Code;
|
|
||||||
using Dalamud.Game.Text.SeStringHandling;
|
using Dalamud.Game.Text.SeStringHandling;
|
||||||
|
using HellionChat.Code;
|
||||||
using MessagePack;
|
using MessagePack;
|
||||||
|
|
||||||
namespace ChatTwo;
|
namespace HellionChat;
|
||||||
|
|
||||||
[Union(0, typeof(TextChunk))]
|
[Union(0, typeof(TextChunk))]
|
||||||
[Union(1, typeof(IconChunk))]
|
[Union(1, typeof(IconChunk))]
|
||||||
@@ -25,24 +25,23 @@ public abstract class Chunk
|
|||||||
Link = link;
|
Link = link;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal SeString? GetSeString() => Source switch
|
internal SeString? GetSeString() =>
|
||||||
{
|
Source switch
|
||||||
ChunkSource.None => null,
|
{
|
||||||
ChunkSource.Sender => Message?.SenderSource,
|
ChunkSource.None => null,
|
||||||
ChunkSource.Content => Message?.ContentSource,
|
ChunkSource.Sender => Message?.SenderSource,
|
||||||
_ => null,
|
ChunkSource.Content => Message?.ContentSource,
|
||||||
};
|
_ => null,
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
// Returns basic text for hashing (content for TextChunk, icon name for IconChunk)
|
||||||
/// Get some basic text for use in generating hashes.
|
|
||||||
/// </summary>
|
|
||||||
internal string StringValue()
|
internal string StringValue()
|
||||||
{
|
{
|
||||||
return this switch
|
return this switch
|
||||||
{
|
{
|
||||||
TextChunk text => text.Content,
|
TextChunk text => text.Content,
|
||||||
IconChunk icon => icon.Icon.ToString(),
|
IconChunk icon => icon.Icon.ToString(),
|
||||||
_ => ""
|
_ => "",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,18 +56,29 @@ public enum ChunkSource
|
|||||||
[MessagePackObject(AllowPrivate = true)]
|
[MessagePackObject(AllowPrivate = true)]
|
||||||
public class TextChunk : Chunk
|
public class TextChunk : Chunk
|
||||||
{
|
{
|
||||||
[Key(2)] public ChatType? FallbackColour;
|
[Key(2)]
|
||||||
[Key(3)] public uint? Foreground;
|
public ChatType? FallbackColour;
|
||||||
[Key(4)] public uint? Glow;
|
|
||||||
[Key(5)] public bool Italic;
|
|
||||||
[Key(6)] public string Content;
|
|
||||||
|
|
||||||
private TextChunk(Chunk chunk, string content) : base(chunk.Source, chunk.Link)
|
[Key(3)]
|
||||||
|
public uint? Foreground;
|
||||||
|
|
||||||
|
[Key(4)]
|
||||||
|
public uint? Glow;
|
||||||
|
|
||||||
|
[Key(5)]
|
||||||
|
public bool Italic;
|
||||||
|
|
||||||
|
[Key(6)]
|
||||||
|
public string Content;
|
||||||
|
|
||||||
|
private TextChunk(Chunk chunk, string content)
|
||||||
|
: base(chunk.Source, chunk.Link)
|
||||||
{
|
{
|
||||||
Content = content;
|
Content = content;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal TextChunk(ChunkSource source, Payload? link, string content) : base(source, link)
|
internal TextChunk(ChunkSource source, Payload? link, string content)
|
||||||
|
: base(source, link)
|
||||||
{
|
{
|
||||||
// This has been null in the past, and it broke rendering code.
|
// This has been null in the past, and it broke rendering code.
|
||||||
// ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract
|
// ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract
|
||||||
@@ -76,7 +86,16 @@ public class TextChunk : Chunk
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once UnusedMember.Global // Used by MessagePack
|
// ReSharper disable once UnusedMember.Global // Used by MessagePack
|
||||||
public TextChunk(ChunkSource source, Payload? link, ChatType? fallbackColour, uint? foreground, uint? glow, bool italic, string content) : base(source, link)
|
public TextChunk(
|
||||||
|
ChunkSource source,
|
||||||
|
Payload? link,
|
||||||
|
ChatType? fallbackColour,
|
||||||
|
uint? foreground,
|
||||||
|
uint? glow,
|
||||||
|
bool italic,
|
||||||
|
string content
|
||||||
|
)
|
||||||
|
: base(source, link)
|
||||||
{
|
{
|
||||||
FallbackColour = fallbackColour;
|
FallbackColour = fallbackColour;
|
||||||
Foreground = foreground;
|
Foreground = foreground;
|
||||||
@@ -87,9 +106,6 @@ public class TextChunk : Chunk
|
|||||||
Content = content ?? "";
|
Content = content ?? "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a new TextChunk with identical styling to this one.
|
|
||||||
/// </summary>
|
|
||||||
public TextChunk NewWithStyle(ChunkSource source, Payload? link, string content)
|
public TextChunk NewWithStyle(ChunkSource source, Payload? link, string content)
|
||||||
{
|
{
|
||||||
return new TextChunk(source, link, content)
|
return new TextChunk(source, link, content)
|
||||||
@@ -101,9 +117,6 @@ public class TextChunk : Chunk
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a new TextChunk with identical styling to this one.
|
|
||||||
/// </summary>
|
|
||||||
public TextChunk NewWithStyle(Chunk chunk, string content)
|
public TextChunk NewWithStyle(Chunk chunk, string content)
|
||||||
{
|
{
|
||||||
return new TextChunk(chunk, content)
|
return new TextChunk(chunk, content)
|
||||||
@@ -122,7 +135,8 @@ public class IconChunk : Chunk
|
|||||||
[Key(2)]
|
[Key(2)]
|
||||||
public BitmapFontIcon Icon { get; set; }
|
public BitmapFontIcon Icon { get; set; }
|
||||||
|
|
||||||
public IconChunk(ChunkSource source, Payload? link, BitmapFontIcon icon) : base(source, link)
|
public IconChunk(ChunkSource source, Payload? link, BitmapFontIcon icon)
|
||||||
|
: base(source, link)
|
||||||
{
|
{
|
||||||
Icon = icon;
|
Icon = icon;
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dalamud.Game.Text;
|
using Dalamud.Game.Text;
|
||||||
|
|
||||||
namespace ChatTwo.Code;
|
namespace HellionChat.Code;
|
||||||
|
|
||||||
public class ChatCode
|
public class ChatCode
|
||||||
{
|
{
|
||||||
@@ -16,7 +16,7 @@ public class ChatCode
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ChatCode(byte type, byte source, byte target)
|
public ChatCode(byte type, byte source, byte target)
|
||||||
: this((XivChatType)type, (XivChatRelationKind)source, (XivChatRelationKind)target) {}
|
: this((XivChatType)type, (XivChatRelationKind)source, (XivChatRelationKind)target) { }
|
||||||
|
|
||||||
public bool IsBattle()
|
public bool IsBattle()
|
||||||
{
|
{
|
||||||
@@ -91,13 +91,10 @@ public class ChatCode
|
|||||||
|
|
||||||
public override bool Equals(object? obj)
|
public override bool Equals(object? obj)
|
||||||
{
|
{
|
||||||
if (obj == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (obj is not ChatCode code)
|
if (obj is not ChatCode code)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return GetHashCode() == code.GetHashCode();
|
return Type == code.Type && Source == code.Source && Target == code.Target;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
Executable
+42
@@ -0,0 +1,42 @@
|
|||||||
|
using Dalamud.Game.Text;
|
||||||
|
|
||||||
|
namespace HellionChat.Code;
|
||||||
|
|
||||||
|
[Flags]
|
||||||
|
public enum ChatSource : ushort
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
|
||||||
|
// The player controlled by this client
|
||||||
|
LocalPlayer = 1 << XivChatRelationKind.LocalPlayer,
|
||||||
|
|
||||||
|
// Member of the local party
|
||||||
|
PartyMember = 1 << XivChatRelationKind.PartyMember,
|
||||||
|
|
||||||
|
// Member of the alliance
|
||||||
|
AllianceMember = 1 << XivChatRelationKind.AllianceMember,
|
||||||
|
|
||||||
|
// Other player
|
||||||
|
OtherPlayer = 1 << XivChatRelationKind.OtherPlayer,
|
||||||
|
|
||||||
|
// Enemy in combat
|
||||||
|
EngagedEnemy = 1 << XivChatRelationKind.EngagedEnemy,
|
||||||
|
|
||||||
|
// Enemy out of combat
|
||||||
|
UnengagedEnemy = 1 << XivChatRelationKind.UnengagedEnemy,
|
||||||
|
|
||||||
|
// Friendly NPC
|
||||||
|
FriendlyNpc = 1 << XivChatRelationKind.FriendlyNpc,
|
||||||
|
|
||||||
|
// Own pet or companion
|
||||||
|
PetOrCompanion = 1 << XivChatRelationKind.PetOrCompanion,
|
||||||
|
|
||||||
|
// Pet or companion of party members
|
||||||
|
PetOrCompanionParty = 1 << XivChatRelationKind.PetOrCompanionParty,
|
||||||
|
|
||||||
|
// Pet or companion of alliance members
|
||||||
|
PetOrCompanionAlliance = 1 << XivChatRelationKind.PetOrCompanionAlliance,
|
||||||
|
|
||||||
|
// Pet or companion of other players
|
||||||
|
PetOrCompanionOther = 1 << XivChatRelationKind.PetOrCompanionOther,
|
||||||
|
}
|
||||||
Executable
+36
@@ -0,0 +1,36 @@
|
|||||||
|
using HellionChat.Resources;
|
||||||
|
|
||||||
|
namespace HellionChat.Code;
|
||||||
|
|
||||||
|
internal static class ChatSourceExt
|
||||||
|
{
|
||||||
|
internal const ChatSource All =
|
||||||
|
ChatSource.LocalPlayer
|
||||||
|
| ChatSource.PartyMember
|
||||||
|
| ChatSource.AllianceMember
|
||||||
|
| ChatSource.OtherPlayer
|
||||||
|
| ChatSource.EngagedEnemy
|
||||||
|
| ChatSource.UnengagedEnemy
|
||||||
|
| ChatSource.FriendlyNpc
|
||||||
|
| ChatSource.PetOrCompanion
|
||||||
|
| ChatSource.PetOrCompanionParty
|
||||||
|
| ChatSource.PetOrCompanionAlliance
|
||||||
|
| ChatSource.PetOrCompanionOther;
|
||||||
|
|
||||||
|
internal static string Name(this ChatSource source) =>
|
||||||
|
source switch
|
||||||
|
{
|
||||||
|
ChatSource.LocalPlayer => Language.ChatSource_Self,
|
||||||
|
ChatSource.PartyMember => Language.ChatSource_PartyMember,
|
||||||
|
ChatSource.AllianceMember => Language.ChatSource_AllianceMember,
|
||||||
|
ChatSource.OtherPlayer => Language.ChatSource_Other,
|
||||||
|
ChatSource.EngagedEnemy => Language.ChatSource_EngagedEnemy,
|
||||||
|
ChatSource.UnengagedEnemy => Language.ChatSource_UnengagedEnemy,
|
||||||
|
ChatSource.FriendlyNpc => Language.ChatSource_FriendlyNpc,
|
||||||
|
ChatSource.PetOrCompanion => Language.ChatSource_SelfPet,
|
||||||
|
ChatSource.PetOrCompanionParty => Language.ChatSource_PartyPet,
|
||||||
|
ChatSource.PetOrCompanionAlliance => Language.ChatSource_AlliancePet,
|
||||||
|
ChatSource.PetOrCompanionOther => Language.ChatSource_OtherPet,
|
||||||
|
_ => throw new ArgumentOutOfRangeException(nameof(source), source, null),
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace ChatTwo.Code;
|
namespace HellionChat.Code;
|
||||||
|
|
||||||
public enum ChatType : ushort
|
public enum ChatType : ushort
|
||||||
{
|
{
|
||||||
Executable
+499
@@ -0,0 +1,499 @@
|
|||||||
|
using Dalamud.Game.Config;
|
||||||
|
using HellionChat.Resources;
|
||||||
|
using HellionChat.Util;
|
||||||
|
|
||||||
|
namespace HellionChat.Code;
|
||||||
|
|
||||||
|
internal static class ChatTypeExt
|
||||||
|
{
|
||||||
|
internal static IEnumerable<(string, ChatType[])> SortOrder =>
|
||||||
|
[
|
||||||
|
(
|
||||||
|
Language.Options_Tabs_ChannelTypes_Special,
|
||||||
|
[ChatType.Debug, ChatType.Urgent, ChatType.Notice]
|
||||||
|
),
|
||||||
|
(
|
||||||
|
Language.Options_Tabs_ChannelTypes_Chat,
|
||||||
|
[
|
||||||
|
ChatType.Say,
|
||||||
|
ChatType.Yell,
|
||||||
|
ChatType.Shout,
|
||||||
|
ChatType.TellIncoming,
|
||||||
|
ChatType.TellOutgoing,
|
||||||
|
ChatType.Party,
|
||||||
|
ChatType.CrossParty,
|
||||||
|
ChatType.Alliance,
|
||||||
|
ChatType.FreeCompany,
|
||||||
|
ChatType.PvpTeam,
|
||||||
|
ChatType.CrossLinkshell1,
|
||||||
|
ChatType.CrossLinkshell2,
|
||||||
|
ChatType.CrossLinkshell3,
|
||||||
|
ChatType.CrossLinkshell4,
|
||||||
|
ChatType.CrossLinkshell5,
|
||||||
|
ChatType.CrossLinkshell6,
|
||||||
|
ChatType.CrossLinkshell7,
|
||||||
|
ChatType.CrossLinkshell8,
|
||||||
|
ChatType.Linkshell1,
|
||||||
|
ChatType.Linkshell2,
|
||||||
|
ChatType.Linkshell3,
|
||||||
|
ChatType.Linkshell4,
|
||||||
|
ChatType.Linkshell5,
|
||||||
|
ChatType.Linkshell6,
|
||||||
|
ChatType.Linkshell7,
|
||||||
|
ChatType.Linkshell8,
|
||||||
|
ChatType.NoviceNetwork,
|
||||||
|
ChatType.StandardEmote,
|
||||||
|
ChatType.CustomEmote,
|
||||||
|
]
|
||||||
|
),
|
||||||
|
(
|
||||||
|
Language.Options_Tabs_ChannelTypes_Battle,
|
||||||
|
[
|
||||||
|
ChatType.Damage,
|
||||||
|
ChatType.Miss,
|
||||||
|
ChatType.Action,
|
||||||
|
ChatType.Item,
|
||||||
|
ChatType.Healing,
|
||||||
|
ChatType.GainBuff,
|
||||||
|
ChatType.LoseBuff,
|
||||||
|
ChatType.GainDebuff,
|
||||||
|
ChatType.LoseDebuff,
|
||||||
|
]
|
||||||
|
),
|
||||||
|
(
|
||||||
|
Language.Options_Tabs_ChannelTypes_Announcements,
|
||||||
|
[
|
||||||
|
ChatType.System,
|
||||||
|
ChatType.BattleSystem,
|
||||||
|
ChatType.GatheringSystem,
|
||||||
|
ChatType.Error,
|
||||||
|
ChatType.Echo,
|
||||||
|
ChatType.NoviceNetworkSystem,
|
||||||
|
ChatType.FreeCompanyAnnouncement,
|
||||||
|
ChatType.PvpTeamAnnouncement,
|
||||||
|
ChatType.FreeCompanyLoginLogout,
|
||||||
|
ChatType.PvpTeamLoginLogout,
|
||||||
|
ChatType.RetainerSale,
|
||||||
|
ChatType.NpcDialogue,
|
||||||
|
ChatType.NpcAnnouncement,
|
||||||
|
ChatType.LootNotice,
|
||||||
|
ChatType.Progress,
|
||||||
|
ChatType.LootRoll,
|
||||||
|
ChatType.Crafting,
|
||||||
|
ChatType.Gathering,
|
||||||
|
ChatType.PeriodicRecruitmentNotification,
|
||||||
|
ChatType.Sign,
|
||||||
|
ChatType.RandomNumber,
|
||||||
|
ChatType.Orchestrion,
|
||||||
|
ChatType.MessageBook,
|
||||||
|
ChatType.Alarm,
|
||||||
|
ChatType.GlamourNotifications,
|
||||||
|
]
|
||||||
|
),
|
||||||
|
// Note: ExtraChat linkshells are handled separately in the tab settings
|
||||||
|
// UI.
|
||||||
|
];
|
||||||
|
|
||||||
|
internal static string Name(this ChatType type)
|
||||||
|
{
|
||||||
|
return type switch
|
||||||
|
{
|
||||||
|
ChatType.Debug => Language.ChatType_Debug,
|
||||||
|
ChatType.Urgent => Language.ChatType_Urgent,
|
||||||
|
ChatType.Notice => Language.ChatType_Notice,
|
||||||
|
ChatType.Say => Language.ChatType_Say,
|
||||||
|
ChatType.Shout => Language.ChatType_Shout,
|
||||||
|
ChatType.TellOutgoing => Language.ChatType_TellOutgoing,
|
||||||
|
ChatType.TellIncoming => Language.ChatType_TellIncoming,
|
||||||
|
ChatType.Party => Language.ChatType_Party,
|
||||||
|
ChatType.Alliance => Language.ChatType_Alliance,
|
||||||
|
ChatType.Linkshell1 => Language.ChatType_Linkshell1,
|
||||||
|
ChatType.Linkshell2 => Language.ChatType_Linkshell2,
|
||||||
|
ChatType.Linkshell3 => Language.ChatType_Linkshell3,
|
||||||
|
ChatType.Linkshell4 => Language.ChatType_Linkshell4,
|
||||||
|
ChatType.Linkshell5 => Language.ChatType_Linkshell5,
|
||||||
|
ChatType.Linkshell6 => Language.ChatType_Linkshell6,
|
||||||
|
ChatType.Linkshell7 => Language.ChatType_Linkshell7,
|
||||||
|
ChatType.Linkshell8 => Language.ChatType_Linkshell8,
|
||||||
|
ChatType.FreeCompany => Language.ChatType_FreeCompany,
|
||||||
|
ChatType.NoviceNetwork => Language.ChatType_NoviceNetwork,
|
||||||
|
ChatType.CustomEmote => Language.ChatType_CustomEmotes,
|
||||||
|
ChatType.StandardEmote => Language.ChatType_StandardEmotes,
|
||||||
|
ChatType.Yell => Language.ChatType_Yell,
|
||||||
|
ChatType.CrossParty => Language.ChatType_CrossWorldParty,
|
||||||
|
ChatType.PvpTeam => Language.ChatType_PvpTeam,
|
||||||
|
ChatType.CrossLinkshell1 => Language.ChatType_CrossLinkshell1,
|
||||||
|
ChatType.Damage => Language.ChatType_Damage,
|
||||||
|
ChatType.Miss => Language.ChatType_Miss,
|
||||||
|
ChatType.Action => Language.ChatType_Action,
|
||||||
|
ChatType.Item => Language.ChatType_Item,
|
||||||
|
ChatType.Healing => Language.ChatType_Healing,
|
||||||
|
ChatType.GainBuff => Language.ChatType_GainBuff,
|
||||||
|
ChatType.GainDebuff => Language.ChatType_GainDebuff,
|
||||||
|
ChatType.LoseBuff => Language.ChatType_LoseBuff,
|
||||||
|
ChatType.LoseDebuff => Language.ChatType_LoseDebuff,
|
||||||
|
ChatType.Alarm => Language.ChatType_Alarm,
|
||||||
|
ChatType.GlamourNotifications => Language.ChatType_Glamour,
|
||||||
|
ChatType.Echo => Language.ChatType_Echo,
|
||||||
|
ChatType.System => Language.ChatType_System,
|
||||||
|
ChatType.BattleSystem => Language.ChatType_BattleSystem,
|
||||||
|
ChatType.GatheringSystem => Language.ChatType_GatheringSystem,
|
||||||
|
ChatType.Error => Language.ChatType_Error,
|
||||||
|
ChatType.NpcDialogue => Language.ChatType_NpcDialogue,
|
||||||
|
ChatType.LootNotice => Language.ChatType_LootNotice,
|
||||||
|
ChatType.Progress => Language.ChatType_Progress,
|
||||||
|
ChatType.LootRoll => Language.ChatType_LootRoll,
|
||||||
|
ChatType.Crafting => Language.ChatType_Crafting,
|
||||||
|
ChatType.Gathering => Language.ChatType_Gathering,
|
||||||
|
ChatType.NpcAnnouncement => Language.ChatType_NpcAnnouncement,
|
||||||
|
ChatType.FreeCompanyAnnouncement => Language.ChatType_FreeCompanyAnnouncement,
|
||||||
|
ChatType.FreeCompanyLoginLogout => Language.ChatType_FreeCompanyLoginLogout,
|
||||||
|
ChatType.RetainerSale => Language.ChatType_RetainerSale,
|
||||||
|
ChatType.PeriodicRecruitmentNotification =>
|
||||||
|
Language.ChatType_PeriodicRecruitmentNotification,
|
||||||
|
ChatType.Sign => Language.ChatType_Sign,
|
||||||
|
ChatType.RandomNumber => Language.ChatType_RandomNumber,
|
||||||
|
ChatType.NoviceNetworkSystem => Language.ChatType_NoviceNetworkSystem,
|
||||||
|
ChatType.Orchestrion => Language.ChatType_Orchestrion,
|
||||||
|
ChatType.PvpTeamAnnouncement => Language.ChatType_PvpTeamAnnouncement,
|
||||||
|
ChatType.PvpTeamLoginLogout => Language.ChatType_PvpTeamLoginLogout,
|
||||||
|
ChatType.MessageBook => Language.ChatType_MessageBook,
|
||||||
|
ChatType.GmTell => Language.ChatType_GmTell,
|
||||||
|
ChatType.GmSay => Language.ChatType_GmSay,
|
||||||
|
ChatType.GmShout => Language.ChatType_GmShout,
|
||||||
|
ChatType.GmYell => Language.ChatType_GmYell,
|
||||||
|
ChatType.GmParty => Language.ChatType_GmParty,
|
||||||
|
ChatType.GmFreeCompany => Language.ChatType_GmFreeCompany,
|
||||||
|
ChatType.GmLinkshell1 => Language.ChatType_GmLinkshell1,
|
||||||
|
ChatType.GmLinkshell2 => Language.ChatType_GmLinkshell2,
|
||||||
|
ChatType.GmLinkshell3 => Language.ChatType_GmLinkshell3,
|
||||||
|
ChatType.GmLinkshell4 => Language.ChatType_GmLinkshell4,
|
||||||
|
ChatType.GmLinkshell5 => Language.ChatType_GmLinkshell5,
|
||||||
|
ChatType.GmLinkshell6 => Language.ChatType_GmLinkshell6,
|
||||||
|
ChatType.GmLinkshell7 => Language.ChatType_GmLinkshell7,
|
||||||
|
ChatType.GmLinkshell8 => Language.ChatType_GmLinkshell8,
|
||||||
|
ChatType.GmNoviceNetwork => Language.ChatType_GmNoviceNetwork,
|
||||||
|
ChatType.CrossLinkshell2 => Language.ChatType_CrossLinkshell2,
|
||||||
|
ChatType.CrossLinkshell3 => Language.ChatType_CrossLinkshell3,
|
||||||
|
ChatType.CrossLinkshell4 => Language.ChatType_CrossLinkshell4,
|
||||||
|
ChatType.CrossLinkshell5 => Language.ChatType_CrossLinkshell5,
|
||||||
|
ChatType.CrossLinkshell6 => Language.ChatType_CrossLinkshell6,
|
||||||
|
ChatType.CrossLinkshell7 => Language.ChatType_CrossLinkshell7,
|
||||||
|
ChatType.CrossLinkshell8 => Language.ChatType_CrossLinkshell8,
|
||||||
|
ChatType.ExtraChatLinkshell1 => Language.ChatType_ExtraChatLinkshell1,
|
||||||
|
ChatType.ExtraChatLinkshell2 => Language.ChatType_ExtraChatLinkshell2,
|
||||||
|
ChatType.ExtraChatLinkshell3 => Language.ChatType_ExtraChatLinkshell3,
|
||||||
|
ChatType.ExtraChatLinkshell4 => Language.ChatType_ExtraChatLinkshell4,
|
||||||
|
ChatType.ExtraChatLinkshell5 => Language.ChatType_ExtraChatLinkshell5,
|
||||||
|
ChatType.ExtraChatLinkshell6 => Language.ChatType_ExtraChatLinkshell6,
|
||||||
|
ChatType.ExtraChatLinkshell7 => Language.ChatType_ExtraChatLinkshell7,
|
||||||
|
ChatType.ExtraChatLinkshell8 => Language.ChatType_ExtraChatLinkshell8,
|
||||||
|
_ => type.ToString(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static uint? DefaultColor(this ChatType type)
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case ChatType.Debug:
|
||||||
|
return ColourUtil.ComponentsToRgba(204, 204, 204);
|
||||||
|
case ChatType.Urgent:
|
||||||
|
return ColourUtil.ComponentsToRgba(255, 127, 127);
|
||||||
|
case ChatType.Notice:
|
||||||
|
return ColourUtil.ComponentsToRgba(179, 140, 255);
|
||||||
|
|
||||||
|
case ChatType.Say:
|
||||||
|
case ChatType.GmSay:
|
||||||
|
return ColourUtil.ComponentsToRgba(247, 247, 247);
|
||||||
|
case ChatType.Shout:
|
||||||
|
case ChatType.GmShout:
|
||||||
|
return ColourUtil.ComponentsToRgba(255, 166, 102);
|
||||||
|
case ChatType.TellIncoming:
|
||||||
|
case ChatType.TellOutgoing:
|
||||||
|
case ChatType.GmTell:
|
||||||
|
return ColourUtil.ComponentsToRgba(255, 184, 222);
|
||||||
|
case ChatType.Party:
|
||||||
|
case ChatType.CrossParty:
|
||||||
|
case ChatType.GmParty:
|
||||||
|
return ColourUtil.ComponentsToRgba(102, 229, 255);
|
||||||
|
case ChatType.Alliance:
|
||||||
|
return ColourUtil.ComponentsToRgba(255, 127, 0);
|
||||||
|
case ChatType.NoviceNetwork:
|
||||||
|
case ChatType.NoviceNetworkSystem:
|
||||||
|
case ChatType.GmNoviceNetwork:
|
||||||
|
return ColourUtil.ComponentsToRgba(212, 255, 125);
|
||||||
|
case ChatType.Linkshell1:
|
||||||
|
case ChatType.Linkshell2:
|
||||||
|
case ChatType.Linkshell3:
|
||||||
|
case ChatType.Linkshell4:
|
||||||
|
case ChatType.Linkshell5:
|
||||||
|
case ChatType.Linkshell6:
|
||||||
|
case ChatType.Linkshell7:
|
||||||
|
case ChatType.Linkshell8:
|
||||||
|
case ChatType.CrossLinkshell1:
|
||||||
|
case ChatType.CrossLinkshell2:
|
||||||
|
case ChatType.CrossLinkshell3:
|
||||||
|
case ChatType.CrossLinkshell4:
|
||||||
|
case ChatType.CrossLinkshell5:
|
||||||
|
case ChatType.CrossLinkshell6:
|
||||||
|
case ChatType.CrossLinkshell7:
|
||||||
|
case ChatType.CrossLinkshell8:
|
||||||
|
case ChatType.GmLinkshell1:
|
||||||
|
case ChatType.GmLinkshell2:
|
||||||
|
case ChatType.GmLinkshell3:
|
||||||
|
case ChatType.GmLinkshell4:
|
||||||
|
case ChatType.GmLinkshell5:
|
||||||
|
case ChatType.GmLinkshell6:
|
||||||
|
case ChatType.GmLinkshell7:
|
||||||
|
case ChatType.GmLinkshell8:
|
||||||
|
return ColourUtil.ComponentsToRgba(212, 255, 125);
|
||||||
|
case ChatType.StandardEmote:
|
||||||
|
return ColourUtil.ComponentsToRgba(186, 255, 240);
|
||||||
|
case ChatType.CustomEmote:
|
||||||
|
return ColourUtil.ComponentsToRgba(186, 255, 240);
|
||||||
|
case ChatType.Yell:
|
||||||
|
case ChatType.GmYell:
|
||||||
|
return ColourUtil.ComponentsToRgba(255, 255, 0);
|
||||||
|
case ChatType.Echo:
|
||||||
|
return ColourUtil.ComponentsToRgba(204, 204, 204);
|
||||||
|
case ChatType.System:
|
||||||
|
case ChatType.GatheringSystem:
|
||||||
|
case ChatType.PeriodicRecruitmentNotification:
|
||||||
|
case ChatType.Orchestrion:
|
||||||
|
case ChatType.Alarm:
|
||||||
|
case ChatType.GlamourNotifications:
|
||||||
|
case ChatType.RetainerSale:
|
||||||
|
case ChatType.Sign:
|
||||||
|
case ChatType.MessageBook:
|
||||||
|
return ColourUtil.ComponentsToRgba(204, 204, 204);
|
||||||
|
case ChatType.NpcAnnouncement:
|
||||||
|
case ChatType.NpcDialogue:
|
||||||
|
return ColourUtil.ComponentsToRgba(171, 214, 71);
|
||||||
|
case ChatType.Error:
|
||||||
|
return ColourUtil.ComponentsToRgba(255, 74, 74);
|
||||||
|
case ChatType.FreeCompany:
|
||||||
|
case ChatType.FreeCompanyAnnouncement:
|
||||||
|
case ChatType.FreeCompanyLoginLogout:
|
||||||
|
case ChatType.GmFreeCompany:
|
||||||
|
return ColourUtil.ComponentsToRgba(171, 219, 229);
|
||||||
|
case ChatType.PvpTeam:
|
||||||
|
return ColourUtil.ComponentsToRgba(171, 219, 229);
|
||||||
|
case ChatType.PvpTeamAnnouncement:
|
||||||
|
case ChatType.PvpTeamLoginLogout:
|
||||||
|
return ColourUtil.ComponentsToRgba(171, 219, 229);
|
||||||
|
case ChatType.Action:
|
||||||
|
case ChatType.Item:
|
||||||
|
case ChatType.LootNotice:
|
||||||
|
return ColourUtil.ComponentsToRgba(255, 255, 176);
|
||||||
|
case ChatType.Progress:
|
||||||
|
return ColourUtil.ComponentsToRgba(255, 222, 115);
|
||||||
|
case ChatType.LootRoll:
|
||||||
|
case ChatType.RandomNumber:
|
||||||
|
return ColourUtil.ComponentsToRgba(199, 191, 158);
|
||||||
|
case ChatType.Crafting:
|
||||||
|
case ChatType.Gathering:
|
||||||
|
return ColourUtil.ComponentsToRgba(222, 191, 247);
|
||||||
|
case ChatType.Damage:
|
||||||
|
return ColourUtil.ComponentsToRgba(255, 125, 125);
|
||||||
|
case ChatType.Miss:
|
||||||
|
return ColourUtil.ComponentsToRgba(204, 204, 204);
|
||||||
|
case ChatType.Healing:
|
||||||
|
return ColourUtil.ComponentsToRgba(212, 255, 125);
|
||||||
|
case ChatType.GainBuff:
|
||||||
|
case ChatType.LoseBuff:
|
||||||
|
return ColourUtil.ComponentsToRgba(148, 191, 255);
|
||||||
|
case ChatType.GainDebuff:
|
||||||
|
case ChatType.LoseDebuff:
|
||||||
|
return ColourUtil.ComponentsToRgba(255, 138, 196);
|
||||||
|
case ChatType.BattleSystem:
|
||||||
|
return ColourUtil.ComponentsToRgba(204, 204, 204);
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static InputChannel? ToInputChannel(this ChatType type) =>
|
||||||
|
type switch
|
||||||
|
{
|
||||||
|
ChatType.TellOutgoing => InputChannel.Tell,
|
||||||
|
ChatType.Say => InputChannel.Say,
|
||||||
|
ChatType.Party => InputChannel.Party,
|
||||||
|
ChatType.Alliance => InputChannel.Alliance,
|
||||||
|
ChatType.Yell => InputChannel.Yell,
|
||||||
|
ChatType.Shout => InputChannel.Shout,
|
||||||
|
ChatType.FreeCompany => InputChannel.FreeCompany,
|
||||||
|
ChatType.PvpTeam => InputChannel.PvpTeam,
|
||||||
|
ChatType.NoviceNetwork => InputChannel.NoviceNetwork,
|
||||||
|
ChatType.CrossLinkshell1 => InputChannel.CrossLinkshell1,
|
||||||
|
ChatType.CrossLinkshell2 => InputChannel.CrossLinkshell2,
|
||||||
|
ChatType.CrossLinkshell3 => InputChannel.CrossLinkshell3,
|
||||||
|
ChatType.CrossLinkshell4 => InputChannel.CrossLinkshell4,
|
||||||
|
ChatType.CrossLinkshell5 => InputChannel.CrossLinkshell5,
|
||||||
|
ChatType.CrossLinkshell6 => InputChannel.CrossLinkshell6,
|
||||||
|
ChatType.CrossLinkshell7 => InputChannel.CrossLinkshell7,
|
||||||
|
ChatType.CrossLinkshell8 => InputChannel.CrossLinkshell8,
|
||||||
|
ChatType.Linkshell1 => InputChannel.Linkshell1,
|
||||||
|
ChatType.Linkshell2 => InputChannel.Linkshell2,
|
||||||
|
ChatType.Linkshell3 => InputChannel.Linkshell3,
|
||||||
|
ChatType.Linkshell4 => InputChannel.Linkshell4,
|
||||||
|
ChatType.Linkshell5 => InputChannel.Linkshell5,
|
||||||
|
ChatType.Linkshell6 => InputChannel.Linkshell6,
|
||||||
|
ChatType.Linkshell7 => InputChannel.Linkshell7,
|
||||||
|
ChatType.Linkshell8 => InputChannel.Linkshell8,
|
||||||
|
_ => null,
|
||||||
|
};
|
||||||
|
|
||||||
|
internal static bool IsGm(this ChatType type) =>
|
||||||
|
type switch
|
||||||
|
{
|
||||||
|
ChatType.GmTell => true,
|
||||||
|
ChatType.GmSay => true,
|
||||||
|
ChatType.GmShout => true,
|
||||||
|
ChatType.GmYell => true,
|
||||||
|
ChatType.GmParty => true,
|
||||||
|
ChatType.GmFreeCompany => true,
|
||||||
|
ChatType.GmLinkshell1 => true,
|
||||||
|
ChatType.GmLinkshell2 => true,
|
||||||
|
ChatType.GmLinkshell3 => true,
|
||||||
|
ChatType.GmLinkshell4 => true,
|
||||||
|
ChatType.GmLinkshell5 => true,
|
||||||
|
ChatType.GmLinkshell6 => true,
|
||||||
|
ChatType.GmLinkshell7 => true,
|
||||||
|
ChatType.GmLinkshell8 => true,
|
||||||
|
ChatType.GmNoviceNetwork => true,
|
||||||
|
_ => false,
|
||||||
|
};
|
||||||
|
|
||||||
|
internal static bool IsExtraChatLinkshell(this ChatType type) =>
|
||||||
|
type switch
|
||||||
|
{
|
||||||
|
ChatType.ExtraChatLinkshell1 => true,
|
||||||
|
ChatType.ExtraChatLinkshell2 => true,
|
||||||
|
ChatType.ExtraChatLinkshell3 => true,
|
||||||
|
ChatType.ExtraChatLinkshell4 => true,
|
||||||
|
ChatType.ExtraChatLinkshell5 => true,
|
||||||
|
ChatType.ExtraChatLinkshell6 => true,
|
||||||
|
ChatType.ExtraChatLinkshell7 => true,
|
||||||
|
ChatType.ExtraChatLinkshell8 => true,
|
||||||
|
_ => false,
|
||||||
|
};
|
||||||
|
|
||||||
|
public static UiConfigOption ToConfigEntry(this ChatType type) =>
|
||||||
|
type switch
|
||||||
|
{
|
||||||
|
ChatType.Say => UiConfigOption.ColorSay,
|
||||||
|
ChatType.Shout => UiConfigOption.ColorShout,
|
||||||
|
ChatType.TellOutgoing => UiConfigOption.ColorTell,
|
||||||
|
ChatType.Party => UiConfigOption.ColorParty,
|
||||||
|
ChatType.Linkshell1 => UiConfigOption.ColorLS1,
|
||||||
|
ChatType.Linkshell2 => UiConfigOption.ColorLS2,
|
||||||
|
ChatType.Linkshell3 => UiConfigOption.ColorLS3,
|
||||||
|
ChatType.Linkshell4 => UiConfigOption.ColorLS4,
|
||||||
|
ChatType.Linkshell5 => UiConfigOption.ColorLS5,
|
||||||
|
ChatType.Linkshell6 => UiConfigOption.ColorLS6,
|
||||||
|
ChatType.Linkshell7 => UiConfigOption.ColorLS7,
|
||||||
|
ChatType.Linkshell8 => UiConfigOption.ColorLS8,
|
||||||
|
ChatType.FreeCompany => UiConfigOption.ColorFCompany,
|
||||||
|
ChatType.NoviceNetwork => UiConfigOption.ColorBeginner,
|
||||||
|
ChatType.CustomEmote => UiConfigOption.ColorEmoteUser,
|
||||||
|
ChatType.StandardEmote => UiConfigOption.ColorEmote,
|
||||||
|
ChatType.Yell => UiConfigOption.ColorYell,
|
||||||
|
ChatType.GainBuff => UiConfigOption.ColorBuffGive,
|
||||||
|
ChatType.GainDebuff => UiConfigOption.ColorDebuffGive,
|
||||||
|
ChatType.System => UiConfigOption.ColorSysMsg,
|
||||||
|
ChatType.NpcDialogue => UiConfigOption.ColorNpcSay,
|
||||||
|
ChatType.LootRoll => UiConfigOption.ColorLoot,
|
||||||
|
ChatType.FreeCompanyAnnouncement => UiConfigOption.ColorFCAnnounce,
|
||||||
|
ChatType.PvpTeamAnnouncement => UiConfigOption.ColorPvPGroupAnnounce,
|
||||||
|
_ => UiConfigOption.ColorSay,
|
||||||
|
};
|
||||||
|
|
||||||
|
internal static bool HasSource(this ChatType type) =>
|
||||||
|
type switch
|
||||||
|
{
|
||||||
|
// Battle
|
||||||
|
ChatType.Damage => true,
|
||||||
|
ChatType.Miss => true,
|
||||||
|
ChatType.Action => true,
|
||||||
|
ChatType.Item => true,
|
||||||
|
ChatType.Healing => true,
|
||||||
|
ChatType.GainBuff => true,
|
||||||
|
ChatType.LoseBuff => true,
|
||||||
|
ChatType.GainDebuff => true,
|
||||||
|
ChatType.LoseDebuff => true,
|
||||||
|
|
||||||
|
// Announcements
|
||||||
|
ChatType.System => true,
|
||||||
|
ChatType.BattleSystem => true,
|
||||||
|
ChatType.Error => true,
|
||||||
|
ChatType.LootNotice => true,
|
||||||
|
ChatType.Progress => true,
|
||||||
|
ChatType.LootRoll => true,
|
||||||
|
ChatType.Crafting => true,
|
||||||
|
ChatType.Gathering => true,
|
||||||
|
ChatType.FreeCompanyLoginLogout => true,
|
||||||
|
ChatType.PvpTeamLoginLogout => true,
|
||||||
|
_ => false,
|
||||||
|
};
|
||||||
|
|
||||||
|
internal static ChatType Parent(this ChatType type) =>
|
||||||
|
type switch
|
||||||
|
{
|
||||||
|
ChatType.Say => ChatType.Say,
|
||||||
|
ChatType.GmSay => ChatType.Say,
|
||||||
|
ChatType.Shout => ChatType.Shout,
|
||||||
|
ChatType.GmShout => ChatType.Shout,
|
||||||
|
ChatType.TellOutgoing => ChatType.TellOutgoing,
|
||||||
|
ChatType.TellIncoming => ChatType.TellOutgoing,
|
||||||
|
ChatType.GmTell => ChatType.TellOutgoing,
|
||||||
|
ChatType.Party => ChatType.Party,
|
||||||
|
ChatType.CrossParty => ChatType.Party,
|
||||||
|
ChatType.GmParty => ChatType.Party,
|
||||||
|
ChatType.Linkshell1 => ChatType.Linkshell1,
|
||||||
|
ChatType.GmLinkshell1 => ChatType.Linkshell1,
|
||||||
|
ChatType.Linkshell2 => ChatType.Linkshell2,
|
||||||
|
ChatType.GmLinkshell2 => ChatType.Linkshell2,
|
||||||
|
ChatType.Linkshell3 => ChatType.Linkshell3,
|
||||||
|
ChatType.GmLinkshell3 => ChatType.Linkshell3,
|
||||||
|
ChatType.Linkshell4 => ChatType.Linkshell4,
|
||||||
|
ChatType.GmLinkshell4 => ChatType.Linkshell4,
|
||||||
|
ChatType.Linkshell5 => ChatType.Linkshell5,
|
||||||
|
ChatType.GmLinkshell5 => ChatType.Linkshell5,
|
||||||
|
ChatType.Linkshell6 => ChatType.Linkshell6,
|
||||||
|
ChatType.GmLinkshell6 => ChatType.Linkshell6,
|
||||||
|
ChatType.Linkshell7 => ChatType.Linkshell7,
|
||||||
|
ChatType.GmLinkshell7 => ChatType.Linkshell7,
|
||||||
|
ChatType.Linkshell8 => ChatType.Linkshell8,
|
||||||
|
ChatType.GmLinkshell8 => ChatType.Linkshell8,
|
||||||
|
ChatType.FreeCompany => ChatType.FreeCompany,
|
||||||
|
ChatType.GmFreeCompany => ChatType.FreeCompany,
|
||||||
|
ChatType.NoviceNetwork => ChatType.NoviceNetwork,
|
||||||
|
ChatType.GmNoviceNetwork => ChatType.NoviceNetwork,
|
||||||
|
ChatType.CustomEmote => ChatType.CustomEmote,
|
||||||
|
ChatType.StandardEmote => ChatType.StandardEmote,
|
||||||
|
ChatType.Yell => ChatType.Yell,
|
||||||
|
ChatType.GmYell => ChatType.Yell,
|
||||||
|
ChatType.GainBuff => ChatType.GainBuff,
|
||||||
|
ChatType.LoseBuff => ChatType.GainBuff,
|
||||||
|
ChatType.GainDebuff => ChatType.GainDebuff,
|
||||||
|
ChatType.LoseDebuff => ChatType.GainDebuff,
|
||||||
|
ChatType.System => ChatType.System,
|
||||||
|
ChatType.Alarm => ChatType.System,
|
||||||
|
ChatType.GlamourNotifications => ChatType.System,
|
||||||
|
ChatType.RetainerSale => ChatType.System,
|
||||||
|
ChatType.PeriodicRecruitmentNotification => ChatType.System,
|
||||||
|
ChatType.Sign => ChatType.System,
|
||||||
|
ChatType.Orchestrion => ChatType.System,
|
||||||
|
ChatType.MessageBook => ChatType.System,
|
||||||
|
ChatType.NpcDialogue => ChatType.NpcDialogue,
|
||||||
|
ChatType.NpcAnnouncement => ChatType.NpcDialogue,
|
||||||
|
ChatType.LootRoll => ChatType.LootRoll,
|
||||||
|
ChatType.RandomNumber => ChatType.LootRoll,
|
||||||
|
ChatType.FreeCompanyAnnouncement => ChatType.FreeCompanyAnnouncement,
|
||||||
|
ChatType.FreeCompanyLoginLogout => ChatType.FreeCompanyAnnouncement,
|
||||||
|
ChatType.PvpTeamAnnouncement => ChatType.PvpTeamAnnouncement,
|
||||||
|
ChatType.PvpTeamLoginLogout => ChatType.PvpTeamAnnouncement,
|
||||||
|
_ => type,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace ChatTwo.Code;
|
namespace HellionChat.Code;
|
||||||
|
|
||||||
public enum InputChannel : uint
|
public enum InputChannel : uint
|
||||||
{
|
{
|
||||||
Executable
+203
@@ -0,0 +1,203 @@
|
|||||||
|
using Lumina.Excel.Sheets;
|
||||||
|
|
||||||
|
namespace HellionChat.Code;
|
||||||
|
|
||||||
|
internal static class InputChannelExt
|
||||||
|
{
|
||||||
|
internal static ChatType ToChatType(this InputChannel input) =>
|
||||||
|
input switch
|
||||||
|
{
|
||||||
|
InputChannel.Tell => ChatType.TellOutgoing,
|
||||||
|
InputChannel.Say => ChatType.Say,
|
||||||
|
InputChannel.Party => ChatType.Party,
|
||||||
|
InputChannel.Alliance => ChatType.Alliance,
|
||||||
|
InputChannel.Yell => ChatType.Yell,
|
||||||
|
InputChannel.Shout => ChatType.Shout,
|
||||||
|
InputChannel.FreeCompany => ChatType.FreeCompany,
|
||||||
|
InputChannel.PvpTeam => ChatType.PvpTeam,
|
||||||
|
InputChannel.NoviceNetwork => ChatType.NoviceNetwork,
|
||||||
|
InputChannel.CrossLinkshell1 => ChatType.CrossLinkshell1,
|
||||||
|
InputChannel.CrossLinkshell2 => ChatType.CrossLinkshell2,
|
||||||
|
InputChannel.CrossLinkshell3 => ChatType.CrossLinkshell3,
|
||||||
|
InputChannel.CrossLinkshell4 => ChatType.CrossLinkshell4,
|
||||||
|
InputChannel.CrossLinkshell5 => ChatType.CrossLinkshell5,
|
||||||
|
InputChannel.CrossLinkshell6 => ChatType.CrossLinkshell6,
|
||||||
|
InputChannel.CrossLinkshell7 => ChatType.CrossLinkshell7,
|
||||||
|
InputChannel.CrossLinkshell8 => ChatType.CrossLinkshell8,
|
||||||
|
InputChannel.Linkshell1 => ChatType.Linkshell1,
|
||||||
|
InputChannel.Linkshell2 => ChatType.Linkshell2,
|
||||||
|
InputChannel.Linkshell3 => ChatType.Linkshell3,
|
||||||
|
InputChannel.Linkshell4 => ChatType.Linkshell4,
|
||||||
|
InputChannel.Linkshell5 => ChatType.Linkshell5,
|
||||||
|
InputChannel.Linkshell6 => ChatType.Linkshell6,
|
||||||
|
InputChannel.Linkshell7 => ChatType.Linkshell7,
|
||||||
|
InputChannel.Linkshell8 => ChatType.Linkshell8,
|
||||||
|
InputChannel.ExtraChatLinkshell1 => ChatType.ExtraChatLinkshell1,
|
||||||
|
InputChannel.ExtraChatLinkshell2 => ChatType.ExtraChatLinkshell2,
|
||||||
|
InputChannel.ExtraChatLinkshell3 => ChatType.ExtraChatLinkshell3,
|
||||||
|
InputChannel.ExtraChatLinkshell4 => ChatType.ExtraChatLinkshell4,
|
||||||
|
InputChannel.ExtraChatLinkshell5 => ChatType.ExtraChatLinkshell5,
|
||||||
|
InputChannel.ExtraChatLinkshell6 => ChatType.ExtraChatLinkshell6,
|
||||||
|
InputChannel.ExtraChatLinkshell7 => ChatType.ExtraChatLinkshell7,
|
||||||
|
InputChannel.ExtraChatLinkshell8 => ChatType.ExtraChatLinkshell8,
|
||||||
|
InputChannel.Invalid => ChatType.Echo,
|
||||||
|
_ => throw new ArgumentOutOfRangeException(nameof(input), input, null),
|
||||||
|
};
|
||||||
|
|
||||||
|
public static uint LinkshellIndex(this InputChannel channel) =>
|
||||||
|
channel switch
|
||||||
|
{
|
||||||
|
InputChannel.Linkshell1 => 0,
|
||||||
|
InputChannel.Linkshell2 => 1,
|
||||||
|
InputChannel.Linkshell3 => 2,
|
||||||
|
InputChannel.Linkshell4 => 3,
|
||||||
|
InputChannel.Linkshell5 => 4,
|
||||||
|
InputChannel.Linkshell6 => 5,
|
||||||
|
InputChannel.Linkshell7 => 6,
|
||||||
|
InputChannel.Linkshell8 => 7,
|
||||||
|
InputChannel.CrossLinkshell1 => 0,
|
||||||
|
InputChannel.CrossLinkshell2 => 1,
|
||||||
|
InputChannel.CrossLinkshell3 => 2,
|
||||||
|
InputChannel.CrossLinkshell4 => 3,
|
||||||
|
InputChannel.CrossLinkshell5 => 4,
|
||||||
|
InputChannel.CrossLinkshell6 => 5,
|
||||||
|
InputChannel.CrossLinkshell7 => 6,
|
||||||
|
InputChannel.CrossLinkshell8 => 7,
|
||||||
|
InputChannel.ExtraChatLinkshell1 => 0,
|
||||||
|
InputChannel.ExtraChatLinkshell2 => 1,
|
||||||
|
InputChannel.ExtraChatLinkshell3 => 2,
|
||||||
|
InputChannel.ExtraChatLinkshell4 => 3,
|
||||||
|
InputChannel.ExtraChatLinkshell5 => 4,
|
||||||
|
InputChannel.ExtraChatLinkshell6 => 5,
|
||||||
|
InputChannel.ExtraChatLinkshell7 => 6,
|
||||||
|
InputChannel.ExtraChatLinkshell8 => 7,
|
||||||
|
_ => uint.MaxValue,
|
||||||
|
};
|
||||||
|
|
||||||
|
public static string Prefix(this InputChannel channel) =>
|
||||||
|
channel switch
|
||||||
|
{
|
||||||
|
InputChannel.Tell => "/t",
|
||||||
|
InputChannel.Say => "/s",
|
||||||
|
InputChannel.Party => "/p",
|
||||||
|
InputChannel.Alliance => "/a",
|
||||||
|
InputChannel.Yell => "/y",
|
||||||
|
InputChannel.Shout => "/sh",
|
||||||
|
InputChannel.FreeCompany => "/fc",
|
||||||
|
InputChannel.PvpTeam => "/pt",
|
||||||
|
InputChannel.NoviceNetwork => "/b",
|
||||||
|
InputChannel.CrossLinkshell1 => "/cwl1",
|
||||||
|
InputChannel.CrossLinkshell2 => "/cwl2",
|
||||||
|
InputChannel.CrossLinkshell3 => "/cwl3",
|
||||||
|
InputChannel.CrossLinkshell4 => "/cwl4",
|
||||||
|
InputChannel.CrossLinkshell5 => "/cwl5",
|
||||||
|
InputChannel.CrossLinkshell6 => "/cwl6",
|
||||||
|
InputChannel.CrossLinkshell7 => "/cwl7",
|
||||||
|
InputChannel.CrossLinkshell8 => "/cwl8",
|
||||||
|
InputChannel.Linkshell1 => "/l1",
|
||||||
|
InputChannel.Linkshell2 => "/l2",
|
||||||
|
InputChannel.Linkshell3 => "/l3",
|
||||||
|
InputChannel.Linkshell4 => "/l4",
|
||||||
|
InputChannel.Linkshell5 => "/l5",
|
||||||
|
InputChannel.Linkshell6 => "/l6",
|
||||||
|
InputChannel.Linkshell7 => "/l7",
|
||||||
|
InputChannel.Linkshell8 => "/l8",
|
||||||
|
InputChannel.ExtraChatLinkshell1 => "/ecl1",
|
||||||
|
InputChannel.ExtraChatLinkshell2 => "/ecl2",
|
||||||
|
InputChannel.ExtraChatLinkshell3 => "/ecl3",
|
||||||
|
InputChannel.ExtraChatLinkshell4 => "/ecl4",
|
||||||
|
InputChannel.ExtraChatLinkshell5 => "/ecl5",
|
||||||
|
InputChannel.ExtraChatLinkshell6 => "/ecl6",
|
||||||
|
InputChannel.ExtraChatLinkshell7 => "/ecl7",
|
||||||
|
InputChannel.ExtraChatLinkshell8 => "/ecl8",
|
||||||
|
_ => "/e",
|
||||||
|
};
|
||||||
|
|
||||||
|
public static IEnumerable<TextCommand>? TextCommands(this InputChannel channel)
|
||||||
|
{
|
||||||
|
uint[] ids = channel switch
|
||||||
|
{
|
||||||
|
InputChannel.Tell => [104, 118],
|
||||||
|
InputChannel.Say => [102],
|
||||||
|
InputChannel.Party => [105],
|
||||||
|
InputChannel.Alliance => [119],
|
||||||
|
InputChannel.Yell => [117],
|
||||||
|
InputChannel.Shout => [103],
|
||||||
|
InputChannel.FreeCompany => [115],
|
||||||
|
InputChannel.PvpTeam => [91],
|
||||||
|
InputChannel.NoviceNetwork => [101],
|
||||||
|
InputChannel.CrossLinkshell1 => [13],
|
||||||
|
InputChannel.CrossLinkshell2 => [14],
|
||||||
|
InputChannel.CrossLinkshell3 => [15],
|
||||||
|
InputChannel.CrossLinkshell4 => [16],
|
||||||
|
InputChannel.CrossLinkshell5 => [17],
|
||||||
|
InputChannel.CrossLinkshell6 => [18],
|
||||||
|
InputChannel.CrossLinkshell7 => [19],
|
||||||
|
InputChannel.CrossLinkshell8 => [20],
|
||||||
|
InputChannel.Linkshell1 => [107],
|
||||||
|
InputChannel.Linkshell2 => [108],
|
||||||
|
InputChannel.Linkshell3 => [109],
|
||||||
|
InputChannel.Linkshell4 => [110],
|
||||||
|
InputChannel.Linkshell5 => [111],
|
||||||
|
InputChannel.Linkshell6 => [112],
|
||||||
|
InputChannel.Linkshell7 => [113],
|
||||||
|
InputChannel.Linkshell8 => [114],
|
||||||
|
_ => [],
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ids.Length == 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return ids.Where(id => Sheets.TextCommandSheet.HasRow(id))
|
||||||
|
.Select(id => Sheets.TextCommandSheet.GetRow(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static bool IsLinkshell(this InputChannel channel) =>
|
||||||
|
channel switch
|
||||||
|
{
|
||||||
|
InputChannel.Linkshell1 => true,
|
||||||
|
InputChannel.Linkshell2 => true,
|
||||||
|
InputChannel.Linkshell3 => true,
|
||||||
|
InputChannel.Linkshell4 => true,
|
||||||
|
InputChannel.Linkshell5 => true,
|
||||||
|
InputChannel.Linkshell6 => true,
|
||||||
|
InputChannel.Linkshell7 => true,
|
||||||
|
InputChannel.Linkshell8 => true,
|
||||||
|
_ => false,
|
||||||
|
};
|
||||||
|
|
||||||
|
internal static bool IsCrossLinkshell(this InputChannel channel) =>
|
||||||
|
channel switch
|
||||||
|
{
|
||||||
|
InputChannel.CrossLinkshell1 => true,
|
||||||
|
InputChannel.CrossLinkshell2 => true,
|
||||||
|
InputChannel.CrossLinkshell3 => true,
|
||||||
|
InputChannel.CrossLinkshell4 => true,
|
||||||
|
InputChannel.CrossLinkshell5 => true,
|
||||||
|
InputChannel.CrossLinkshell6 => true,
|
||||||
|
InputChannel.CrossLinkshell7 => true,
|
||||||
|
InputChannel.CrossLinkshell8 => true,
|
||||||
|
_ => false,
|
||||||
|
};
|
||||||
|
|
||||||
|
internal static bool IsExtraChatLinkshell(this InputChannel channel) =>
|
||||||
|
channel switch
|
||||||
|
{
|
||||||
|
InputChannel.ExtraChatLinkshell1 => true,
|
||||||
|
InputChannel.ExtraChatLinkshell2 => true,
|
||||||
|
InputChannel.ExtraChatLinkshell3 => true,
|
||||||
|
InputChannel.ExtraChatLinkshell4 => true,
|
||||||
|
InputChannel.ExtraChatLinkshell5 => true,
|
||||||
|
InputChannel.ExtraChatLinkshell6 => true,
|
||||||
|
InputChannel.ExtraChatLinkshell7 => true,
|
||||||
|
InputChannel.ExtraChatLinkshell8 => true,
|
||||||
|
_ => false,
|
||||||
|
};
|
||||||
|
|
||||||
|
internal static bool IsValid(this InputChannel channel) =>
|
||||||
|
channel switch
|
||||||
|
{
|
||||||
|
InputChannel.Invalid => false,
|
||||||
|
_ => true,
|
||||||
|
};
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user