PDA

View Full Version : Making changes to manager_desktop.lua from an external script.



RTFallen
August 19th, 2014, 15:29
I was wondering if it was possible to make changes to the variables in the manager_desktop.lua variables from an outside script.

I've tried this:


local stackcolumns = 1;
local stackiconsize = { 92, 50 };
local stackspacing = { 0, 0 };
local stackoffset = { 5, 0 };

local stacktodockspacing = 0;

local dockiconsize = { 92, 27 };
local dockspacing = 2;
local dockoffset = { 5, 0 };

function onInit()
DesktopManager.stackcolumns = stackcolumns;
DesktopManager.stackiconsize = stackiconsize;
DesktopManager.stackspacing = stackspacing;
DesktopManager.stackoffset = stackoffset;

DesktopManager.stacktodockspacing = stacktodockspacing;

DesktopManager.dockiconsize = dockiconsize;
DesktopManager.dockspacing = dockspacing;
DesktopManager.dockoffset = dockoffset;
end


But I'm thinking that since they are local variables to the manager_desktop.lua that they can't actually be changed from outside the script. I'm trying to create a theme that changes the dock and stack columns, but I'm not wanting to make changes to manager_desktop.lua unless I absolutely have to.

Thanks in advance.

Resire

Trenloe
August 19th, 2014, 15:54
As you suspect, you can't access them externally because they are local to that script. You'll need to add some small functions to manager_desktop.lua to expose a function to allow you to change the local variables. Of course, this will mean that on each future version change of CoreRPG you'll have to see if manager_desktop.lua has changed since the previous versions and update accordingly.

RTFallen
August 19th, 2014, 16:01
As you suspect, you can't access them externally because they are local to that script. You'll need to add some small functions to manager_desktop.lua to expose a function to allow you to change the local variables. Of course, this will mean that on each future version change of CoreRPG you'll have to see if manager_desktop.lua has changed since the previous versions and update accordingly.

Thanks Trenloe. I think I'll just make my changes in the manager_desktop.lua. Thinking about trying to add a button to hide (or reduce the size) of the side column anyway, so will probably add the functions to the script as well.

Resire