Code: Select all
;================================================================================
; nwn_dlgm
; Author: Tobias Wirth ([email protected])
;================================================================================
; v0.0.0.1
;================================================================================
VERSION := "0.0.0.1"
;================================================================================
#NoTrayIcon
#NoEnv ; For performance and combatibility with newer AHK versions
#SingleInstance force
;================================================================================
; Persistent Variables
;================================================================================
EXE := A_WorkingDir . "\nwn_dlgm.exe"
NAME := "Neverwinter Dialog Edtior"
PICS := A_WorkingDir . "\src\"
;================================================================================
; Main Scripts
;================================================================================
Main: ; <<<=== Main begins
{
Gui, 1: Add, GroupBox, x41 y1 w373 h32, ; Main Symbols
{
Gui, 1: Add, Pic, x47 y9 w20 h20, %PICS%01.png
Gui, 1: Add, Pic, x+10 y9 gOpen w20 h20, %PICS%02.png
Gui, 1: Add, Pic, x+10 y9 w20 h20, %PICS%03.png
Gui, 1: Add, Pic, x+10 y9 w20 h20, %PICS%04.png
Gui, 1: Add, Pic, x+10 y9 w20 h20, %PICS%05.png
Gui, 1: Add, Pic, x+10 y9 w20 h20, %PICS%06.png
Gui, 1: Add, Pic, x+10 y9 w20 h20, %PICS%07.png
Gui, 1: Add, Pic, x+10 y9 w20 h20, %PICS%08.png
Gui, 1: Add, Pic, x+10 y9 w20 h20, %PICS%09.png
Gui, 1: Add, Pic, x+10 y9 w20 h20, %PICS%10.png
Gui, 1: Add, Pic, x+10 y9 w20 h20, %PICS%11.png
Gui, 1: Add, Pic, x+10 y9 w20 h20, %PICS%12.png
}
Gui, 1: Add, GroupBox, x1 y33 w32 h323, ; Tools section
{
Gui, 1: Add, Pic, x6 y43 w20 h20, %PICS%13.png
Gui, 1: Add, Pic, x6 y+10 w20 h20, %PICS%14.png
Gui, 1: Add, Pic, x6 y+10 w20 h20, %PICS%15.png
Gui, 1: Add, Pic, x6 y+10 w20 h20, %PICS%16.png
Gui, 1: Add, Pic, x6 y+10 w20 h20, %PICS%17.png
Gui, 1: Add, Pic, x6 y+10 w20 h20, %PICS%18.png
Gui, 1: Add, Pic, x6 y+10 w20 h20, %PICS%19.png
Gui, 1: Add, Pic, x6 y+10 w20 h20, %PICS%20.png
Gui, 1: Add, Pic, x6 y+10 w20 h20, %PICS%21.png
Gui, 1: Add, Pic, x6 y+10 w20 h20, %PICS%22.png
}
Gui, 1: Add, GroupBox, x6 y440 w1192 h25, ; Art of a statusBar?
{
Gui, 1: Add, Text, x9 y448, 23
}
Gui, 1: Add, Tab3, x40 y40 w1160 h400 vTab3Basis hwndTab3BasisHWND, Ablage|| ; Clipboard style
{
ImageListID := IL_Create(3)
LV_SetImageList(ImageListID)
IL_Add(ImageListID, PICS "24.png", 1)
IL_Add(ImageListID, PICS "25.png", 2)
IL_Add(ImageListID, PICS "26.png", 3)
Gui, 1: Tab, Ablage, , Exact ; Das gleiche wie oben, aber mit exakter uebereinstimmung (mit Gross/Klein-Unterscheidung).
{
Gui, 1: Add, TreeView, ImageList%ImageListID% w1138 h355 vAblage
{
P1 := TV_Add("Stammverzeichnis")
P1C1 := TV_Add("1. Unterelement von Oberelement", P1) ; Geben Sie P1 an, um dieses Element P1 unterzuordnen.
P1C1C1 := TV_Add("1. Unterelement von Unterelement 1", P1C1)
P1C2 := TV_Add("2. Unterelement von Oberelement", P1)
P1C2C1 := TV_Add("1. Unterelement von Unterelement 2", P1C2)
P1C2C2 := TV_Add("2. Unterelement von Unterelement 2 ", P1C2)
P1C2C1C1 := TV_Add("1. Unterelement von Unterelement 3", P1C2C2)
}
}
}
GuiControl, +v%Tab3BasisHWND%, ahk_id %Tab3BasisHWND%
Gui, 1: Add, Tab3, x6 y470 w750 h200, Daten|Lesezeichen|Suchen ; Details for dialogues
{
Gui, 1: Tab, Daten, , Exact
{
Gui, 1: Add, Text, x21 y501 h21 , Sprecher-Kennzeichung
Gui, 1: Add, DDL, x21 y522 w100 vSprKennz, Schwarz|Weiss|Rot|Gruen|Blau
Gui, 1: Add, Button, x126 y522 h21 w80 , Hinzufuegen
Gui, 1: Add, Button, x706 y551 h21 w21 , [A]
Gui, 1: Add, Button, x726 y551 h21 w21 , ...
Gui, 1: Add, Text, x21 y551 h21 , Text
Gui, 1: Add, Edit, x21 y572 r6 w725 vSpechTxt,
}
Gui, 1: Tab, Lesezeichen, , Exact
{
Gui, 1: Add, ListBox, x21 y501 r12 w725 vLesez, Rot|Gruen|Blau|Schwarz|Weiss
}
Gui, 1: Tab, Suchen, , Exact
{
Gui, 1: Add, ListBox, x21 y501 r12 w725 vSuchen, Gruen|Weiss|Rot|Schwarz|Blau
}
}
; Following the options of dialogues
Gui, 1: Add, Tab3, x756 y470 w444 h200, Text erscheint wenn...|Erfolgte Aktionen|Andere Aktionen|Kommentare|Aktuelle Datei
{
Gui, 1: Tab, Text erscheint wenn..., , Exact
{
Gui, 1: Add, Text, x770 y512 h21 , Skript
Gui, 1: Add, DDL, x770 y528 w100 vSkriptTEW, Schwarz|Weiss|Rot|Gruen|Blau
Gui, 1: Add, Button, x871 y528 h21 w21 , ...
Gui, 1: Add, Button, x892 y528 h21 w40 , Bearb.
Gui, 1: Add, Pic, x933 y528 h20 w20 , %PICS%23.png
Gui, 1: Add, Text, x770 y556 , Skriptvorschau
Gui, 1: Add, Edit, x770 y572 h86 w415 vSkriptV1,
}
Gui, 1: Tab, Erfolgte Aktionen, , Exact
{
Gui, 1: Add, Text, x770 y512 h21 , Skript
Gui, 1: Add, DDL, x770 y528 w100 vSkriptEFA, Schwarz|Weiss|Rot|Gruen|Blau
Gui, 1: Add, Button, x871 y528 h21 w21 , ...
Gui, 1: Add, Button, x892 y528 h21 w40 , Bearb.
Gui, 1: Add, Pic, x933 y528 h20 w20 , %PICS%23.png
Gui, 1: Add, Text, x770 y556 , Skriptvorschau
Gui, 1: Add, Edit, x770 y572 h86 w415 vSkriptV2,
}
Gui, 1: Tab, Andere Aktionen, , Exact
{
Gui, 1: Add, Text, x770 y512 h21 , Animationen abspielen
Gui, 1: Add, DDL, x770 y528 w175 vAnim, Schwarz|Weiss|Rot|Gruen|Blau
Gui, 1: Add, Text, x970 y512 h21 , Tagebuch
Gui, 1: Add, DDL, x970 y528 w175 vTagebuch1, Schwarz|Weiss|Rot|Gruen|Blau
Gui, 1: Add, Button, x1150 y528 h21 w40 , Bearb.
Gui, 1: Add, DDL, x970 y552 w175 vTagebuch2, Schwarz|Weiss|Rot|Gruen|Blau
Gui, 1: Add, Text, x770 y573 h21 , Klang abspielen
Gui, 1: Add, DDL, x770 y594 w130 vKlangAbsp, Schwarz|Weiss|Rot|Gruen|Blau
Gui, 1: Add, Button, x906 y594 h21 w40 , Absp.
}
Gui, 1: Tab, Kommentare, , Exact
{
Gui, 1: Add, Edit, x770 y522 r10 w415 vKommentar,
}
Gui, 1: Tab, Aktuelle Datei, , Exact
{
Gui, 1: Add, Checkbox, x770 y512 h21 vNoKameraZoom, Kamera-Zoom stoppen
Gui, 1: Add, Text, x770 y538 h21 , Normal
Gui, 1: Add, Text, x996 y538 h21 , Abgebrochen
Gui, 1: Add, DDL, x770 y552 w100 vNormal, Schwarz|Weiss|Rot|Gruen|Blau
Gui, 1: Add, Button, x870 y552 h21 w21 , ...
Gui, 1: Add, Button, x891 y552 h21 w40 , Bearb.
Gui, 1: Add, DDL, x996 y552 vAbgebr, Schwarz|Weiss|Rot|Gruen|Blau
Gui, 1: Add, Button, x1117 y552 h21 w21 , ...
Gui, 1: Add, Button, x1138 y552 h21 w40 , Bearb.
Gui, 1: Add, Text, x770 y577 , Skriptvorschau
Gui, 1: Add, Edit, x770 y592 h66 w415 vSkriptV3,
}
}
Gui, 1: Tab ; Everything beneath is creaded outside the tabs
Gui, 1: Add, Button, x1097 y673 w100 h21 gGuiClose, Fertig
Gui, 1: Show, Center Autosize, %NAME%
}
Return ; <<<=== Main ending
Open: ; <<<=== Open beginning
{
Gui, 1: Submit, NoHide ; Submit data from Gui
FileSelectFile, FileToOpen, 3, , Waehle Dialog-Datei, NWN1-Dialog (*.dlg) ; File selctions dialogue
SplitPath, FileToOpen, , , , File ; Strip out Filename
If !FileToOpen ; No file was selected
Return ; Stop
If InStr(Tab3Basis, File) ; File already exist
Return ; Stop
Run, %ComSpec% /c %A_WorkingDir%\nwn_gff.exe -i %FileToOpen% -o %FileToOpen%.json -p ; Extract data from file
GuiControl,, %Tab3BasisHWND%, %File%|| ; Add the new tab with file Name
SendMessage, 0x1304,,,, ahk_id %Tab3BasisHWND% ; 0x1304 is TCM_GETITEMCOUNT.
AktTab := ErrorLevel ; How many tabs exist
DialogConvertedToJson := FileToOpen ".json" ; File that data should later be insered
;Loop, Read, %DialogConvertedToJson%
; MsgBox, % A_LoopReadLine
Gui, 1: Tab, %AktTab% ; From here it stops working...?
{
Gui, 1: Add, Button, , Test ; Even adding a simple button doesn't work?
Gui, 1: Add, TreeView, ImageList%ImageListID% w1138 h355 v%File% ; Add data from json-file to treeview
{
P%AktTab% := TV_Add("Stammverzeichnis")
P%AktTab%C1 := TV_Add("1. Unterelement von Oberelement", P%AktTab%)
P%AktTab%C1C1 := TV_Add("1. Unterelement von Unterelement 1", P%AktTab%C1)
P%AktTab%C2 := TV_Add("2. Unterelement von Oberelement", P%AktTab%)
P%AktTab%C2C1 := TV_Add("1. Unterelement von Unterelement 2", P%AktTab%C2)
P%AktTab%C2C2 := TV_Add("2. Unterelement von Unterelement 2 ", P%AktTab%C2)
P%AktTab%C2C1C1 := TV_Add("1. Unterelement von Unterelement 3", P%AktTab%C2C2)
}
}
Gui, 1: Tab
}
Return
;GuiSize: ; Vergroessert/Verkleinert die ListView und TreeView, wenn der Benutzer das Fenster skaliert.
; if (A_EventInfo = 1) ; Das Fenster wurde minimiert. Keine Aktion notwendig.
; Return
; ; Ansonsten wurde die Groesse des Fensters geaendert oder maximiert. Die Groesse des Steuerelements anpassen.
; GuiControl, Move, MeineTreeView, % "H" . (A_GuiHeight - 30) ; -30 fuer Statusleiste und Abstaende.
; GuiControl, Move, MeineListView, % "H" . (A_GuiHeight - 30) . " W" . (A_GuiWidth - TreeViewBreite - 30)
;Return
;================================================================================
; Ending and closing the GUI's
;================================================================================
2GuiClose:
2GuiEscape:
Gui, 2: Submit, NoHide
Gui, 2: Destroy
Return
; Ends app and destroys program
GuiClose:
ExitApp