Update of /cvsroot/netrek/client/netrekxp/configuration-program
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32581
Modified Files:
Form1.frm Form3.frm netrekconfigxp2006.vbp
netrekconfigxp2006.vbw
Removed Files:
netrekrc.cfg
Log Message:
Removed the append method used previously with find/replace so there is only one instance of each config option. Fixed bug found with the showHints option. Fixed bug found with showMySpeed option. Fixed bug with det own torps keymapping.
Index: Form3.frm
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/configuration-program/Form3.frm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Form3.frm 16 May 2007 01:11:09 -0000 1.3
+++ Form3.frm 17 Jul 2007 00:08:37 -0000 1.4
@@ -1488,9 +1488,15 @@
' Removed the repeated append functionality and replaced it with an imported rc file with default setting.
' Options available in the config utility are added at the bottom of the file. These options are excluded from the
' imported file and appended only once to the bottom of the imported rc file. Options are now only specified one time.
-' If a netrekrc file already exists it is save in the netrek root install folder as netrek.sav.
-' In order for the program to function there will need to be a file named netrekrc in the root of where it is executed
+' If a netrekrc.txt file already exists it is save in the netrek root install folder as netrek.sav.
+' In order for the program to function there will need to be a file named netrekrc.txt in the root of where it is executed
' and a file named netrekrc.cfg in the docs folder. Fixed several bugs that have been reported.
+'
+' Program notes from Joe - 7/16/07
+' Finally able to add find/replace functionality and get rid of the old method of appending data to the end of the rc file.
+' Fixed a bug in the detown keymapping.
+' Fixed bug with showMySpeed option
+
'swaps the classic mode/xp mode images when the checkbox value changes
@@ -1505,15 +1511,11 @@
End If
End Sub
-
-
-
Private Sub Command1_Click()
-'Saves your current netrekrc to netrekrc.sav and copies a static netrek config file from the docs directory
-
- FileCopy ".\netrekrc", ".\netrekrc.sav"
- FileCopy ".\docs\netrekrc.cfg", ".\netrekrc"
+'Saves your current netrekrc.txt to netrekrc.sav
+ FileCopy ".\netrekrc.txt", ".\netrekrc.sav"
+
Dim warp As Integer
@@ -1686,7 +1688,7 @@
tiptxt = "showHints: on"
End If
- If tips = 0 Then
+ If tips <> 1 Then
tiptxt = "showHints: off"
End If
@@ -1726,7 +1728,7 @@
speedtxt = "showMySpeed: on"
End If
- If tips <> 1 Then
+ If speed <> 1 Then
speedtxt = "showMySpeed: off"
End If
@@ -1915,7 +1917,6 @@
keymap25 = Text1(24) + tractoroff
End If
-
If planetlist = Text1(25) Then
keymap26 = ""
Else
@@ -1968,9 +1969,9 @@
MsgBox "The key '" + Text1(a) + "' is defined more than once. This will cause problems while playing. Please remove the duplicate controls and click on Finish."
Exit For
End If
- Next a
-
-
+
+ Next a
+
For c = 0 To 30
If Text1(c) = "h" Then
speckey = 1
@@ -1993,8 +1994,6 @@
If duplicate = 0 And speckey = 0 And blank = 0 Then
- ' Open the file for append.
- Open ".\netrekrc" For Append As fnum2
' Add the command.
If Combo1 = "Torpedoes" And Combo2 = "Phasers" Then
@@ -2032,83 +2031,73 @@
keymap = "keymap:" + keymap1 + keymap2 + keymap3 + keymap4 + keymap5 + keymap6 + keymap7 + keymap8 + keymap9 + keymap10 + keymap11 + keymap12 + keymap13 + keymap14 + keymap15 + keymap16 + keymap17 + keymap18 + keymap19 + keymap20 + keymap21 + keymap22 + keymap23 + keymap24 + keymap25 + keymap26 + keymap27 + keymap28 + keymap29 + keymap30 + keymap31
keytag1 = "###Configuration below was added on - " + currentdate
- Print #fnum2, Chr(13)
- Print #fnum2, Chr(13)
- Print #fnum2, keytag1
- Print #fnum2, Chr(13)
- Print #fnum2, "# Key mapping"
- Print #fnum2, "# Define you keymap here. The format is newkey defaultkey. For example, the"
- Print #fnum2, "# default key for shield toggle is 's', if you want to remap shield toggle to"
- Print #fnum2, "# 'q', you would put 'qs' in your keymap. Shields would still be mapped to"
- Print #fnum2, "# 's' as well as now being on 'q'. Adding a mapping doesn't delete the old"
- Print #fnum2, "# one. If you want shields on 'w' as well, put 'ws' in your keymap. If you"
- Print #fnum2, "# had instead put 'wq', it would have mapped quit, the default action of 'q',"
- Print #fnum2, "# onto 'w'."
- Print #fnum2, keymap
- Print #fnum2, Chr(13)
- Print #fnum2, "# Mouse button mapping"
- Print #fnum2, "# Button map lets you map the mouse buttons. Unfortunately, it works in a"
- Print #fnum2, "# different way than keymap. The format is <mousebutton> <key>. To map"
- Print #fnum2, "# shields onto button 1 (the left one), you would put '1s' in your keymap."
- Print #fnum2, "# The buttonmap works through the keymap, so if you have shields mapped to"
- Print #fnum2, "# 'q', putting '1q' would make button 1 shields and not quit. Buttons 4 and"
- Print #fnum2, "# 5 are support for Microsoft Xbuttons. If you have a wheel mouse, the up"
- Print #fnum2, "# wheel is button 6 and the down wheel is button 7. There is also support"
- Print #fnum2, "# for shifted, controled, and control-shifted mouse actions, see the netrek"
- Print #fnum2, "# help file for more details."
- Print #fnum2, buttonmap
- Print #fnum2, Chr(13)
- Print #fnum2, "# Show hints window"
- Print #fnum2, tiptxt
- Print #fnum2, Chr(13)
- Print #fnum2, "# What type of ship bitmaps to use"
- Print #fnum2, "# 0 - mono"
- Print #fnum2, "# 1 - new color bitmaps (default)"
- Print #fnum2, "# 2 - old color bitmaps"
- Print #fnum2, "# 3 - shaded old color bitmaps"
- Print #fnum2, "# 4 - experimental high res bitmaps"
- Print #fnum2, mode1
- Print #fnum2, Chr(13)
- Print #fnum2, "# Use colored bitmaps for torps and plasmas"
- Print #fnum2, mode2
- Print #fnum2, Chr(13)
- Print #fnum2, "# Type of planet bitmaps on local map"
- Print #fnum2, "# 0 - Bronco (default)"
- Print #fnum2, "# 1 - Moo"
- Print #fnum2, "# 2 - Rabbitear"
- Print #fnum2, "# 3 - New color"
- Print #fnum2, mode4
- Print #fnum2, Chr(13)
- Print #fnum2, "# Type of planet bitmaps on galactic map"
- Print #fnum2, "# 0 - Bronco (default)"
- Print #fnum2, "# 1 - Moo"
- Print #fnum2, "# 2 - Rabbitear"
- Print #fnum2, "# 3 - New color"
- Print #fnum2, mode5
- Print #fnum2, Chr(13)
-
- Print #fnum2, "# Highlight galactic planets by race and army status"
- Print #fnum2, mode6
- Print #fnum2, "# Use beeplite"
- Print #fnum2, mode10
+ ' Open files for find/replace.
+ fnum2 = FreeFile
+ Open ".\netrekrc.sav" For Input As fnum2
-
- Print #fnum2, Chr(13)
- Print #fnum2, "# Enable layered, stereo sound"
- Print #fnum2, soundtxt
- Print #fnum2, Chr(13)
- Print #fnum2, "# Draw background stars"
- Print #fnum2, starstxt
- Print #fnum2, Chr(13)
- Print #fnum2, "# Draw warp streaks while transwarping to starbase"
- Print #fnum2, warptxt
- Print #fnum2, Chr(13)
- Print #fnum2, "# Show det circle around your ship"
- Print #fnum2, dettxt
- Print #fnum2, Chr(13)
- Print #fnum2, "# Show my speed on local"
- Print #fnum2, speedtxt
+ fnum4 = FreeFile
+ Open ".\netrekrc.txt" For Output As fnum4
+
+ While Not EOF(fnum2)
+ Line Input #fnum2, text_line
+ If text_line Like "keymap:*" Then
+ text_line = keymap
+ End If
+ If text_line Like "buttonmap:*" Then
+ text_line = buttonmap
+ End If
+ If text_line Like "sound:*" Then
+ text_line = soundtxt
+ End If
+
+ If text_line Like "warpStreaks:*" Then
+ text_line = warptxt
+ End If
+
+ If text_line Like "showMySpeed:*" Then
+ text_line = speedtxt
+ End If
+
+ If text_line Like "showStars:*" Then
+ text_line = starstxt
+ End If
+
+ If text_line Like "showHints:*" Then
+ text_line = tiptxt
+ End If
+
+ If text_line Like "detCircle:*" Then
+ text_line = dettxt
+ End If
+
+ If text_line Like "colorClient:*" Then
+ text_line = mode1
+ End If
+
+ If text_line Like "colorWeapons:*" Then
+ text_line = mode2
+ End If
+
+ If text_line Like "planetBitmap:*" Then
+ text_line = mode4
+ End If
+
+ If text_line Like "planetBitmapGalaxy:*" Then
+ text_line = mode5
+ End If
+
+ If text_line Like "planetHighlighting:*" Then
+ text_line = mode6
+ End If
+
+ If text_line Like "useLite:*" Then
+ text_line = mode10
+ End If
+
+ Print #fnum4, text_line
+ Wend
Close fnum2
+ Close fnum4
' Opens the controls you chose in notepad for reference
Open ".\controls.txt" For Output As #fnum3
@@ -2202,3 +2191,4 @@
End If
End Sub
+
Index: netrekconfigxp2006.vbw
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/configuration-program/netrekconfigxp2006.vbw,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- netrekconfigxp2006.vbw 16 May 2007 01:12:21 -0000 1.1
+++ netrekconfigxp2006.vbw 17 Jul 2007 00:08:37 -0000 1.2
@@ -1,2 +1,2 @@
Form3 = 52, 110, 847, 630, , -62, -9, 651, 494, C
-Form1 = 254, 308, 947, 952, , 44, 44, 805, 688, C
+Form1 = 254, 308, 947, 952, Z, 44, 44, 805, 688, C
Index: netrekconfigxp2006.vbp
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/configuration-program/netrekconfigxp2006.vbp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- netrekconfigxp2006.vbp 16 May 2007 01:12:18 -0000 1.1
+++ netrekconfigxp2006.vbp 17 Jul 2007 00:08:37 -0000 1.2
@@ -6,17 +6,17 @@
HelpFile=""
Title="netrekconfig"
ExeName32="netrekconfigXP2006.exe"
-Path32="..\..\..\NetrekConfig2006"
+Path32="..\..\..\..\netrek"
Command32=""
Name="Netrek_XP_2006_Configurator"
HelpContextID="0"
CompatibleMode="0"
-MajorVer=1
+MajorVer=2
MinorVer=0
-RevisionVer=4
+RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
-VersionComments="Copyright (C) 2007 Joe Evango - Netrek XP 2006 Configuration Program v1.4 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. To contact the author email joe at playnetrek.org"
+VersionComments="Copyright (C) 2007 Joe Evango - Netrek XP 2006 Configuration Program v2.0 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. To contact the author email joe at playnetrek.org"
VersionCompanyName="www.PlayNetrek.org"
VersionProductName="Netrek XP 2006 Configuration Program"
CompilationType=0
--- netrekrc.cfg DELETED ---
Index: Form1.frm
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/configuration-program/Form1.frm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Form1.frm 16 May 2007 01:10:46 -0000 1.8
+++ Form1.frm 17 Jul 2007 00:08:37 -0000 1.9
@@ -1470,7 +1470,7 @@
'
'To contact the author email joe at playnetrek.org
'
-' Program notes from Joe 4/15/07-
+' Program notes from Joe - 4/15/07
' Code contains some comments, pretty easy to follow the logic.
'
' This utility writes to the netrekrc file and assumes it is in located the same folder as the utility so if the
@@ -1492,7 +1492,11 @@
' If a netrekrc file already exists it is save in the netrek root install folder as netrek.sav
' In order for the program to function there will need to be a file named netrekrc in the root of where it is executed
' and a file named netrekrc.cfg in the docs folder. Fixed several bugs that have been reported.
-
+'
+' Program notes from Joe - 7/16/07
+' Finally able to add find/replace functionality and get rid of the old method of appending data to the end of the rc file.
+' Fixed a bug in the detown keymapping in form1.
+' Fixed bug with showMySpeed option
@@ -1508,16 +1512,11 @@
End If
End Sub
-
-
-
-
Private Sub Command1_Click()
-'Saves your current netrekrc to netrekrc.sav and copies a static netrek config file from the docs directory
- FileCopy ".\netrekrc", ".\netrekrc.sav"
- FileCopy ".\docs\netrekrc.cfg", ".\netrekrc"
-
+'Saves your current netrekrc.txt to netrekrc.sav
+ FileCopy ".\netrekrc.txt", ".\netrekrc.sav"
+
Dim warp As Integer
Dim det As Integer
Dim speed As Integer
@@ -1563,7 +1562,6 @@
Dim docking As String
Dim messaging As String
-
Dim tips As Integer
Dim tiptxt As String
@@ -1608,7 +1606,6 @@
Dim keymap29 As String
Dim keymap30 As String
Dim keymap31 As String
-
Dim keytag1 As String
Dim keytag2 As String
@@ -1639,12 +1636,9 @@
Dim currentdate As String
currentdate = Date
- fnum3 = FreeFile
- fnum2 = FreeFile
-'default keymappings
-
+ 'default keymappings
torpedo = "t"
phaser = "p"
shield = "s"
@@ -1691,7 +1685,7 @@
tiptxt = "showHints: on"
End If
- If tips = 0 Then
+ If tips <> 0 Then
tiptxt = "showHints: off"
End If
@@ -1720,9 +1714,7 @@
If det <> 1 Then
dettxt = "detCircle: off"
End If
-
-
-
+
If (Check9.Value = vbChecked) Then
speed = 1
End If
@@ -1731,12 +1723,10 @@
speedtxt = "showMySpeed: on"
End If
- If tips <> 1 Then
+ If speed <> 1 Then
speedtxt = "showMySpeed: off"
End If
-
-
If (Check5.Value = vbChecked) Then
sound = 1
End If
@@ -1749,13 +1739,10 @@
soundtxt = "sound: off"
End If
-
-
If (Check3.Value = vbChecked) Then
stars = 1
End If
-
If stars = 1 Then
starstxt = "showStars: on"
End If
@@ -1862,17 +1849,18 @@
Else
keymap16 = Text1(15) + quit
End If
+
If detown = Text1(16) Then
- keymap = ""
+ keymap17 = ""
Else
keymap17 = Text1(16) + detown
End If
-'no if statement used for detting enemy torps. If no changes are made to the default keymap it creates a blanks "keymap:"
-'entry in the netrekrc which does not override any previous keymap changes listed in netrek. By doing this it will create
-'a "keymap:dd" entry, simply reassigning the det enemy torps key back to itself and overriding any previous keymap entries
-
- keymap18 = Text1(17) + detenemy
+ If detenemy = Text1(17) Then
+ keymap18 = ""
+ Else
+ keymap18 = Text1(17) + detenemy
+ End If
If plasma = Text1(18) Then
keymap19 = ""
@@ -1928,7 +1916,7 @@
keymap28 = Text1(27) + docking
End If
If volumeup = Text1(28) Then
- keymap29 = ""
+ keymap29 = ""
Else
keymap29 = Text1(28) + volumeup
End If
@@ -1995,9 +1983,7 @@
If duplicate = 0 And speckey = 0 And blank = 0 Then
- ' Open the file for append.
- Open ".\netrekrc" For Append As fnum2
-
+
' Add the command.
If Combo1 = "Torpedoes" And Combo2 = "Phasers" Then
buttonmap = "buttonmap:" + "1" + Text1(0) + "2" + Text1(1)
@@ -2034,85 +2020,77 @@
keymap = "keymap:" + keymap1 + keymap2 + keymap3 + keymap4 + keymap5 + keymap6 + keymap7 + keymap8 + keymap9 + keymap10 + keymap11 + keymap12 + keymap13 + keymap14 + keymap15 + keymap16 + keymap17 + keymap18 + keymap19 + keymap20 + keymap21 + keymap22 + keymap23 + keymap24 + keymap25 + keymap26 + keymap27 + keymap28 + keymap29 + keymap30 + keymap31
keytag1 = "###Configuration below was added on - " + currentdate
- Print #fnum2, Chr(13)
- Print #fnum2, Chr(13)
- Print #fnum2, keytag1
- Print #fnum2, Chr(13)
- Print #fnum2, "# Key mapping"
- Print #fnum2, "# Define you keymap here. The format is newkey defaultkey. For example, the"
- Print #fnum2, "# default key for shield toggle is 's', if you want to remap shield toggle to"
- Print #fnum2, "# 'q', you would put 'qs' in your keymap. Shields would still be mapped to"
- Print #fnum2, "# 's' as well as now being on 'q'. Adding a mapping doesn't delete the old"
- Print #fnum2, "# one. If you want shields on 'w' as well, put 'ws' in your keymap. If you"
- Print #fnum2, "# had instead put 'wq', it would have mapped quit, the default action of 'q',"
- Print #fnum2, "# onto 'w'."
- Print #fnum2, keymap
- Print #fnum2, Chr(13)
- Print #fnum2, "# Mouse button mapping"
- Print #fnum2, "# Button map lets you map the mouse buttons. Unfortunately, it works in a"
- Print #fnum2, "# different way than keymap. The format is <mousebutton> <key>. To map"
- Print #fnum2, "# shields onto button 1 (the left one), you would put '1s' in your keymap."
- Print #fnum2, "# The buttonmap works through the keymap, so if you have shields mapped to"
- Print #fnum2, "# 'q', putting '1q' would make button 1 shields and not quit. Buttons 4 and"
- Print #fnum2, "# 5 are support for Microsoft Xbuttons. If you have a wheel mouse, the up"
- Print #fnum2, "# wheel is button 6 and the down wheel is button 7. There is also support"
- Print #fnum2, "# for shifted, controled, and control-shifted mouse actions, see the netrek"
- Print #fnum2, "# help file for more details."
- Print #fnum2, buttonmap
- Print #fnum2, Chr(13)
- Print #fnum2, "# Show hints window"
- Print #fnum2, tiptxt
- Print #fnum2, Chr(13)
- Print #fnum2, "# What type of ship bitmaps to use"
- Print #fnum2, "# 0 - mono"
- Print #fnum2, "# 1 - new color bitmaps (default)"
- Print #fnum2, "# 2 - old color bitmaps"
- Print #fnum2, "# 3 - shaded old color bitmaps"
- Print #fnum2, "# 4 - experimental high res bitmaps"
- Print #fnum2, mode1
- Print #fnum2, Chr(13)
- Print #fnum2, "# Use colored bitmaps for torps and plasmas"
- Print #fnum2, mode2
- Print #fnum2, Chr(13)
- Print #fnum2, "# Type of planet bitmaps on local map"
- Print #fnum2, "# 0 - Bronco (default)"
- Print #fnum2, "# 1 - Moo"
- Print #fnum2, "# 2 - Rabbitear"
- Print #fnum2, "# 3 - New color"
- Print #fnum2, mode4
- Print #fnum2, Chr(13)
- Print #fnum2, "# Type of planet bitmaps on galactic map"
- Print #fnum2, "# 0 - Bronco (default)"
- Print #fnum2, "# 1 - Moo"
- Print #fnum2, "# 2 - Rabbitear"
- Print #fnum2, "# 3 - New color"
- Print #fnum2, mode5
- Print #fnum2, Chr(13)
-
- Print #fnum2, "# Highlight galactic planets by race and army status"
- Print #fnum2, mode6
- Print #fnum2, "# Use beeplite"
- Print #fnum2, mode10
+ ' Open files for find/replace.
+ fnum2 = FreeFile
+ Open ".\netrekrc.sav" For Input As fnum2
-
- Print #fnum2, Chr(13)
- Print #fnum2, "# Enable layered, stereo sound"
- Print #fnum2, soundtxt
- Print #fnum2, Chr(13)
- Print #fnum2, "# Draw background stars"
- Print #fnum2, starstxt
- Print #fnum2, Chr(13)
- Print #fnum2, "# Draw warp streaks while transwarping to starbase"
- Print #fnum2, warptxt
- Print #fnum2, Chr(13)
- Print #fnum2, "# Show det circle around your ship"
- Print #fnum2, dettxt
- Print #fnum2, Chr(13)
- Print #fnum2, "# Show my speed on local"
- Print #fnum2, speedtxt
+ fnum4 = FreeFile
+ Open ".\netrekrc.txt" For Output As fnum4
+
+ While Not EOF(fnum2)
+ Line Input #fnum2, text_line
+ If text_line Like "keymap:*" Then
+ text_line = keymap
+ End If
+ If text_line Like "buttonmap:*" Then
+ text_line = buttonmap
+ End If
+ If text_line Like "sound:*" Then
+ text_line = soundtxt
+ End If
+
+ If text_line Like "warpStreaks:*" Then
+ text_line = warptxt
+ End If
+
+ If text_line Like "showMySpeed:*" Then
+ text_line = speedtxt
+ End If
+
+ If text_line Like "showStars:*" Then
+ text_line = starstxt
+ End If
+
+ If text_line Like "showHints:*" Then
+ text_line = tiptxt
+ End If
+
+ If text_line Like "detCircle:*" Then
+ text_line = dettxt
+ End If
+
+ If text_line Like "colorClient:*" Then
+ text_line = mode1
+ End If
+
+ If text_line Like "colorWeapons:*" Then
+ text_line = mode2
+ End If
+
+ If text_line Like "planetBitmap:*" Then
+ text_line = mode4
+ End If
+
+ If text_line Like "planetBitmapGalaxy:*" Then
+ text_line = mode5
+ End If
+
+ If text_line Like "planetHighlighting:*" Then
+ text_line = mode6
+ End If
+
+ If text_line Like "useLite:*" Then
+ text_line = mode10
+ End If
+
+ Print #fnum4, text_line
+ Wend
Close fnum2
-
+ Close fnum4
+
+
' Opens the controls you chose in notepad for reference
+ fnum3 = FreeFile
Open ".\controls.txt" For Output As #fnum3
Print #fnum3, "These are the controls you have chosen:"
Print #fnum3, Chr(13)
@@ -2204,3 +2182,4 @@
Text1(30) = Text1(30)
End If
End Sub
+