-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLibreDeck Client.ahk
More file actions
1856 lines (1732 loc) · 58.8 KB
/
LibreDeck Client.ahk
File metadata and controls
1856 lines (1732 loc) · 58.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
; OS Version ...: > Windows 10
; Requires AutoHotkeyU32
;@Ahk2Exe-SetName LibreDeck Client
;@Ahk2Exe-SetDescription Macro Panel Client
;@Ahk2Exe-SetVersion 3.8.9
;@Ahk2Exe-SetCopyright 2026`, elModo7 - VictorDevLog
;@Ahk2Exe-SetOrigFilename LibreDeck Client.exe
; INITIALIZE
; *******************************
/*
TODO:
- Reactive window configurer GUI (Program Selector, Page Selector)
- Más funciones de OBS
- BtnDescriptions (label con texto de descripción (texto, color, transparencia, fontweight))
REQUIERES:
- Windows 10
- AutoHotkey U32 (las librerías JSON y them.dll no funcionan en U64)
- Compilar sin MPRESS, se pierde compatibilidad con USkin.dll
- Notification System ONLY works when compiled
DISCARDED:
- Volver a la carpeta anterior y volver a la raíz si se pulsa p.ej control
LATEST CHANGES:
- GoLang server support
- OBS Websocket Compat 4.x -> 5.X
- Improve online mode
- Add dynamic buttons (3.7.6+)
- Add notifications integration (same machine via talk.ahk) (3.7.6+)
- Add remote icon, background changes (3.8.1+)
- Add spotify integration (3.8.2+) -> https://github.com/CloakerSmoker/Spotify.ahk
COMMENTS:
- This script is one of my very first AutoHotkey scripts (Jun 2017), it can be improved A LOT, code quality wise (starting from keeping it consistent with a single language instead of Spanglish). However, I use it on a day to day basis and it is "robust enough" and convenient that I make heavy use of it, even above any other Hotkey, Dedicated Keyboard, Macro Deck, StreamDock or Android solutions I currently have purchased.
- It packs a few libraries of my own and a few "hacky" resources. While doing it I learned A LOT on GUI optimisations such as double buffering, temporal GUI freezing, image in-memory caching for quick updates, autoupdating scripts, Config, Sockets, WebSockets, OSC protocol, theming, GDI, Win32 API, HTTP OBJ, encryption, base 64 resources, queuing...
- It gave birth to many snippets for other projects such as OBS Control via WebSockets, OBSBOT Gimbal Webcams control via OSC, SplashScreen and About generic GUI snippets, ClientUpdater lib, Installer Generator, Obfuscation (removed), Online Licensing (removed).
*/
#NoEnv
#Persistent
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
DetectHiddenWindows, On
CoordMode,Mouse,Screen
SetBatchLines, -1
#Include, <JSON>
#Include <SplashScreen>
#Include <Socket>
#Include <util>
#Include <client_updater>
#Include <aboutScreen>
#Include <talk>
#Include <plugin_system>
rutaSplash = ./resources/img/splash.png
global ClientVersionNumber := "3.8.9"
global ClientVersion := ClientVersionNumber " - elModo7 / VictorDevLog " A_YYYY
SplashScreen(rutaSplash, 3000, 545, 160, 0, 0, true)
global EsVisible = true
global EnCarpeta = false
global CarpetaBoton, PaginaCarpeta, BotonActivo, BotonAPulsar, windowHandler, IpTxt, PortTxt, OnlineChk, AHK_ICONCLICKCOUNT, server_config, previousActiveProcess
global RutaBoton1, RutaBoton2, RutaBoton3, RutaBoton4, RutaBoton5, RutaBoton6, RutaBoton7, RutaBoton8, RutaBoton9, RutaBoton10, RutaBoton11, RutaBoton12, RutaBoton13, RutaBoton14, RutaBoton15
global feedbackEjecucion := []
global plugins := []
global NumeroPagina := 0
global serverFound := 0
global reactiveWindow := 0
global MsgBoxBtn1, MsgBoxBtn2, MsgBoxBtn3, MsgBoxBtn4
SkinForm(Apply, A_ScriptDir . "\lib\script_generator\lib\them.dll", A_ScriptDir . "\lib\script_generator\lib\tm")
OnExit, GetOut
FileCreateDir, conf
global btnPics := {}
GuiControl, splashScreen:, splashTxt, % "Reading config..."
contextcolor(2) ;0=Default ;1=AllowDark ;2=ForceDark ;3=ForceLight ;4=Max
; Talk (WM_COPYDATA) params
global incomingNotification := {"text": "", "duration": 1000, "region": "top"} ; Notification System
global incomingButtonChange := {"imagePathOrName": "", "buttonId": 14}
global incomingBackgroundChange := {"imagePathOrName": ""}
global incomingPageChange := {"pageNumber": 0, "isFolder": 0, "folderName": ""}
if(!FileExist("./conf/config.json"))
{
GuiControl, splashScreen:, splashTxt, % "Config not found, creating new config..."
conf := {}
conf.programFolder["obs64.exe"] := "obs"
conf.programFolder["SciTE.exe"] := "ahk"
conf.scriptEditorPath := "C:\Program Files\AutoHotkey\SciTE\SciTE.exe"
conf.ip := "127.0.0.1"
conf.port := "7778"
conf.resourcesPort := "7779"
conf.extension := "ahk"
conf.folderButtons := {"5":"OBS"}
conf.folderButtons.1 := "UtilesStream"
conf.folderButtons.2 := "SonidosOBS"
conf.folderButtons.3 := "VoiceMod"
conf.folderButtons.6 := "App"
conf.folderButtons.7 := "Game"
conf.folderButtons.4 := "Magix"
conf.folderButtons.8 := "AHK"
conf.pantalla_Mitad_X := A_ScreenWidth / 2
conf.pantalla_Mitad_Y := A_ScreenHeight / 2
conf.x_Inicial := 960
conf.y_Inicial := 1080
conf.moverRatonAlPulsarBoton := 1
conf.enviarAltTabAlPulsarBoton := 1
conf.cargaProgresivaIconos := 0
conf.siempreVisible := 0
conf.miniClient := 0
conf.online := 0
conf.builtin_ahk := 1
conf.reactiveWindow := 0
conf.lookForUpdates := 1
conf.isGolangServer := 0
gosub, guardarConfig
}
gosub, loadConfig
GuiControl, splashScreen:, splashTxt, % "Creating Tray & Context Menus..."
; dark mode menu options
contextcolor(color:=2) ; change the number here from the list above if you want light mode
{
static uxtheme := DllCall("GetModuleHandle", "str", "uxtheme", "ptr")
static SetPreferredAppMode := DllCall("GetProcAddress", "ptr", uxtheme, "ptr", 135, "ptr")
static FlushMenuThemes := DllCall("GetProcAddress", "ptr", uxtheme, "ptr", 136, "ptr")
DllCall(SetPreferredAppMode, "int", color)
DllCall(FlushMenuThemes)
}
; TRAY MENU
; *******************************
Menu, tray, NoStandard
Menu, tray, tip, LibreDeck Client v%ClientVersionNumber%
Menu, tray, add, Run LibreDeck server, runServer
Menu tray, Icon, Run LibreDeck server, .\resources\img\ico\libredeck.ico
Menu, tray, add, Hide, ToggleHide
Menu tray, Icon, Hide, .\resources\img\ico\windows\cut_visibility.ico
Menu, tray, add, Set Editor Path, CambiarRutaEditor
Menu tray, Icon, Set Editor Path, .\resources\img\ico\windows\edit2.ico
Menu tray, add, Set Start Window Possition, setStartPossition
Menu tray, Icon, Set Start Window Possition, .\resources\img\ico\windows\window_possition.ico
Menu tray, add, Backup LibreDeck Folder (*.7z), generateBackup
Menu tray, Icon, Backup LibreDeck Folder (*.7z), .\resources\img\ico\windows\compressed_folder.ico
Menu tray, add, Open LibreDeck Folder, openLibreDeckFolder
Menu tray, Icon, Open LibreDeck Folder, .\resources\img\ico\windows\folder.ico
Menu, tray, add
Menu, tray, add, Network Settings, crearGuiNetworkSettings
Menu tray, Icon, Network Settings, .\resources\img\ico\windows\network2.ico
Menu, tray, add
Menu LookForUpdatesMenu, Add, On Boot, lookForUpdatesOnBootLabel
Menu LookForUpdatesMenu, Icon, On Boot, .\resources\img\ico\windows\look_for_updates.ico
Menu LookForUpdatesMenu, Add, Now, lookForUpdatesLabel
Menu LookForUpdatesMenu, Icon, Now, .\resources\img\ico\windows\download.ico
Menu tray, Add, Look for Updates, :LookForUpdatesMenu
Menu tray, Icon, Look for Updates, .\resources\img\ico\windows\refresh.ico
Menu, tray, add, % "v" ClientVersion, showAboutScreen
Menu tray, Icon, % "v" ClientVersion, .\resources\img\ico\windows\info.ico
;~ Menu, tray, disable, % "v" ClientVersion
Menu, tray, add, Exit, Exit
Menu tray, Icon, Exit, .\resources\img\ico\windows\close3.ico
if(conf.lookForUpdates)
Menu LookForUpdatesMenu, Check, On Boot
else
Menu LookForUpdatesMenu, UnCheck, On Boot
; CONTEXT MENU GENERICO
; *******************************
Menu ContextMenuGenerico, Add, Always on Top, SiempreVisible
if(conf.siempreVisible)
{
Menu ContextMenuGenerico, Check, Always on Top
}
else
{
Menu ContextMenuGenerico, UnCheck, Always on Top
}
Menu ContextMenuGenerico, Add, Center Mouse after Activation, MoverRatonAlPulsarBotonToggle
if(conf.moverRatonAlPulsarBoton)
{
Menu ContextMenuGenerico, Check, Center Mouse after Activation
}
else
{
Menu ContextMenuGenerico, UnCheck, Center Mouse after Activation
}
Menu ContextMenuGenerico, Add, Send Alt+Tab after Activation, enviarAltTabAlPulsarBotonToggle
if(conf.enviarAltTabAlPulsarBoton)
{
Menu ContextMenuGenerico, Check, Send Alt+Tab after Activation
}
else
{
Menu ContextMenuGenerico, UnCheck, Send Alt+Tab after Activation
}
Menu ContextMenuGenerico, Add, Progressive Icon Loading, cargaProgresivaIconosToggle
if(conf.cargaProgresivaIconos)
{
Menu ContextMenuGenerico, Check, Progressive Icon Loading
}
else
{
Menu ContextMenuGenerico, UnCheck, Progressive Icon Loading
}
Menu ContextMenuGenerico, Add, Mini Client, CambiarDimensionesCliente
Menu ContextMenuGenerico, UnCheck, Mini Client
Menu ContextMenuGenerico, Add, Set Start Window Possition, setStartPossition
Menu ContextMenuGenerico, UnCheck, Set Start Window Possition
Menu ContextMenuGenerico, Add, Use built-in AHK, toggleBuiltInAhk
if(conf.builtin_ahk)
{
Menu ContextMenuGenerico, Check, Use built-in AHK
}
else
{
Menu ContextMenuGenerico, UnCheck, Use built-in AHK
}
Menu ContextMenuGenerico, Add, Minimize to tray (Hide), ToggleHide
Menu ContextMenuGenerico, Add, Reactive Pages, changeReactiveSetting
if(conf.reactiveWindow)
{
Menu ContextMenuGenerico, Check, Reactive Pages
}
else
{
Menu ContextMenuGenerico, UnCheck, Reactive Pages
}
Menu ContextMenuGenerico, Add, Bind this folder to a program or window, bindFolderToProgramOrWindow
Menu ContextMenuGenerico, Disable, Bind this folder to a program or window
; Plugin System
GuiControl, splashScreen:, splashTxt, % "Loading Plugins..."
Loop, Files, plugins/*.json
{
FileRead, pluginJson, % A_LoopFileFullPath
plugin := ParseJson(pluginJson)
plugins.push(plugin)
}
SortPluginsByPriority(plugins)
gosub, reloadPlugins
GuiControl, splashScreen:, splashTxt, % "Loaded Plugins!"
Menu ContextMenu, Add, Edit Script`tShift + Click, GuiEditarScript
Menu ContextMenu, Default, Edit Script`tShift + Click
Menu ContextMenu, Icon, Edit Script`tShift + Click, .\resources\img\ico\windows\edit2.ico
Menu ContextMenu, Add, Script Generator`tAlt + Right Click, :scriptGenerator
Menu ContextMenu, Icon, Script Generator`tAlt + Right Click, shell32.dll, 85
Menu ContextMenu, Add, Change/Del Image`tCtrl + Shift + Click, GuiCambiarImagenBoton
Menu ContextMenu, Icon, Change/Del Image`tCtrl + Shift + Click, shell32.dll, 142
Menu ContextMenu, Add, Button Name`tCtrl + Click, GuiInfoBoton
Menu ContextMenu, Icon, Button Name`tCtrl + Click, shell32.dll, 24
Menu ContextMenu, Add, Create Folder Button, CreateFolderButton
Menu ContextMenu, Icon, Create Folder Button, .\resources\img\ico\windows\folder.ico
Menu ContextMenu, Add, Delete Folder Button, DeleteFolderButton
Menu ContextMenu, Icon, Delete Folder Button, shell32.dll, 235
Menu ContextMenu, Add, Delete Button Function, DeleteButtonFunction
Menu ContextMenu, Icon, Delete Button Function, shell32.dll, 132
; CONNECTION TO SERVER (ONLINE == 1)
if(conf.online)
{
GuiControl, splashScreen:, splashTxt, % conf.ip ":" conf.port " - Connecting to server..."
sleep, 1 ; Needed to apply previous GuiControl
global tcpCon := new SocketTCP()
tcpCon.connect(conf.ip, conf.port)
tcpCon.onRecv := Func("OnTcpRecv")
if(tcpCon.errorNM != "")
{
gosub, precargaIconosLocalesEnRam
GuiControl, , wifi_icon, % btnPics["wifi_icon_offline.png"] ? "HBITMAP:*" btnPics["wifi_icon_offline.png"] : ""
serverFound := 0 ; Online Mode but couldn't connect, so we keep Offline Functionality
GuiControl, splashScreen:, splashTxt, % tcpCon.errorNM
Sleep, 500
}
else
{
serverFound := 1
GuiControl, splashScreen:, splashTxt, % "Connected! Downloading Profile..."
gosub, downloadServerProfile
GuiControl, , wifi_icon, % btnPics["wifi_icon_online.png"] ? "HBITMAP:*" btnPics["wifi_icon_online.png"] : ""
FileRead, server_config, % "./resources/img/" conf.ip "/resourcePack_info.txt"
server_config := ParseJson(server_config)
conf.folderButtons := server_config.folderButtons
}
}
else
{
gosub, precargaIconosLocalesEnRam
}
GuiControl, splashScreen:, splashTxt, % "Creating GUI..."
; GUI
; *******************************
Gui, Color, 282828
Gui -Caption +LastFound +ToolWindow +HwndwindowHandler +E0x02080000
Loop, 15
{
i := A_Index
var := "Boton" i
src := btnPics[i ".png"] ? "HBITMAP:*" btnPics[i ".png"] : "HBITMAP:*" btnPics["button_placeholder.png"]
Gui, Add, Picture, +BackgroundTrans gOnButton v%var%, % src
}
; Fondos Activaciones Botones
Gui Add, Picture, vActivar1 Hidden x120 y40 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar2 Hidden x280 y40 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar3 Hidden x440 y40 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar4 Hidden x600 y40 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar5 Hidden x760 y40 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar6 Hidden x120 y220 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar7 Hidden x280 y220 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar8 Hidden x440 y220 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar9 Hidden x600 y220 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar10 Hidden x760 y220 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar11 Hidden x120 y400 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar12 Hidden x280 y400 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar13 Hidden x440 y400 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar14 Hidden x600 y400 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
Gui Add, Picture, vActivar15 Hidden x760 y400 w150 h150, % btnPics["FondoActivacion.png"] ? "HBITMAP:*" btnPics["FondoActivacion.png"] : ""
; Botones Página
Gui Add, Picture, +BackgroundTrans gRightPage vRightPage x910 y240 w130 h130, % btnPics["RightPage.png"] ? "HBITMAP:*" btnPics["RightPage.png"] : ""
Gui Add, Picture, +BackgroundTrans gLeftPage vLeftPage x0 y240 w130 h130, % btnPics["LeftPage.png"] ? "HBITMAP:*" btnPics["LeftPage.png"] : ""
; Icono Ajustes
Gui Add, Picture, +BackgroundTrans gGuiContextMenu vsettings_icon x960 y0 w64 h64, % btnPics["settings_icon.png"] ? "HBITMAP:*" btnPics["settings_icon.png"] : ""
; Icono Wi-Fi
Gui Add, Picture, +BackgroundTrans gcrearGuiNetworkSettings vwifi_icon x960 y536 w64 h64, % btnPics["wifi_icon_disabled.png"] ? "HBITMAP:*" btnPics["wifi_icon_disabled.png"] : ""
if(serverFound)
{
GuiControl, , wifi_icon, % btnPics["wifi_icon_online.png"] ? "HBITMAP:*" btnPics["wifi_icon_online.png"] : ""
}
else if(conf.online)
{
GuiControl, , wifi_icon, % btnPics["wifi_icon_offline.png"] ? "HBITMAP:*" btnPics["wifi_icon_offline.png"] : ""
}
; Fondo y secciones mover
Gui Font, s24, Bai Jamjuree SemiBold
Gui, Add, Text, x0 y0 w1024 h50 +BackgroundTrans cWhite Center GMoverVentana vMoverVentanaUp, ; Mover Ventana de arriba (3.7.6+ Top Notifications)
Gui, Add, Text, x0 y543 w1024 h59 +BackgroundTrans cWhite Center GMoverVentana vMoverVentanaDown, ; Mover Ventana de abajo (3.7.6+ Bottom Notifications)
Gui Add, Picture, x0 y0 w1024 h600 vbackgroundImg, % btnPics["background.png"] ? "HBITMAP:*" btnPics["background.png"] : ""
EstablecerPagina(0)
Gui, SplashScreen:Destroy
Gui Show, % "w1024 h600 x" conf.x_Inicial "y" conf.y_Inicial, LibreDeck Client ; Do NOT change the name, it's used for notifications amongst other stuff
if(conf.miniClient)
{
conf.miniClient := 0
gosub, CambiarDimensionesCliente
}
gosub, SetSiempreVisibleInicial
OnMessage(0x404, "AHK_ICONCLICKNOTIFY") ; Detectar doble left click en el icono de notificación para mostrar
gosub, setReactiveService
if(conf.lookForUpdates){
lookForUpdates(true)
}
global sender := new talk("Background")
; END AUTOEXECUTE SECTION
Return
; LABELS BOTONES Y FUNCIONES GENERALES
; *******************************
ToggleHide:
if EsVisible
{
WinHide, LibreDeck Client
Menu, tray, Rename, Hide, Show
EsVisible = 0
}
else
{
WinShow, LibreDeck Client
WinActivate, LibreDeck Client
Menu, tray, Rename, Show, Hide
EsVisible = 1
}
Return
GuiContextMenu:
if GetKeyState("Alt")
scriptGen := 1
else
scriptGen := 0
if A_GuiControl In Boton1,Boton2,Boton3,Boton4,Boton5,Boton6,Boton7,Boton8,Boton9,Boton10,Boton11,Boton12,Boton13,Boton14,Boton15
{
StringReplace, BotonAPulsar, A_GuiControl, boton,
if(EnCarpeta){
BotonActivo := CarpetaBoton 15*PaginaCarpeta+BotonAPulsar
if(BotonAPulsar == 15)
return ; Button 15* inside a folder is always a return key (no script attached)
}
else
BotonActivo := 15*NumeroPagina+BotonAPulsar
if (scriptGen)
{
KeyWait, Alt,
Menu scriptGenerator, Show
}
else
{
Menu ContextMenu, Show
}
}
else if(A_GuiControl == "settings_icon")
{
Menu ContextMenuGenerico, Show
}
; Background used to show the action context menu, now there is a top-right button for that (easier for touch mode and for newer users)
;~ else
;~ Menu ContextMenuGenerico, Show
return
GuiEditarScript:
EditarScriptBoton(BotonActivo)
return
GuiCambiarImagenBoton:
EstablecerImagenBoton(BotonActivo)
return
GuiInfoBoton:
MsgBox,,Button ID, Clicked button Id is: %BotonActivo%
return
NotImplemented:
MsgBox, Not implemented
return
ComprobarExistenciaBoton()
{
buttonPath := "" BotonActivo ".ahk"
if FileExist(buttonPath)
{
OnMessage(0x44, "OnMsgBox")
MsgBoxBtn1 = Overwrite
MsgBoxBtn2 = Cancel
MsgBox 0x34, Overwrite?, This button already has a macro file`, do you want to overwrite it?`n`nPrevious function will be lost!
OnMessage(0x44, "")
IfMsgBox Yes, {
return 1
}else{
return 0
}
}
else
{
return 1
}
}
SiempreVisible:
if(conf.siempreVisible)
{
Winset, AlwaysOnTop, Off, LibreDeck Client
conf.siempreVisible := 0
Menu ContextMenuGenerico, UnCheck, Always on Top
}
else
{
Winset, AlwaysOnTop, , LibreDeck Client
conf.siempreVisible := 1
Menu ContextMenuGenerico, Check, Always on Top
}
gosub, guardarConfig
return
SetSiempreVisibleInicial:
if(!conf.siempreVisible)
{
Winset, AlwaysOnTop, Off, LibreDeck Client
Menu ContextMenuGenerico, UnCheck, Always on Top
}
else
{
Winset, AlwaysOnTop, , LibreDeck Client
Menu ContextMenuGenerico, Check, Always on Top
}
return
MoverRatonAlPulsarBotonToggle:
if(conf.moverRatonAlPulsarBoton)
{
conf.moverRatonAlPulsarBoton := 0
Menu ContextMenuGenerico, UnCheck, Center Mouse after Activation
}
else
{
conf.moverRatonAlPulsarBoton := 1
Menu ContextMenuGenerico, Check, Center Mouse after Activation
}
gosub, guardarConfig
return
enviarAltTabAlPulsarBotonToggle:
if(conf.enviarAltTabAlPulsarBoton)
{
conf.enviarAltTabAlPulsarBoton := 0
Menu ContextMenuGenerico, UnCheck, Send Alt+Tab after Activation
}
else
{
conf.enviarAltTabAlPulsarBoton := 1
Menu ContextMenuGenerico, Check, Send Alt+Tab after Activation
}
gosub, guardarConfig
return
cargaProgresivaIconosToggle:
if(conf.cargaProgresivaIconos)
{
conf.cargaProgresivaIconos := 0
Menu ContextMenuGenerico, UnCheck, Progressive Icon Loading
}
else
{
conf.cargaProgresivaIconos := 1
Menu ContextMenuGenerico, Check, Progressive Icon Loading
}
gosub, guardarConfig
return
toggleBuiltInAhk:
if(conf.builtin_ahk)
{
conf.builtin_ahk := 0
Menu ContextMenuGenerico, UnCheck, Use built-in AHK
}
else
{
conf.builtin_ahk := 1
Menu ContextMenuGenerico, Check, Use built-in AHK
}
gosub, guardarConfig
return
CambiarDimensionesCliente:
if(!conf.cargaProgresivaIconos)
DllCall("LockWindowUpdate", "UInt", windowHandler)
if conf.miniClient
{
Menu, ContextMenuGenerico, Rename, Normal Client, Mini Client
conf.miniClient := 0
GuiControl, MoveDraw, Activar1, x120 y40 w150 h150
GuiControl, MoveDraw, Activar2, x280 y40 w150 h150
GuiControl, MoveDraw, Activar3, x440 y40 w150 h150
GuiControl, MoveDraw, Activar4, x600 y40 w150 h150
GuiControl, MoveDraw, Activar5, x760 y40 w150 h150
GuiControl, MoveDraw, Activar6, x120 y220 w150 h150
GuiControl, MoveDraw, Activar7, x280 y220 w150 h150
GuiControl, MoveDraw, Activar8, x440 y220 w150 h150
GuiControl, MoveDraw, Activar9, x600 y220 w150 h150
GuiControl, MoveDraw, Activar10, x760 y220 w150 h150
GuiControl, MoveDraw, Activar11, x120 y400 w150 h150
GuiControl, MoveDraw, Activar12, x280 y400 w150 h150
GuiControl, MoveDraw, Activar13, x440 y400 w150 h150
GuiControl, MoveDraw, Activar14, x600 y400 w150 h150
GuiControl, MoveDraw, Activar15, x760 y400 w150 h150
GuiControl, MoveDraw, LeftPage, x0 y230 w130 h130
GuiControl, MoveDraw, RightPage, x910 y230 w130 h130
Gui Font, s24 cWhite, Bai Jamjuree SemiBold
GuiControl, Font, MoverVentanaUp
GuiControl, Font, MoverVentanaDown
GuiControl, MoveDraw, MoverVentanaUp, x0 y0 w1024 h50
GuiControl, MoveDraw, MoverVentanaDown, x0 y543 w1024 h59
GuiControl, MoveDraw, wifi_icon, x960 y536 w64 h64
GuiControl, MoveDraw, settings_icon, x960 y0 w64 h64
GuiControl, MoveDraw, backgroundImg, x0 y0 w1024 h600
Gui Show, w1024 h600, LibreDeck Client
}
else
{
Menu, ContextMenuGenerico, Rename, Mini Client, Normal Client
conf.miniClient := 1
GuiControl, MoveDraw, Activar1, x54 y14 w59 h59
GuiControl, MoveDraw, Activar2, x110 y14 w59 h59
GuiControl, MoveDraw, Activar3, x166 y14 w59 h59
GuiControl, MoveDraw, Activar4, x222 y14 w59 h59
GuiControl, MoveDraw, Activar5, x278 y14 w59 h59
GuiControl, MoveDraw, Activar6, x54 y70 w59 h59
GuiControl, MoveDraw, Activar7, x110 y70 w59 h59
GuiControl, MoveDraw, Activar8, x166 y70 w59 h59
GuiControl, MoveDraw, Activar9, x222 y70 w59 h59
GuiControl, MoveDraw, Activar10, x278 y70 w59 h59
GuiControl, MoveDraw, Activar11, x54 y126 w59 h59
GuiControl, MoveDraw, Activar12, x110 y126 w59 h59
GuiControl, MoveDraw, Activar13, x166 y126 w59 h59
GuiControl, MoveDraw, Activar14, x222 y126 w59 h59
GuiControl, MoveDraw, Activar15, x278 y126 w59 h59
GuiControl, MoveDraw, LeftPage, x0 y75 w49 h49
GuiControl, MoveDraw, RightPage, x340 y75 w49 h49
Gui Font, s12 cWhite, Bai Jamjuree SemiBold
GuiControl, Font, MoverVentanaUp
GuiControl, Font, MoverVentanaDown
GuiControl, MoveDraw, MoverVentanaUp, x-8 y-5 w413 h23
GuiControl, MoveDraw, MoverVentanaDown, x0 y175 w401 h23
GuiControl, MoveDraw, wifi_icon, x353 y168 w32 h32
GuiControl, MoveDraw, settings_icon, x353 y0 w32 h32
GuiControl, MoveDraw, backgroundImg, x0 y0 w385 h200
Gui, Show, w385 h200, LibreDeck Client
}
gosub, setWifiIcon ; Resets the wifi icon without loosing quality bug on resize
DllCall("LockWindowUpdate", "UInt", 0)
gosub, guardarConfig
; Refrescar Botones para no perder calidad de imagen por bug resize
gosub, refreshButtonsAndPage
Return
refreshButtons:
if(conf.miniClient)
{
RefrescarBotonesMini()
}
else
{
RefrescarBotones()
}
return
refreshPage:
if(EnCarpeta)
{
EstablecerPaginaCarpeta(CarpetaBoton, PaginaCarpeta)
}
else
{
EstaBlecerPagina(NumeroPagina)
}
return
refreshButtonsAndPage:
gosub, refreshButtons
gosub, refreshPage
return
MoverVentana:
PostMessage, 0xA1, 2,,, A
Return
OnButton:
{
RegExMatch(A_GuiControl, "\d+$", idx)
if (idx = "")
return
PulsarBoton(idx)
}
return
PulsarBoton(BotonAPulsar)
{
if(conf.moverRatonAlPulsarBoton)
MouseMove, % conf.pantalla_Mitad_X, % conf.pantalla_Mitad_Y, 0
if(conf.reactiveWindow){
SetTimer, setPageByActiveProgram, 1000
}
AltTab()
; Lógica Botón
if(EnCarpeta)
{
if(BotonAPulsar != 15)
{
IdBoton := CarpetaBoton 15*PaginaCarpeta+BotonAPulsar
if GetKeyState("Control")
{
if GetKeyState("Shift")
{
EstablecerImagenBoton(IdBoton)
return
}
MsgBox,,Button ID, Clicked button Id is: %IdBoton%
return
}
if GetKeyState("Shift")
{
EditarScriptBoton(IdBoton)
return
}
if(conf.online && serverFound)
{
if(conf.folderButtons[idBoton] != "")
{
CarpetaBoton := conf.folderButtons[idBoton]
global PaginaCarpeta := 0
EstablecerPaginaCarpeta(CarpetaBoton, PaginaCarpeta)
return
}
}
else
{
if(conf.folderButtons[idBoton] != "")
{
CarpetaBoton := conf.folderButtons[idBoton]
global PaginaCarpeta := 0
EstablecerPaginaCarpeta(CarpetaBoton, PaginaCarpeta)
return
}
}
EjecutarFuncionBoton(BotonAPulsar, IdBoton)
}
else if (BotonAPulsar = 15)
{
; Este es un caso especial ya que si está en carpeta siempre tiene el valor volver (salir fuera de la carpeta)
IdBoton := CarpetaBoton 15*PaginaCarpeta+BotonAPulsar
EstablecerPagina(NumeroPagina)
EnCarpeta = 0
Menu ContextMenuGenerico, Disable, Bind this folder to a program or window
PaginaCarpeta = 0
return
}
}
else
{
IdBoton := 15*NumeroPagina+BotonAPulsar
if GetKeyState("Control")
{
if GetKeyState("Shift")
{
EstablecerImagenBoton(IdBoton)
return
}
MsgBox,,Button ID, Clicked button Id is: %IdBoton%
return
}
if GetKeyState("Shift")
{
EditarScriptBoton(IdBoton)
return
}
if(conf.online && serverFound)
{
if(conf.folderButtons[idBoton] != "")
{
CarpetaBoton := conf.folderButtons[idBoton]
global PaginaCarpeta := 0
EstablecerPaginaCarpeta(CarpetaBoton, PaginaCarpeta)
return
}
}
else
{
if(conf.folderButtons[idBoton] != "")
{
CarpetaBoton := conf.folderButtons[idBoton]
global PaginaCarpeta := 0
EstablecerPaginaCarpeta(CarpetaBoton, PaginaCarpeta)
return
}
}
EjecutarFuncionBoton(BotonAPulsar, IdBoton)
}
Boton%BotonAPulsar% = 1
}
EstablecerPagina(NumeroPagina)
{
global
EnCarpeta := 0
if(!conf.cargaProgresivaIconos)
DllCall("LockWindowUpdate", "UInt", windowHandler)
CarpetaBoton := ""
RutaBoton1 := CarpetaBoton 15*NumeroPagina+1 ".png"
RutaBoton2 := CarpetaBoton 15*NumeroPagina+2 ".png"
RutaBoton3 := CarpetaBoton 15*NumeroPagina+3 ".png"
RutaBoton4 := CarpetaBoton 15*NumeroPagina+4 ".png"
RutaBoton5 := CarpetaBoton 15*NumeroPagina+5 ".png"
RutaBoton6 := CarpetaBoton 15*NumeroPagina+6 ".png"
RutaBoton7 := CarpetaBoton 15*NumeroPagina+7 ".png"
RutaBoton8 := CarpetaBoton 15*NumeroPagina+8 ".png"
RutaBoton9 := CarpetaBoton 15*NumeroPagina+9 ".png"
RutaBoton10 := CarpetaBoton 15*NumeroPagina+10 ".png"
RutaBoton11 := CarpetaBoton 15*NumeroPagina+11 ".png"
RutaBoton12 := CarpetaBoton 15*NumeroPagina+12 ".png"
RutaBoton13 := CarpetaBoton 15*NumeroPagina+13 ".png"
RutaBoton14 := CarpetaBoton 15*NumeroPagina+14 ".png"
RutaBoton15 := CarpetaBoton 15*NumeroPagina+15 ".png"
if (NumeroPagina == 0)
GuiControl, Hide, LeftPage
else
GuiControl, Show, LeftPage
if(conf.miniClient)
{
RefrescarBotonesMini()
}
else
{
RefrescarBotones()
}
DllCall("LockWindowUpdate", "UInt", 0)
}
EstablecerPaginaCarpeta(CarpetaBoton, PaginaCarpeta)
{
global
EnCarpeta = 1
Menu ContextMenuGenerico, Enable, Bind this folder to a program or window
if(!conf.cargaProgresivaIconos)
DllCall("LockWindowUpdate", "UInt", windowHandler)
RutaBoton1 := CarpetaBoton 15*PaginaCarpeta+1 ".png"
RutaBoton2 := CarpetaBoton 15*PaginaCarpeta+2 ".png"
RutaBoton3 := CarpetaBoton 15*PaginaCarpeta+3 ".png"
RutaBoton4 := CarpetaBoton 15*PaginaCarpeta+4 ".png"
RutaBoton5 := CarpetaBoton 15*PaginaCarpeta+5 ".png"
RutaBoton6 := CarpetaBoton 15*PaginaCarpeta+6 ".png"
RutaBoton7 := CarpetaBoton 15*PaginaCarpeta+7 ".png"
RutaBoton8 := CarpetaBoton 15*PaginaCarpeta+8 ".png"
RutaBoton9 := CarpetaBoton 15*PaginaCarpeta+9 ".png"
RutaBoton10 := CarpetaBoton 15*PaginaCarpeta+10 ".png"
RutaBoton11 := CarpetaBoton 15*PaginaCarpeta+11 ".png"
RutaBoton12 := CarpetaBoton 15*PaginaCarpeta+12 ".png"
RutaBoton13 := CarpetaBoton 15*PaginaCarpeta+13 ".png"
RutaBoton14 := CarpetaBoton 15*PaginaCarpeta+14 ".png"
if (PaginaCarpeta == 0)
GuiControl, Hide, LeftPage
else
GuiControl, Show, LeftPage
if(conf.miniClient)
{
RefrescarBotonesMini(true)
}
else
{
RefrescarBotones(true)
}
DllCall("LockWindowUpdate", "UInt", 0)
}
RefrescarBotones(esCarpeta = false)
{
global
if(!conf.cargaProgresivaIconos)
DllCall("LockWindowUpdate", "UInt", windowHandler)
GuiControl, Text, Boton1, % btnPics[RutaBoton1] ? "HBITMAP:*" btnPics[RutaBoton1] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton1, x130 y50 w130 h130 ; Al cambiarle la ruta hay que resizear el boton
GuiControl, Text, Boton2, % btnPics[RutaBoton2] ? "HBITMAP:*" btnPics[RutaBoton2] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton2, x290 y50 w130 h130
GuiControl, Text, Boton3, % btnPics[RutaBoton3] ? "HBITMAP:*" btnPics[RutaBoton3] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton3, x450 y50 w130 h130
GuiControl, Text, Boton4, % btnPics[RutaBoton4] ? "HBITMAP:*" btnPics[RutaBoton4] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton4, x610 y50 w130 h130
GuiControl, Text, Boton5, % btnPics[RutaBoton5] ? "HBITMAP:*" btnPics[RutaBoton5] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton5, x770 y50 w130 h130
GuiControl, Text, Boton6, % btnPics[RutaBoton6] ? "HBITMAP:*" btnPics[RutaBoton6] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton6, x130 w130 y230 h130
GuiControl, Text, Boton7, % btnPics[RutaBoton7] ? "HBITMAP:*" btnPics[RutaBoton7] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton7, x290 w130 y230 h130
GuiControl, Text, Boton8, % btnPics[RutaBoton8] ? "HBITMAP:*" btnPics[RutaBoton8] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton8, x450 w130 y230 h130
GuiControl, Text, Boton9, % btnPics[RutaBoton9] ? "HBITMAP:*" btnPics[RutaBoton9] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton9, x610 w130 y230 h130
GuiControl, Text, Boton10, % btnPics[RutaBoton10] ? "HBITMAP:*" btnPics[RutaBoton10] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton10, x770 y230 w130 h130
GuiControl, Text, Boton11, % btnPics[RutaBoton11] ? "HBITMAP:*" btnPics[RutaBoton11] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton11, x130 x130 y410 w130 h130
GuiControl, Text, Boton12, % btnPics[RutaBoton12] ? "HBITMAP:*" btnPics[RutaBoton12] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton12, x290 y410 w130 h130
GuiControl, Text, Boton13, % btnPics[RutaBoton13] ? "HBITMAP:*" btnPics[RutaBoton13] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton13, x450 y410 w130 h130
GuiControl, Text, Boton14, % btnPics[RutaBoton14] ? "HBITMAP:*" btnPics[RutaBoton14] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton14, x610 y410 w130 h130
if(esCarpeta)
{
GuiControl, Text, Boton15, % btnPics["Volver.png"] ? "HBITMAP:*" btnPics["Volver.png"] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton15, x770 y410 w130 h130
}
else
{
GuiControl, Text, Boton15, % btnPics[RutaBoton15] ? "HBITMAP:*" btnPics[RutaBoton15] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton15, x770 y410 w130 h130
}
DllCall("LockWindowUpdate", "UInt", 0)
}
RefrescarBotonesMini(esCarpeta = false)
{
global
if(!conf.cargaProgresivaIconos)
DllCall("LockWindowUpdate", "UInt", windowHandler)
GuiControl, Text, Boton1, % btnPics[RutaBoton1] ? "HBITMAP:*" btnPics[RutaBoton1] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton1, x59 y19 w49 h49
GuiControl, Text, Boton2, % btnPics[RutaBoton2] ? "HBITMAP:*" btnPics[RutaBoton2] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton2, x115 y19 w49 h49
GuiControl, Text, Boton3, % btnPics[RutaBoton3] ? "HBITMAP:*" btnPics[RutaBoton3] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton3, x171 y19 w49 h49
GuiControl, Text, Boton4, % btnPics[RutaBoton4] ? "HBITMAP:*" btnPics[RutaBoton4] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton4, x227 y19 w49 h49
GuiControl, Text, Boton5, % btnPics[RutaBoton5] ? "HBITMAP:*" btnPics[RutaBoton5] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton5, x283 y19 w49 h49
GuiControl, Text, Boton6, % btnPics[RutaBoton6] ? "HBITMAP:*" btnPics[RutaBoton6] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton6, x59 y75 w49 h49
GuiControl, Text, Boton7, % btnPics[RutaBoton7] ? "HBITMAP:*" btnPics[RutaBoton7] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton7, x115 y75 w49 h49
GuiControl, Text, Boton8, % btnPics[RutaBoton8] ? "HBITMAP:*" btnPics[RutaBoton8] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton8, x171 y75 w49 h49
GuiControl, Text, Boton9, % btnPics[RutaBoton9] ? "HBITMAP:*" btnPics[RutaBoton9] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton9, x227 y75 w49 h49
GuiControl, Text, Boton10, % btnPics[RutaBoton10] ? "HBITMAP:*" btnPics[RutaBoton10] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton10, x283 y75 w49 h49
GuiControl, Text, Boton11, % btnPics[RutaBoton11] ? "HBITMAP:*" btnPics[RutaBoton11] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton11, x59 y131 w49 h49
GuiControl, Text, Boton12, % btnPics[RutaBoton12] ? "HBITMAP:*" btnPics[RutaBoton12] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton12, x115 y131 w49 h49
GuiControl, Text, Boton13, % btnPics[RutaBoton13] ? "HBITMAP:*" btnPics[RutaBoton13] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton13, x171 y131 w49 h49
GuiControl, Text, Boton14, % btnPics[RutaBoton14] ? "HBITMAP:*" btnPics[RutaBoton14] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton14, x227 y131 w49 h49
if(esCarpeta)
{
GuiControl, Text, Boton15, % btnPics["Volver.png"] ? "HBITMAP:*" btnPics["Volver.png"] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton15, x283 y131 w49 h49
}
else
{
GuiControl, Text, Boton15, % btnPics[RutaBoton15] ? "HBITMAP:*" btnPics[RutaBoton15] : "HBITMAP:*" btnPics["button_placeholder.png"]
GuiControl, MoveDraw, Boton15, x283 y131 w49 h49
}
DllCall("LockWindowUpdate", "UInt", 0)
}
LeftPage:
if(conf.moverRatonAlPulsarBoton)
MouseMove, % conf.pantalla_Mitad_X, % conf.pantalla_Mitad_Y, 0
AltTab()
if(EnCarpeta)
{
if(PaginaCarpeta != 0)
{
if GetKeyState("Control")
{
if(PaginaCarpeta >= 10)
{
PaginaCarpeta := PaginaCarpeta - 10
EstablecerPaginaCarpeta(CarpetaBoton, PaginaCarpeta)
}
return
}
PaginaCarpeta--
EstablecerPaginaCarpeta(CarpetaBoton, PaginaCarpeta)
}
}
else
{
if(NumeroPagina != 0)
{
if GetKeyState("Control")
{
if(NumeroPagina >= 10)
{
NumeroPagina := NumeroPagina - 10
EstablecerPagina(NumeroPagina)
}
}
else
{
NumeroPagina--
EstablecerPagina(NumeroPagina)
}
}
}
return
RightPage:
if(conf.moverRatonAlPulsarBoton)
MouseMove, % conf.pantalla_Mitad_X, % conf.pantalla_Mitad_Y, 0
AltTab()
if(EnCarpeta)
{
if GetKeyState("Control")
{
PaginaCarpeta := PaginaCarpeta + 10
EstablecerPaginaCarpeta(CarpetaBoton, PaginaCarpeta)
return
}
PaginaCarpeta++
EstablecerPaginaCarpeta(CarpetaBoton, PaginaCarpeta)
}
else
{
if GetKeyState("Control")
{
NumeroPagina := NumeroPagina + 10
}
else
{
NumeroPagina++
}
EstablecerPagina(NumeroPagina)
}
return
EstablecerImagenBoton(IdBoton)
{
global btnPics
OnMessage(0x44, "OnMsgBox")
MsgBoxBtn1 = Change Img
MsgBoxBtn2 = Remove
MsgBoxBtn3 = Cancel
MsgBox 0x23, Change - Delete, Change Image or Remove Button?