Cool work Begges. Magic Nodes are really great, but sometimes I wish it would be more dynamic. So I find your script really useful.
Are you still working on this approach?
Here are my suggestions and modifications to your script:
- Hotkey for FastNode
Code: Select all
FastNodeName = SDB.IniFile.StringValue("FastNode_GUI", "NodeName")
FastNodeHotkey = SDB.IniFile.StringValue("FastNode_GUI", "NodeHotkey") ' added Hotkey feature
DDsUsed = SDB.IniFile.StringValue("FastNode_GUI", "DDsUsed")
and
Code: Select all
GetString = FastNodeName
' Insert MagicNode Shortcut
If FastNodeHotkey = "" then
Else
GetString = GetString & "|Shortcut:" & FastNodeHotkey
End If
ReDim DDIndex(DDsUsed)
'Get all DropDown-Values
- use of dedicated <empty>-tags for unused fields
Code: Select all
'And sort out double entries (this makes no sense, or):
DCounter = 0
For j = 0 To i
If DDIndex(i) = DDIndex(j) Then
DCounter = DCounter + 1
Else
If Lcase(tags(DDIndex(i),2)) = "<empty>" Then DCounter = DCounter + 1
End If
Next
If DCounter <= 1 And DDIndex(i) >= 0 Then
GetString = GetString & "\" & Tags(DDIndex(i), 2)
End If
Next
Set ParentForm = Nothing
Set Index = Nothing
End Function
- changed option sheet according to new shortcutfield
Code: Select all
'Set the layout of the options panel
Sub InitGUIOptions(sheet)
Dim Label
Dim CB
Dim i
Dim EDName, EDCode
Set Label = SDB.UI.NewLabel(sheet)
Label.Common.SetRect 10, 10, 80, 20
Label.caption = "Configure available Fields (needs Restart to take effect):"
Label.AutoSize = True
Label.Alignment = 0
Set Label = Nothing
Set Label = SDB.UI.NewLabel(sheet)
Label.Common.SetRect 40, 25, 80, 20
Label.caption = "Active"
Label.AutoSize = True
Label.Alignment = 0
Set Label = Nothing
Set Label = SDB.UI.NewLabel(sheet)
Label.Common.SetRect 80, 25, 80, 20
Label.caption = "Name"
Label.AutoSize = True
Label.Alignment = 0
Set Label = Nothing
Set Label = SDB.UI.NewLabel(sheet)
Label.Common.SetRect 170, 25, 80, 20
Label.caption = "Code"
Label.AutoSize = True
Label.Alignment = 0
Set Label = Nothing
For i = 1 To 10
Set Label = SDB.UI.NewLabel(sheet)
Label.Common.SetRect 20, 15 + i * 25 + 2, 80, 20
Label.caption = i
Label.AutoSize = True
Label.Alignment = 1
Set Label = Nothing
Set CB = SDB.UI.NewCheckbox(sheet)
CB.Common.SetRect 50, 15 + i * 25, 80, 20
CB.Common.ControlName = "CB" & i
CB.caption = ""
If SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Active") <> "" Then
CB.Checked = SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Active")
Else
CB.Checked = False
End If
Set CB = Nothing
Set EDName = SDB.UI.NewEdit(sheet)
EDName.Common.SetRect 80, 15 + i * 25, 80, 20
EDName.Common.ControlName = "EDName" & i
If SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Name") <> "" Then
EDName.text = SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Name")
Else
EDName.text = "Name"
End If
Set EDName = Nothing
Set EDCode = SDB.UI.NewEdit(sheet)
EDCode.Common.SetRect 170, 15 + i * 25, 280, 20
EDCode.Common.ControlName = "EDCode" & i
If SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Code") <> "" Then
EDCode.text = SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Code")
Else
EDCode.text = "<artist>"
End If
Set EDCode = Nothing
Next
Set Label = SDB.UI.NewLabel(sheet)
Label.Common.SetRect 20, 295, 60, 20
Label.caption = "NodeName"
Label.AutoSize = True
Label.Alignment = 0
Set Label = Nothing
Set EDName = SDB.UI.NewEdit(sheet)
EDName.Common.SetRect 80, 292, 80, 20
EDName.Common.ControlName = "NodeName"
If SDB.IniFile.StringValue("FastNode_GUI", "NodeName") <> "" Then
EDName.text = SDB.IniFile.StringValue("FastNode_GUI", "NodeName")
Else
EDName.text = "FastNode"
End If
Set EDName = Nothing
' Hotkey Field
Set Label = SDB.UI.NewLabel(sheet)
Label.Common.SetRect 170, 295, 60, 20
Label.caption = "FastNode Hotkey"
Label.AutoSize = True
Label.Alignment = 0
Set Label = Nothing
Set EDName = SDB.UI.NewEdit(sheet)
EDName.Common.SetRect 260, 292, 80, 20
EDName.Common.ControlName = "NodeHotKey"
If SDB.IniFile.StringValue("FastNode_GUI", "NodeHotkey") <> "" Then
EDName.text = SDB.IniFile.StringValue("FastNode_GUI", "NodeHotkey")
Else
EDName.text = "Strg+F12"
End If
Set EDName = Nothing
' Number of DropDowns
Set Label = SDB.UI.NewLabel(sheet)
Label.Common.SetRect 350, 295, 60, 20
Label.caption = "DropDowns"
Label.AutoSize = True
Label.Alignment = 0
Set Label = Nothing
Set EDName = SDB.UI.NewSpinEdit(sheet)
EDName.Common.SetRect 410, 292, 40, 20
EDName.Common.ControlName = "DDsUsed"
EDName.minvalue = 1
EDName.maxvalue = 10
If SDB.IniFile.StringValue("FastNode_GUI", "DDsUsed") <> "" Then
EDName.value = SDB.IniFile.StringValue("FastNode_GUI", "DDsUsed")
Else
EDName.value = 3
End If
Set EDName = Nothing
End Sub
Sub SaveGUIOptions(sheet)
Dim i
For i = 1 To 10
SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Active") = sheet.Common.Childcontrol("CB" & i).Checked
Next
For i = 1 To 10
SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Name") = sheet.Common.Childcontrol("EDName" & i).text
Next
For i = 1 To 10
SDB.IniFile.StringValue("FastNode_GUI", "Code" & i & "_Code") = sheet.Common.Childcontrol("EDCode" & i).text
Next
SDB.IniFile.StringValue("FastNode_GUI", "NodeName") = sheet.Common.Childcontrol("NodeName").text
SDB.IniFile.StringValue("FastNode_GUI", "NodeHotkey") = sheet.Common.Childcontrol("NodeHotkey").text
SDB.IniFile.StringValue("FastNode_GUI", "DDsUsed") = sheet.Common.Childcontrol("DDsUSed").value
End Sub
What do you think about adding modifier support for the node?
In my case it is possible to add modifiers by appending modifiers to the shortcut, but this isn't the way I think it should be done.
Or what about a complete gui for adding, editing or deleting of
all Magic Nodes?[/code]