voc0der / NWNLogRotator

Automatically stores, cleans, and colorizes your Neverwinter Nights chat logs.
MIT License
23 stars 5 forks source link

enhancement: Allow with a custom keypress to start a "new" log. #11

Open Porcar opened 3 years ago

Porcar commented 3 years ago

Would be awesome to allow the user to press a key (Let's say F12 for example), and this would save the timestamp of the log, after we press the key again it would stop, and save just the logs between those 2 times to a new file while asking the user for a name. While the normal log is saved the same normal way it works at the moment.

This would be pretty good for saving certain important scenes as separate files while keeping the full log as a backup as well.

What do you think?

voc0der commented 3 years ago

It's a neat idea. I'll think about how to implement it but it will take some time before I get to it.

voc0der commented 3 years ago

Unfortunately I have decided I won't be implementing this. if you open a pull request, I can look at it.

The main reason why not: Keybinds outside of the scope of the immediate application require administrative privileges and can overwrite and conflict with system hotkeys, which at the moment is well beyond the scope of this application. Sorry.

Porcar commented 3 years ago

Was thinking a bit about this, and how about making it a button inside the app?

"Start new Log" Saves the current one, and starts a new one. basically the same as closing the game and opening it up again. What'd you think?

voc0der commented 3 years ago

Do you know how NWN handles stuff like that?

1) If you open the game, then join a server, and you're typing, it goes to => nwclientLog1.txt 2) If you are still in the game, and you DELETE that file, then start typing again, where does it go then? A new file same name? (nwclientLog1.txt) 2a) Does NWN complain that you did step 2 in any way?

Please report if you tried on 1.69 or EE. I guess it would be great if you could do both, but I don't know if you have them?

If that's the case, yeah, it definitely can do that. If you could please try that out and let me know what you find it would be very helpful. Otherwise when I get around to it, I'll see what I can do.

Thanks

Porcar commented 3 years ago

Just tried that, sadly can't delete the file as NWN keeps it open...

voc0der commented 3 years ago

Ouch. I just ran a few tests as well. If you modify the nwClientLog1.txt file while the game is running, it will save, but the next event in NWN will remove what you changed; possibly even bluescreen you (happened to me), so adding something like a bookmarked timestamp to differentiate between log a, and log b, within 1 log isn't an option.

Another solution would be hacky; it would involve writing a timestamp in another file, then when it gets to processing the log, it detects the presence of that file, then splits the log by that timestamp when it's being processed into n times (where n is the amount of new logs). Not sure I really want to go down that path, but I will think about it some more. It would be a fair bit of work to accomplish and test..

Porcar commented 3 years ago

Just tested something, and you can copy the nwClientLog1.txt file with the game opened, I'm thinking, could you make the "Run Once" button work with the copy of the file? if so...maybe add another button that auto-copies the file, saves the log and then deletes the copy?

NWN1star commented 1 year ago

I've been hoping to have this feature added, does "added this optimization to..." mean you figured out how to do it? If you did when will it go live? I didn't see it in the latest update a month ago.

NWN1star commented 1 year ago

Just tested something, and you can copy the nwClientLog1.txt file with the game opened, I'm thinking, could you make the "Run Once" button work with the copy of the file? if so...maybe add another button that auto-copies the file, saves the log and then deletes the copy?

Mind if I ask what the purpose of the "run once" option is for?

voc0der commented 1 year ago

I've been hoping to have this feature added, does "added this optimization to..." mean you figured out how to do it? If you did when will it go live? I didn't see it in the latest update a month ago.

I haven't had enough time to work on this, but if enough people want this, I'll try to prioritize this project more.

Just tested something, and you can copy the nwClientLog1.txt file with the game opened, I'm thinking, could you make the "Run Once" button work with the copy of the file? if so...maybe add another button that auto-copies the file, saves the log and then deletes the copy?

Mind if I ask what the purpose of the "run once" option is for?

Run once is if you have old log files that you kept with an old log rotator or saved manually, and wanted to parse them after the fact.

Don't hesitate to star the project if it has helped you, your support might motivate me a bit.