[LDCad] Addon


RE: [LDCad] Addon
#2
(2019-09-19, 11:37)Miguel Reizinho Wrote: Hello!

I've been doing some experiments and Roland suggested I shared them in this forum.

I've done some icons and themes in the past for LDCad. They are usually flat design themes, from several colors, with clear monochromatic icons

[Image: Blue-Theme.png]

But I also wanted to be able to change the color of the titlebar of LDCad window from white, in the example above, to match the color of the menubar. I asked Roland about it but unfortunately that option was not available through the regular configuration files. But his reply about objects and windows class put me in the right track! I research a little and found out Autohotkey, a scripting language for Windows. 

And what started as a pure cosmetic change turned out into a little addon that creates 4 extra buttons on the menubar, some additional hotkeys and the possibility to toggle on/off completely the window titlebar. 

[Image: Dark-Theme.png]
Only works in windows unfortunately

You can see a small video of the addon in action here: https://youtu.be/sDCpDDpfEWY

Here is a brief technical explanation. Autohotkey script grabs LDcad class window and creates an overlay GUI, an extension of the menubar, at a certain position. It creates the extra buttons and show/hides them as necessary. Then registers the mouse clicks and position to change images, cursor and run actions. Pressing the new menubar button will maximize the window, remove titlebar and show additional window control buttons on the menubar (min, restore, close window). It will also register new hotkeys to enable/disable the titlebar, show/hide the menubar, reload script, etc. The autohotkey script is called by a new autorun.lua script also included. So once LDCad loads and finishes updating the PartBin, you'll see a CMD window flash briefly (due to limitations of the io.popen function in the lua script) and the new button will appear on the menubar. Feel free to open the autohotkey script and look around.

Features:
1. New Hotkeys 
- CTRL+T to toggle titlebar
- F11 to toggle menubar (have to config LDCad hotkey show/hide menubar to F10)
- Left Double Click on menubar will maximize/restore window

Requirements:

1. Install Autohotkey
2. Download Addon
3. Download themes (optional)
Blue
Dark
Gray

Instructions:
1. Unzip files inside Titlebar Addon.zip to your LDCad instalation folder
2. Copy autorun.lua to your profile LDCad global script folder i.e %appdata%\Roaming\LDCad\scripts\default\global
3. Edit autorun.lua and change path to your LDCad.exe accordingly
4. Depending on your buttons of the menu bar, you might have to adjust the origin of the new complement menubar.
- Open autorun.ahk with a text editor
- Find line 21, code "MenuPos = 1338"
- Change value "1338" for what suits you best. Increasing the number will move origin to the right. Decreasing will move to the left
 

Let me know if you need extra help in setting this up.

Hope you enjoy!


Those look AWESOME! Would it be possible to put this as tutorial on the wiki? Drop me a line if you have problems with setting up an account.

Obviously it would be best if LDCad would ship with the possibility to select those skins from within the prog with no need to do all those hacking ... don't listen to me just dreaming aloud ;-)

w.
LEGO ergo sum
Reply
« Next Oldest | Next Newest »



Messages In This Thread
[LDCad] Addon - by Miguel Reizinho - 2019-09-19, 11:37
RE: [LDCad] Addon - by Willy Tschager - 2019-09-19, 15:41
RE: [LDCad] Addon - by Miguel Reizinho - 2019-09-19, 16:38
RE: [LDCad] Addon - by Philippe Hurbain - 2019-09-20, 5:25
RE: [LDCad] Addon - by Miguel Reizinho - 2019-09-20, 10:16
RE: [LDCad] Addon - by Willy Tschager - 2019-09-23, 14:37
RE: [LDCad] Addon - by Miguel Reizinho - 2019-10-01, 10:47
RE: [LDCad] Addon - by Willy Tschager - 2019-10-02, 13:25
RE: [LDCad] Addon - by Orion Pobursky - 2019-10-02, 14:01
RE: [LDCad] Addon - by Miguel Reizinho - 2019-10-02, 15:37
RE: [LDCad] Addon - by Jaco van der Molen - 2019-10-03, 11:50
RE: [LDCad] Addon - by Milan Vančura - 2019-10-05, 0:27
RE: [LDCad] Addon - by Roland Melkert - 2019-10-06, 17:46
RE: [LDCad] Addon - by Milan Vančura - 2019-10-07, 14:41
RE: [LDCad] Addon - by Lidong - 2020-03-17, 2:57
RE: [LDCad] Addon - by Roland Melkert - 2020-03-17, 21:46
RE: [LDCad] Addon - by Lidong - 2020-03-18, 2:55
RE: [LDCad] Addon - by Roland Melkert - 2020-03-18, 19:43
RE: [LDCad] Addon - by Lidong - 2020-03-20, 9:18
RE: [LDCad] Addon - by Roland Melkert - 2020-03-23, 20:18

Forum Jump:


Users browsing this thread: 3 Guest(s)