EQAditu / AdvancedCombatTracker

Advanced Combat Tracker
https://advancedcombattracker.com
117 stars 25 forks source link

Inconsistency in Line Separators When Copying Logs from Battle Log on Windows #113

Open MnFeN opened 2 days ago

MnFeN commented 2 days ago

Environment

Issue Description

When multiple lines from the battle log are selected and copied within the ACT environment, the line separators are denoted by "\n" instead of the Windows-standard "\r\n". This causes an issue when pasting these logs into other WinForm-based plugins of ACT; the pasted text does not recognize line breaks properly. Instead of starting a new line, the text continues with an invisible "\n" between the lines, which can lead to input errors and misinterpretation of the data.

Expected Behavior

The copied text should use "\r\n" as a line separator to conform to Windows standards, ensuring proper line breaks when pasting text into other Windows-based applications or plugins.

Steps to Reproduce

  1. Open ACT and navigate to the battle log.
  2. Select multiple lines of log data and copy them.
  3. Paste the copied text into any other WinForm-based plugin within ACT.
  4. Observe that the line breaks are not processed correctly, leading to continuous lines of text.

Additional Context

This inconsistency can affect data parsing and display, making it difficult for users to interpret the logs accurately. Adjusting the line separator to the appropriate Windows format could resolve this input mishandling issue.

EQAditu commented 2 days ago

ACT has no feature called a battle log... could not reproduce using the only thing I could think of... image

MnFeN commented 2 days ago

ACT has no feature called a battle log... could not reproduce using the only thing I could think of... image

Thank you for the response. Here are the screenshots of my log and copied data (without \r):

The decompiled methods also did not contain \r:

image

It could be better if the extra linebreak after the final line could be removed. Thanks!

EQAditu commented 16 hours ago

The main problem with this request is that WinForms itself is not consistent. When you type "1\<Enter>2" in a RichTextBox, you create 3 characters; in a TextBox it creates 4.
image

Forcing 1\r\n2 will be displayed differently in a TextBox vs a RichTextBox. (4 characters) image

1\n2 will be shown the same way in both. (3 characters) image This makes \n the safest solution to use unless you are using text files on your filesystem.

\r is also not compatible with Linux WINE control text rendering... it will show a hollow box instead of it being invisible, so I avoid using it anywhere a WinForms control will be used such as message boxes or any control.

I'm still considering how to handle this.