REM $INCLUDE: 'future.bi'
Set640x480 32
Future.MouseOn
2 setmouserange 640, 480, 640, 480
SetLocation 640, 480

'VALEURS
'-------
v$ = "v1.1"
debug = 0
file1$ = "GTA2edit\logo.bmp"
file2$ = "GTA2edit\circle.bmp"
file3$ = "GTA2edit\push.bmp"
b.gauche$ = "GTA2edit\left.bmp"
b.droit$ = "GTA2edit\right.bmp"
b.defaut$ = "GTA2edit\df.bmp"
nycori$ = "GTA2edit\nyc.gci"
nycvo$ = "nyc.gci"
nyctemp$ = "nyc.txt"
blank$ = STRING$(100, " ")
colofont& = RGB2Color(200, 200, 200)
colofont2& = RGB2Color(205, 55, 55)
colofont3& = RGB2Color(55, 205, 55)
colofont4& = RGB2Color(55, 55, 205)
avv = 14

'CHARGEMENT DE L'IMAGE BACKGROUND
'--------------------------------
IF backdejafait = 1 THEN GOTO 111
future.loadbmp file1$, 147, 53
i = 640
DO
i = i - 1
future.loadbmp file2$, i, 0
LOOP UNTIL i = 0
future.loadbmp file3$, 555, 15
future.print 566, 20, "QUITTER", colofont2&, -1
future.loadbmp file3$, 32, 15
future.print 36, 20, "PRECEDENT", colofont2&, -1
future.loadbmp file3$, 32 + 80, 15
future.print 36 + 80 + 19, 20, "SAVE", colofont2&, -1
future.print 340, 20, "GTA2EDIT " + v$ + ", 2002 KATANA", colofont2&, -1

' CHARGEMENT... CREATION DU TEMP, AFFICHAGE DES CAISSES, ...
'-----------------------------------------------------------
111 OPEN nycvo$ FOR INPUT AS #1   'OUVRE L'ORIGINAL
OPEN nyctemp$ FOR OUTPUT AS #2 'OUVRE LE FICHIER POUR PURIFIER NYC.GCI
car = -1
DO
LINE INPUT #1, a$
IF LEFT$(a$, 1) = "{" AND RIGHT$(a$, 1) = "}" THEN car$ = MID$(a$, 2, LEN(a$) - 2): GOTO 100
1 IF car >= 0 AND car < 29 THEN future.print 0, car * 11 + 150, STR$(car) + " " + car$, colofont&, -1
IF car > 28 AND car < 58 THEN future.print 200, (car - 29) * 11 + 150, STR$(car) + " " + car$, colofont&, -1
IF car > 57 THEN future.print 400, (car - 58) * 11 + 150, STR$(car) + " " + car$, colofont&, -1
LOOP UNTIL EOF(1)
CLOSE
future.print 408, 447, "VOITURES:" + STR$(car), colofont2&, -1

'CHOIX A LA SOURIS D'UNE VOITURE
'-------------------------------
setmouserange 0, 0, 640, 480
DO
future.updatemouse
mx = Future.MouseX
my = Future.MouseY
b.g = (((Future.MouseB AND 1) = 1) ^ 2) ^ .5
b.d = (((Future.MouseB AND 2) = 2) ^ 2) ^ .5
IF mx > 555 AND mx < 634 AND my > 15 AND my < 38 AND b.g = 1 THEN GOTO 999
IF mx >= 0 AND mx < 200 AND b.g = 1 AND my > 151 AND my < 471 THEN carchosen = INT((my - 2 - 150) / 11) + 1
IF mx >= 200 AND mx < 400 AND b.g = 1 AND my > 151 AND my < 471 THEN carchosen = INT((my - 2 - 150) / 11) + 29 + 1
IF mx >= 400 AND mx < 600 AND b.g = 1 AND my > 151 AND my < 427 THEN carchosen = INT((my - 2 - 150) / 11) + 58 + 1
LOOP UNTIL carchosen <> 0
carchosen = carchosen - 1

'UNE FOIS LA CAISSE TROUVEE, RELOAD ET CHARGE UNE AUTRE INTERFACE
'----------------------------------------------------------------
setmouserange 640, 480, 640, 480
SetLocation 640, 480
FOR i = 1 TO 27
future.print 0, 138 + i * avv, blank$, 0, 0
NEXT i
CLOSE
OPEN nyctemp$ FOR INPUT AS #1
DO
LINE INPUT #1, car$
IF VAL(car$) <> carchosen THEN FOR i = 1 TO 23: LINE INPUT #1, a$: NEXT i
LOOP UNTIL VAL(car$) = carchosen     'POINTE SUR LE NUMERO DE LA CAISSE

'LES GRAPHIQUES ET L'INTERFACE COMMENCENT ...
'--------------------------------------------
LINE INPUT #1, car$       'ENREGISTREMENT DES VALEURS
LINE INPUT #1, a$
model = VAL(a$)
LINE INPUT #1, a$
turbo = VAL(a$)
LINE INPUT #1, a$
value = VAL(a$)
LINE INPUT #1, a$
pad = VAL(a$)
LINE INPUT #1, a$
mass! = VAL(a$)
LINE INPUT #1, a$
fdb! = VAL(a$)
LINE INPUT #1, a$
fmb! = VAL(a$)
LINE INPUT #1, a$
brake! = VAL(a$)
LINE INPUT #1, a$
turnin! = VAL(a$)
LINE INPUT #1, a$
turnratio! = VAL(a$)
LINE INPUT #1, a$
res! = VAL(a$)
LINE INPUT #1, a$
handbrake! = VAL(a$)
LINE INPUT #1, a$
thr! = VAL(a$)
LINE INPUT #1, a$
maxspeed! = VAL(a$)
LINE INPUT #1, a$
antis! = VAL(a$)
LINE INPUT #1, a$
skid! = VAL(a$)
LINE INPUT #1, a$
gear1x! = VAL(a$)
LINE INPUT #1, a$
gear2x! = VAL(a$)
LINE INPUT #1, a$
gear3x! = VAL(a$)
LINE INPUT #1, a$
gear2s! = VAL(a$)
LINE INPUT #1, a$
gear3s! = VAL(a$)

OPEN nycori$ FOR INPUT AS #3
DO
LINE INPUT #3, car$
IF VAL(car$) <> carchosen THEN FOR i = 1 TO 23: LINE INPUT #3, a$: NEXT i
LOOP UNTIL VAL(car$) = carchosen     'POINTE SUR LE NUMERO DE LA CAISSE
LINE INPUT #3, carvo$       'ENREGISTREMENT DES VALEURS PAR DEFAUT
LINE INPUT #3, a$
modelvo = VAL(a$)
LINE INPUT #3, a$
turbovo = VAL(a$)
LINE INPUT #3, a$
valuevo = VAL(a$)
LINE INPUT #3, a$
padvo = VAL(a$)
LINE INPUT #3, a$
massvo! = VAL(a$)
LINE INPUT #3, a$
fdbvo! = VAL(a$)
LINE INPUT #3, a$
fmbvo! = VAL(a$)
LINE INPUT #3, a$
brakevo! = VAL(a$)
LINE INPUT #3, a$
turninvo! = VAL(a$)
LINE INPUT #3, a$
turnratiovo! = VAL(a$)
LINE INPUT #3, a$
resvo! = VAL(a$)
LINE INPUT #3, a$
handbrakevo! = VAL(a$)
LINE INPUT #3, a$
thrvo! = VAL(a$)
LINE INPUT #3, a$
maxspeedvo! = VAL(a$)
LINE INPUT #3, a$
antisvo! = VAL(a$)
LINE INPUT #3, a$
skidvo! = VAL(a$)
LINE INPUT #3, a$
gear1xvo! = VAL(a$)
LINE INPUT #3, a$
gear2xvo! = VAL(a$)
LINE INPUT #3, a$
gear3xvo! = VAL(a$)
LINE INPUT #3, a$
gear2svo! = VAL(a$)
LINE INPUT #3, a$
gear3svo! = VAL(a$)
CLOSE

future.print 0, 150 - avv, "                     ", colofont4&, 0
future.print 0, 150 - avv, UCASE$(carvo$), colofont4&, 0
future.print 0, 150 + 1 * avv, "VALEURS DE GTA2", colofont3&, -1
future.print 0, 150 + 3 * avv, "turbo", colofont&, -1
future.print 0, 150 + 4 * avv, "value", colofont&, -1
future.print 0, 150 + 5 * avv, "pad", colofont&, -1
future.print 0, 150 + 6 * avv, "mass", colofont&, -1
future.print 0, 150 + 7 * avv, "front drive bias", colofont&, -1
future.print 0, 150 + 8 * avv, "front mass bias", colofont&, -1
future.print 0, 150 + 9 * avv, "brake friction", colofont&, -1
future.print 0, 150 + 10 * avv, "turn in", colofont&, -1
future.print 0, 150 + 11 * avv, "turn ratio", colofont&, -1
future.print 0, 150 + 12 * avv, "rear end stability", colofont&, -1
future.print 0, 150 + 13 * avv, "handbrake slide value", colofont&, -1
future.print 0, 150 + 14 * avv, "thrust", colofont&, -1
future.print 0, 150 + 15 * avv, "max speed", colofont&, -1
future.print 0, 150 + 16 * avv, "anti strenght", colofont&, -1
future.print 0, 150 + 17 * avv, "skid threshold", colofont&, -1
future.print 0, 150 + 18 * avv, "gear 1 multiplier", colofont&, -1
future.print 0, 150 + 19 * avv, "gear 2 multiplier", colofont&, -1
future.print 0, 150 + 20 * avv, "gear 3 multiplier", colofont&, -1
future.print 0, 150 + 21 * avv, "gear 2 speed", colofont&, -1
future.print 0, 150 + 22 * avv, "gear 3 speed", colofont&, -1

FOR i = 3 TO 22                                   'PREPARATION DES BOUTONS
future.loadbmp b.gauche$, 180, 150 + i * avv + 4
future.loadbmp b.droit$, 252, 150 + i * avv + 4
future.loadbmp b.defaut$, 262, 150 + i * avv + 4
NEXT i

'TRANSFORMATION DES VALEURS CHAINES POUR AFFICHAGE A 3 CHIFFRES SIGNIFICATIFS
'----------------------------------------------------------------------------
FOR ii = 1 TO 17
IF ii = 1 THEN ma! = mass!
IF ii = 2 THEN ma! = fdb!
IF ii = 3 THEN ma! = fmb!
IF ii = 4 THEN ma! = brake!
IF ii = 5 THEN ma! = turnin!
IF ii = 6 THEN ma! = turnratio!
IF ii = 7 THEN ma! = res!
IF ii = 8 THEN ma! = handbrake!
IF ii = 9 THEN ma! = thr!
IF ii = 10 THEN ma! = maxspeed!
IF ii = 11 THEN ma! = antis!
IF ii = 12 THEN ma! = skid!
IF ii = 13 THEN ma! = gear1x!
IF ii = 14 THEN ma! = gear2x!
IF ii = 15 THEN ma! = gear3x!
IF ii = 16 THEN ma! = gear2s!
IF ii = 17 THEN ma! = gear3s!
IF ma! < 0 THEN ma! = 0
IF ma! > 100 THEN ma! = 99.999
ma! = CLNG(ma! * 1000) / 1000
ma$ = STR$(ma!)
IF MID$(ma$, 2, 1) = "." THEN ma$ = "0" + ma$  ' AJOUT DU 0 AU DEBUT SI < 1
mb$ = ma$
ma$ = ""
FOR i = 1 TO LEN(mb$)
s$ = MID$(mb$, i, 1)
IF s$ <> " " THEN ma$ = ma$ + s$
NEXT i
ont = 0               'AJOUT DE TROIS 0 SI VALEUR SANS VIRGULE
FOR i = 1 TO LEN(ma$)
s$ = MID$(ma$, i, 1)
IF s$ = "." THEN ont = 1
NEXT i
IF ont = 0 THEN ma$ = ma$ + ".000": GOTO 12
FOR i = 1 TO LEN(ma$) 'AJOUT DE 0 A LA FIN
s$ = MID$(ma$, i, 1)
IF s$ = "." AND LEN(ma$) - i = 2 THEN ma$ = ma$ + "0"
IF s$ = "." AND LEN(ma$) - i = 1 THEN ma$ = ma$ + "00"
NEXT i
12 IF ii = 1 THEN mass$ = ma$: mass! = ma!
IF ii = 2 THEN fdb$ = ma$: fdb! = ma!
IF ii = 3 THEN fmb$ = ma$: fmb! = ma!
IF ii = 4 THEN brake$ = ma$: brake! = ma!
IF ii = 5 THEN turnin$ = ma$: turnin! = ma!
IF ii = 6 THEN turnratio$ = ma$: turnratio! = ma!
IF ii = 7 THEN res$ = ma$: res! = ma!
IF ii = 8 THEN handbrake$ = ma$: handbrake! = ma!
IF ii = 9 THEN thr$ = ma$: thr! = ma!
IF ii = 10 THEN maxspeed$ = ma$: maxspeed! = ma!
IF ii = 11 THEN antis$ = ma$: antis! = ma!
IF ii = 12 THEN skid$ = ma$: skid! = ma!
IF ii = 13 THEN gear1x$ = ma$: gear1x! = ma!
IF ii = 14 THEN gear2x$ = ma$: gear2x! = ma!
IF ii = 15 THEN gear3x$ = ma$: gear3x! = ma!
IF ii = 16 THEN gear2s$ = ma$: gear2s! = ma!
IF ii = 17 THEN gear3s$ = ma$: gear3s! = ma!
NEXT ii

future.print 188 + 8, 150 + 3 * avv, STR$(turbo), colofont&, 0
future.print 188 + 8, 150 + 4 * avv, STR$(value), colofont&, 0
future.print 188 + 8, 150 + 5 * avv, STR$(pad), colofont&, 0
future.print 188 + 8, 150 + 6 * avv, mass$, colofont&, 0
future.print 188 + 8, 150 + 7 * avv, fdb$, colofont&, 0
future.print 188 + 8, 150 + 8 * avv, fmb$, colofont&, 0
future.print 188 + 8, 150 + 9 * avv, brake$, colofont&, 0
future.print 188 + 8, 150 + 10 * avv, turnin$, colofont&, 0
future.print 188 + 8, 150 + 11 * avv, turnratio$, colofont&, 0
future.print 188 + 8, 150 + 12 * avv, res$, colofont&, 0
future.print 188 + 8, 150 + 13 * avv, handbrake$, colofont&, 0
future.print 188 + 8, 150 + 14 * avv, thr$, colofont&, 0
future.print 188 + 8, 150 + 15 * avv, maxspeed$, colofont&, 0
future.print 188 + 8, 150 + 16 * avv, antis$, colofont&, 0
future.print 188 + 8, 150 + 17 * avv, skid$, colofont&, 0
future.print 188 + 8, 150 + 18 * avv, gear1x$, colofont&, 0
future.print 188 + 8, 150 + 19 * avv, gear2x$, colofont&, 0
future.print 188 + 8, 150 + 20 * avv, gear3x$, colofont&, 0
future.print 188 + 8, 150 + 21 * avv, gear2s$, colofont&, 0
future.print 188 + 8, 150 + 22 * avv, gear3s$, colofont&, 0

'INTERFACE:
'----------
setmouserange 0, 0, 640, 480
GOTO 15
DO
DO
future.updatemouse
mx = Future.MouseX
my = Future.MouseY
b.g = (((Future.MouseB AND 1) = 1) ^ 2) ^ .5
b.d = (((Future.MouseB AND 2) = 2) ^ 2) ^ .5

IF debug = 1 THEN future.print 0, 0, "MX:" + STR$(mx), 16777215, 0
IF debug = 1 THEN future.print 0, avv, "MY:" + STR$(my), 16777215, 0
LOOP UNTIL b.g = 1
IF b.d = 1 THEN supp! = .1
IF b.d = 0 THEN supp! = 0

15
IF mx > 178 AND mx < 184 AND my > 195 AND my < 203 AND b.g = 1 THEN turbo = 0
IF mx > 251 AND mx < 256 AND my > 195 AND my < 203 AND b.g = 1 THEN turbo = 1
IF mx > 251 + 10 AND mx < 280 AND my > 195 AND my < 203 AND b.g = 1 THEN turbo = turbovo
av = avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 AND value - 1 >= 0 THEN value = value - 1
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 AND value + 1 < 100 THEN value = value + 1
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN value = valuevo
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN pad = 0
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN pad = 1
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN pad = padvo
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN mass! = mass! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN mass! = mass! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN mass! = massvo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN fdb! = fdb! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN fdb! = fdb! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN fdb! = fdbvo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN fmb! = fmb! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN fmb! = fmb! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN fmb! = fmbvo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN brake! = brake! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN brake! = brake! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN brake! = brakevo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN turnin! = turnin! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN turnin! = turnin! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN turnin! = turninvo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN turnratio! = turnratio! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN turnratio! = turnratio! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN turnratio! = turnratiovo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN res! = res! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN res! = res! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN res! = resvo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN handbrake! = handbrake! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN handbrake! = handbrake! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN handbrake! = handbrakevo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN thr! = thr! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN thr! = thr! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN thr! = thrvo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN maxspeed! = maxspeed! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN maxspeed! = maxspeed! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN maxspeed! = maxspeedvo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN antis! = antis! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN antis! = antis! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN antis! = antisvo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN skid! = skid! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN skid! = skid! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN skid! = skidvo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear1x! = gear1x! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear1x! = gear1x! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear1x! = gear1xvo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear2x! = gear2x! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear2x! = gear2x! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear2x! = gear2xvo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear3x! = gear3x! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear3x! = gear3x! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear3x! = gear3xvo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear2s! = gear2s! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear2s! = gear2s! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear2s! = gear2svo!
av = av + avv
IF mx > 178 AND mx < 184 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear3s! = gear3s! - .001 - supp!
IF mx > 251 AND mx < 256 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear3s! = gear3s! + .001 + supp!
IF mx > 251 + 10 AND mx < 280 AND my > 195 + av AND my < 203 + av AND b.g = 1 THEN gear3s! = gear3svo!

'TRANSFORMATION DES VALEURS CHAINES POUR AFFICHAGE A 3 CHIFFRES SIGNIFICATIFS
'----------------------------------------------------------------------------
FOR ii = 1 TO 17
IF ii = 1 THEN ma! = mass!
IF ii = 2 THEN ma! = fdb!
IF ii = 3 THEN ma! = fmb!
IF ii = 4 THEN ma! = brake!
IF ii = 5 THEN ma! = turnin!
IF ii = 6 THEN ma! = turnratio!
IF ii = 7 THEN ma! = res!
IF ii = 8 THEN ma! = handbrake!
IF ii = 9 THEN ma! = thr!
IF ii = 10 THEN ma! = maxspeed!
IF ii = 11 THEN ma! = antis!
IF ii = 12 THEN ma! = skid!
IF ii = 13 THEN ma! = gear1x!
IF ii = 14 THEN ma! = gear2x!
IF ii = 15 THEN ma! = gear3x!
IF ii = 16 THEN ma! = gear2s!
IF ii = 17 THEN ma! = gear3s!
IF ma! < 0 THEN ma! = 0
IF ma! > 100 THEN ma! = 99.999
ma! = CLNG(ma! * 1000) / 1000
ma$ = STR$(ma!)
IF MID$(ma$, 2, 1) = "." THEN ma$ = "0" + ma$  ' AJOUT DU 0 AU DEBUT SI < 1
mb$ = ma$
ma$ = ""
FOR i = 1 TO LEN(mb$)
s$ = MID$(mb$, i, 1)
IF s$ <> " " THEN ma$ = ma$ + s$
NEXT i
ont = 0               'AJOUT DE TROIS 0 SI VALEUR SANS VIRGULE
FOR i = 1 TO LEN(ma$)
s$ = MID$(ma$, i, 1)
IF s$ = "." THEN ont = 1
NEXT i
IF ont = 0 THEN ma$ = ma$ + ".000": GOTO 11
FOR i = 1 TO LEN(ma$) 'AJOUT DE 0 A LA FIN
s$ = MID$(ma$, i, 1)
IF s$ = "." AND LEN(ma$) - i = 2 THEN ma$ = ma$ + "0"
IF s$ = "." AND LEN(ma$) - i = 1 THEN ma$ = ma$ + "00"
NEXT i
11 IF ii = 1 THEN mass$ = ma$: mass! = ma!
IF ii = 2 THEN fdb$ = ma$: fdb! = ma!
IF ii = 3 THEN fmb$ = ma$: fmb! = ma!
IF ii = 4 THEN brake$ = ma$: brake! = ma!
IF ii = 5 THEN turnin$ = ma$: turnin! = ma!
IF ii = 6 THEN turnratio$ = ma$: turnratio! = ma!
IF ii = 7 THEN res$ = ma$: res! = ma!
IF ii = 8 THEN handbrake$ = ma$: handbrake! = ma!
IF ii = 9 THEN thr$ = ma$: thr! = ma!
IF ii = 10 THEN maxspeed$ = ma$: maxspeed! = ma!
IF ii = 11 THEN antis$ = ma$: antis! = ma!
IF ii = 12 THEN skid$ = ma$: skid! = ma!
IF ii = 13 THEN gear1x$ = ma$: gear1x! = ma!
IF ii = 14 THEN gear2x$ = ma$: gear2x! = ma!
IF ii = 15 THEN gear3x$ = ma$: gear3x! = ma!
IF ii = 16 THEN gear2s$ = ma$: gear2s! = ma!
IF ii = 17 THEN gear3s$ = ma$: gear3s! = ma!
NEXT ii

IF turbo <> turbo2 THEN future.print 188 + 8, 150 + 3 * avv, STR$(turbo), colofont&, 0
IF value <> value2 THEN future.print 188 + 8, 150 + 4 * avv, STR$(value) + "   ", colofont&, 0
IF pad <> pad2 THEN future.print 188 + 8, 150 + 5 * avv, STR$(pad), colofont&, 0

IF mass$ <> mass2$ THEN future.print 188 + 8, 150 + 6 * avv, mass$ + " ", colofont&, 0
IF fdb$ <> fdb2$ THEN future.print 188 + 8, 150 + 7 * avv, fdb$ + " ", colofont&, 0
IF fmb$ <> fmb2$ THEN future.print 188 + 8, 150 + 8 * avv, fmb$ + " ", colofont&, 0
IF brake$ <> brake2$ THEN future.print 188 + 8, 150 + 9 * avv, brake$ + " ", colofont&, 0
IF turnin$ <> turnin2$ THEN future.print 188 + 8, 150 + 10 * avv, turnin$ + " ", colofont&, 0
IF turnratio$ <> turnratio2$ THEN future.print 188 + 8, 150 + 11 * avv, turnratio$ + " ", colofont&, 0
IF res$ <> res2$ THEN future.print 188 + 8, 150 + 12 * avv, res$ + " ", colofont&, 0
IF handbrake$ <> handbrake2$ THEN future.print 188 + 8, 150 + 13 * avv, handbrake$ + " ", colofont&, 0
IF thr$ <> thr2$ THEN future.print 188 + 8, 150 + 14 * avv, thr$ + " ", colofont&, 0
IF maxspeed$ <> maxspeed2$ THEN future.print 188 + 8, 150 + 15 * avv, maxspeed$ + " ", colofont&, 0
IF antis$ <> antis2$ THEN future.print 188 + 8, 150 + 16 * avv, antis$ + " ", colofont&, 0
IF skid$ <> skid2$ THEN future.print 188 + 8, 150 + 17 * avv, skid$ + " ", colofont&, 0
IF gear1x$ <> gear1x2$ THEN future.print 188 + 8, 150 + 18 * avv, gear1x$ + " ", colofont&, 0
IF gear2x$ <> gear2x2$ THEN future.print 188 + 8, 150 + 19 * avv, gear2x$ + " ", colofont&, 0
IF gear3x$ <> gear3x2$ THEN future.print 188 + 8, 150 + 20 * avv, gear3x$ + " ", colofont&, 0
IF gear2s$ <> gear2s2$ THEN future.print 188 + 8, 150 + 21 * avv, gear2s$ + " ", colofont&, 0
IF gear3s$ <> gear3s2$ THEN future.print 188 + 8, 150 + 22 * avv, gear3s$ + " ", colofont&, 0

turbo2 = turbo
value2 = value
pad2 = pad
mass2$ = mass$
fdb2$ = fdb$
fmb2$ = fmb$
brake2$ = brake$
turnin2$ = turnin$
turnratio2$ = turnratio$
res2$ = res$
handrake2$ = handbrake$
thr2$ = thr$
maxspeed2$ = maxspeed$
antis2$ = antis$
skid2$ = skid$
gear1x2$ = gear1x$
gear2x2$ = gear2x$
gear3x2$ = gear3x$
gear2s2$ = gear2s$
gear3s2$ = gear3s$

'QUITTER
IF mx > 555 AND mx < 555 + 80 AND my > 15 AND my < 15 + 23 AND b.g = 1 THEN GOTO 999
'PRECEDENT
IF b.g = 1 AND mx > 32 AND mx < 32 + 80 AND my > 15 AND my < 15 + 23 THEN carchosen = 0: future.print 0, 150 - avv, "                     ", colofont4&, 0: FOR i = 1 TO 27: future.print 0, 138 + i * avv, blank$, 0, 0: NEXT i: backdejafait = 1: GOTO  _
2
'SAVE
IF b.g = 1 AND mx > 112 AND mx < 112 + 80 AND my > 15 AND my < 15 + 23 THEN GOTO 101
16 LOOP

999 CLOSE
KILL nyctemp$
Future.MouseOff
ReSetScreen
END

'FONCTION QUI FORMATE LE FICHIER NYC.GCI
'---------------------------------------
100 car = car + 1       'ON ECRIT TOUTES LES DONNEES CONCERNANT CHAQUE CAISSE
FOR i = 1 TO 21
LINE INPUT #1, a$
aa$ = ""
FOR ii = 1 TO LEN(a$)   'ON ENLEVE L'ESPACE ENTRE LES VALEURS ET LES INDICS
IF MID$(a$, ii, 1) = " " THEN GOTO 1001
aa$ = aa$ + MID$(a$, ii, 1)
NEXT ii
1001
IF i = 1 THEN PRINT #2, RIGHT$(STR$(car), LEN(STR$(car)) - 1)
IF i = 1 THEN PRINT #2, car$
IF i <= 4 THEN PRINT #2, aa$
IF i > 4 THEN PRINT #2, RIGHT$(aa$, LEN(aa$) - 1)
NEXT i
PRINT #2,               'ON MARQUE UNE LIGNE VIERGE
GOTO 1

'FONCTION QUI ENREGISTRE LES MODIFS
'----------------------------------
101
OPEN nyctemp$ FOR INPUT AS #1
OPEN nycvo$ FOR OUTPUT AS #2
PRINT #2, "{**********************"
PRINT #2, "GENERATED BY GTA2EDIT, 2002 KATANA"
PRINT #2, "**********************}"
PRINT #2, ""
DO
LINE INPUT #1, car$
IF VAL(car$) <> carchosen THEN LINE INPUT #1, car$: PRINT #2, "{" + car$ + "}": FOR i = 1 TO 4: LINE INPUT #1, a$: PRINT #2, a$: NEXT i: FOR i = 1 TO 17: LINE INPUT #1, a$: PRINT #2, "f" + a$: NEXT i: LINE INPUT #1, car$: PRINT #2, ""
IF VAL(car$) = carchosen THEN LINE INPUT #1, car$: FOR i = 1 TO 22: LINE INPUT #1, a$: NEXT i: GOTO 102
LOOP
102 PRINT #2, "{" + car$ + "}"
PRINT #2, RIGHT$(STR$(model), LEN(STR$(model)) - 1)
PRINT #2, RIGHT$(STR$(turbo), LEN(STR$(turbo)) - 1)
PRINT #2, RIGHT$(STR$(value), LEN(STR$(value)) - 1)
PRINT #2, RIGHT$(STR$(pad), LEN(STR$(pad)) - 1)
PRINT #2, "f" + mass$
PRINT #2, "f" + fdb$
PRINT #2, "f" + fmb$
PRINT #2, "f" + brake$
PRINT #2, "f" + turnin$
PRINT #2, "f" + turnratio$
PRINT #2, "f" + res$
PRINT #2, "f" + handbrake$
PRINT #2, "f" + thr$
PRINT #2, "f" + maxspeed$
PRINT #2, "f" + antis$
PRINT #2, "f" + skid$
PRINT #2, "f" + gear1x$
PRINT #2, "f" + gear2x$
PRINT #2, "f" + gear3x$
PRINT #2, "f" + gear2s$
PRINT #2, "f" + gear3s$
PRINT #2, ""
DO
LINE INPUT #1, car$
LINE INPUT #1, car$
PRINT #2, "{" + car$ + "}"
FOR i = 1 TO 4
LINE INPUT #1, car$
PRINT #2, car$
NEXT i
FOR i = 1 TO 17
LINE INPUT #1, car$
PRINT #2, "f" + car$
NEXT i
PRINT #2, ""
LINE INPUT #1, car$
LOOP UNTIL EOF(1)
CLOSE
GOTO 16

