Author Topic: Modifying group/squad logs to be copy-able.  (Read 2207 times)

Offline Skippah

  • Senior Community Member
  • ****
  • Posts: 88
  • Registered: 07/04/2013
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
  • Ingame: Skippah
Modifying group/squad logs to be copy-able.
« on: 03 01, 2015, 12:25:29 pm »
 Hello everyone, as we all know, many groups/squads has a topic for group/squad-logs. So my suggestion is being able to copy lines from group/squad history and that will eventually save time for moderators instead of copying every singe word. Hopefully it's pretty easy to script as the console / F8 has this ability. Hope I kept it simple, thanks for your time. Thanks to @Ryan. , here is a script to make things easier.


 Constructive additions :
Code: Lua
  1. -- GUI
  2. log_wnd = guiCreateWindow(457, 296, 447, 112, "CIT getSelectedText", false)
  3. preview_mem = guiCreateMemo(9, 23, 428, 49, "", false, log_wnd)
  4. close_log_btn = guiCreateButton(9, 71, 428, 31, "Close Window", false, log_wnd)
  5.  
  6. -- Export
  7. function getSelectedText(theGrid)
  8.         local r, c = guiGridListGetSelectedItem(theGrid)
  9.         if ((r > -1) and (c)) then
  10.                 local text = guiGridListGetItemText(theGrid, r, c)
  11.                 guiSetVisible(log_wnd, true)
  12.                 showCursor(true)
  13.                 guiSetText(preview_mem, text)
  14.         end
  15. end
  16.  
  17. -- Close preview window...
  18. function closePreview()
  19.         guiSetVisible(log_wnd, false)
  20.         showCursor(false)
  21. end
  22. addEventHandler("onClientGUIClick", close_log_btn, closePreview, false)
  23.  
You could directly using this function setClipboard
« Last Edit: 03 01, 2015, 03:52:24 pm by Skippah »

Offline ToxiK

  • Junior Community Member
  • **
  • Posts: 12
  • I love you too :* ( ͡͡ ° ͜ ʖ ͡ °)
  • Registered: 15/11/2012
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
  • Group: SAPD
  • Ingame: ToxiK[SAPD]
  • Squad: 404
Re: Modifying group/squad logs to be copy-able.
« Reply #1 on: 03 01, 2015, 12:36:24 pm »
Great idea, with the ability to copy group/squad logs, it will be easiest to update some topics in our boards, mainly, the logs and the blacklist. Upvoting!
"The greatest gift you can give someone is your time because when you give your time, you are giving a portion of your life that you will never get back."

Portuguese and Proud

Offline Ryan.

  • Honorable
  • *****
  • Posts: 104
  • Skillers™
  • Registered: 28/06/2012
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Modifying group/squad logs to be copy-able.
« Reply #2 on: 03 01, 2015, 01:15:05 pm »
Voting positive...

I've made a simple function which can be added in CIT Misc functions and can be exported in other scripts by getSelectedText(grid) function, here are pictures: http://imgur.com/a/5NwRL


And here is the code, with GUI stuff:
Code: Lua
  1. -- GUI
  2. log_wnd = guiCreateWindow(457, 296, 447, 112, "CIT getSelectedText", false)
  3. preview_mem = guiCreateMemo(9, 23, 428, 49, "", false, log_wnd)
  4. close_log_btn = guiCreateButton(9, 71, 428, 31, "Close Window", false, log_wnd)
  5.  
  6. -- Export
  7. function getSelectedText(theGrid)
  8.         local r, c = guiGridListGetSelectedItem(theGrid)
  9.         if ((r > -1) and (c)) then
  10.                 local text = guiGridListGetItemText(theGrid, r, c)
  11.                 guiSetVisible(log_wnd, true)
  12.                 showCursor(true)
  13.                 guiSetText(preview_mem, text)
  14.         end
  15. end
  16.  
  17. -- Close preview window...
  18. function closePreview()
  19.         guiSetVisible(log_wnd, false)
  20.         showCursor(false)
  21. end
  22. addEventHandler("onClientGUIClick", close_log_btn, closePreview, false)
  23.  
I am not "Ex." anything, I have proudly served this community as: SK Founder,
 Developer, L3 staff, L2 staff, Supporter, Minister of Fairness, PAM, CB, PC, SO, Senior Community Member and of course, a rule abiding player. Peace.

Offline Prime

  • Senior Community Member
  • ****
  • Posts: 12
  • Registered: 30/04/2012
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
  • Ingame: Prime
Re: Modifying group/squad logs to be copy-able.
« Reply #3 on: 03 01, 2015, 03:31:25 pm »
Uhm...not sure but instead of creating window on clicking and then copy/pasting it, you could directly using this function setClipboard

Offline Ryan.

  • Honorable
  • *****
  • Posts: 104
  • Skillers™
  • Registered: 28/06/2012
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: Modifying group/squad logs to be copy-able.
« Reply #4 on: 03 01, 2015, 04:28:27 pm »
Uhm...not sure but instead of creating window on clicking and then copy/pasting it, you could directly using this function setClipboard
I know, I just made it so that people can cop 'some selective' log part from text, imo GUI wasn't bad idea. Though I just made a suggestion-addition to let developers know what I am actually suggesting.
I am not "Ex." anything, I have proudly served this community as: SK Founder,
 Developer, L3 staff, L2 staff, Supporter, Minister of Fairness, PAM, CB, PC, SO, Senior Community Member and of course, a rule abiding player. Peace.

Offline Arran

  • Administrator
  • ******
  • Posts: 5642
  • Registered: 20/11/2010
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
  • Ingame: [CIT]Arran
Re: Modifying group/squad logs to be copy-able.
« Reply #5 on: 04 01, 2015, 01:05:25 pm »
Added the ability to CTRL + C selected grid list text.
Proof You Are so Much More Than What You Realise
Authority is not truth. Truth is authority.