XIII
1
Little tiny thing but would be really useful to copy printed coordinates, model hashes or anything like that.
1 Like
All the console logs are in CitizenFX.log 
This innovation will be a great addition to the FiveM, as it will allow developers and testers to quickly copy the necessary information, without having to perform the extra step of opening a file with logs.
1 Like
schwim
7
If opening a file is too much hassle, can one really be considered a developer? I’m not speaking against the suggestion but come on, just save a shortcut on your desktop to the log location. If you’re developing, you already have your IDE/editor open and the log file will update automatically as more gets written to it.
Yes, this feature is not critically necessary, and we could have continued the topic in this rhetoric at the beginning of FiveM development, but it is now 3 years after the founding of this thread, which somewhat weakens the argument regarding the uselessness of this feature. In any case, it’s pretty obvious that the presence of this feature will improve the user experience.
nta
9
This is not trivially able to be implemented as there’s no support for a selectable, scrollable, appendable, read-only text box in the ‘dear ImGui’ library used for the console, which means that one would have to implement all of such text handling + rendering oneself, which, well:
If it were easy to implement, this would already be a feature. However, implementing a working text control is a project by itself already, and doing so just to have in-app selection/copy support in here is far excessive.
If you feel you’d be able to implement this functionality, you can edit the code and submit a pull request, however.
Orel65
10
Tho it’s not a solution, this may help you:
If you wanna copy texts you can make a function that copies the coordinates (or whatever) straight to your clipboard using NUI.
My code from years ago:
LUA:
function CopyText(text)
if type(text) == "vector3" then
text = string.format("%.2f, %.2f, %.2f", text.x, text.y, text.z)
end
SendNUIMessage({type = "global", meta = "copytext", text = text})
return ("Copied: "..text)
end
NUI JS:
let copytext = function(text)
{
elems.copytext.style.display = "block";
elems.copytext.value = text;
elems.copytext.select();
elems.copytext.setSelectionRange(0, text.length);
document.execCommand("copy");
elems.copytext.value = "";
elems.copytext.style.display = "none";
}
This is just an example as this is a part of a bigger code, so you will understand the idea and implement it yourself easily.
I guess this is even could be a suggestion to FiveM to let users copy text straight to the clipboard, but either way, it’s even possible without.
Thank you for the detailed response on this problem. Based on your answer, the main obstacle to solving the problem is highlighting the text. What if we add a button instead rectangle before each line of the log, or double-click handler on the line, would the proposed solution be possible and optimal?
The way I see it, copying the text by clicking a button or double-clicking on the log would be a perfectly fair solution.
nta
13
Then copying multiple lines would be a mess, so that’s also a silly solution. Treating a line as a checkbox, maybe, however.
From my experience situations when I had to copy several lines happened very rarely, mostly it was always information from a particular print in one line.
The checkbox solution sounds pretty interesting, because it will allow you to select multiple lines. And if along with that it would be possible to add the Ctrl + C hotkey, that would be ideal.
The ESC key or a close console action could serve to deselect the checkboxes.
i feel like it’s better to just have a button on the console that opens the logs folder
nta
17
That part is implemented now, yeah. Thanks for the suggestion!
4 Likes