ifmapper 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.txt +66 -0
- data/IFMapper.gemspec +2 -2
- data/lib/IFMapper/FXConnection.rb +1 -0
- data/lib/IFMapper/FXMap.rb +9 -10
- data/lib/IFMapper/FXMapFileDialog.rb +1 -1
- data/lib/IFMapper/FXMapperWindow.rb +49 -8
- data/lib/IFMapper/FXRoomDialogBox.rb +1 -1
- data/lib/IFMapper/InformReader.rb +39 -25
- data/lib/IFMapper/Room.rb +1 -3
- data/lib/IFMapper/TADSReader.rb +170 -103
- data/lib/IFMapper/TranscriptDialogBox.rb +74 -16
- data/lib/IFMapper/TranscriptReader.rb +73 -34
- data/maps/AMFV.map +0 -0
- data/maps/AllRoads.map +0 -0
- data/maps/CityOfSecrets.map +0 -0
- data/maps/Janitor.map +0 -0
- data/maps/Tangle.map +0 -0
- data/maps/balances.map +0 -0
- data/maps/bear.map +0 -0
- data/maps/break_in.map +0 -0
- data/maps/deadline.map +0 -0
- data/maps/delusions.map +0 -0
- data/maps/dreamhold.map +0 -0
- data/maps/drift3.map +0 -0
- data/maps/eas.map +0 -0
- data/maps/eas2.map +0 -0
- data/maps/eas3.map +0 -0
- data/maps/fallacy.map +0 -0
- data/maps/heist.map +0 -0
- data/maps/heroes.map +0 -0
- data/maps/lurkinghorror.map +0 -0
- data/maps/moonmist.map +0 -0
- data/maps/photograph.map +0 -0
- data/maps/pkgirl.map +0 -0
- data/maps/risorgimento.map +0 -0
- data/maps/sherbet.map +0 -0
- data/maps/slouch.map +0 -0
- data/maps/wasp.map +0 -0
- data/maps/zerosum.map +0 -0
- metadata +21 -9
data/lib/IFMapper/TADSReader.rb
CHANGED
@@ -11,6 +11,74 @@ class TADSReader
|
|
11
11
|
class ParseError < StandardError; end
|
12
12
|
class MapError < StandardError; end
|
13
13
|
|
14
|
+
|
15
|
+
# TADS 3 directional properties need to be spelled fully
|
16
|
+
DIRECTIONS = {
|
17
|
+
'north' => 0,
|
18
|
+
'northeast' => 1,
|
19
|
+
'east' => 2,
|
20
|
+
'southeast' => 3,
|
21
|
+
'south' => 4,
|
22
|
+
'southwest' => 5,
|
23
|
+
'west' => 6,
|
24
|
+
'northwest' => 7,
|
25
|
+
'up' => 8,
|
26
|
+
'down' => 9,
|
27
|
+
'in' => 10,
|
28
|
+
'out' => 11
|
29
|
+
}
|
30
|
+
|
31
|
+
FUNCTION = /^\[ (\w+);/
|
32
|
+
|
33
|
+
GO_OBJ = /\b(#{DIRECTIONS.keys.join('|').gsub(/_to/, '_obj')})\s*:/i
|
34
|
+
|
35
|
+
# SINGLE QUOTED STRING
|
36
|
+
SQ = '((?:\\\\\'|[^\'])+)'
|
37
|
+
|
38
|
+
# DOUBLE QUOTED STRING
|
39
|
+
DQ = '((?:\\\"|[^"])+)'
|
40
|
+
|
41
|
+
# Equal sign (TADS supports C or Pascal-like =)
|
42
|
+
EQ = '\s*(?:=|\:=)\s*'
|
43
|
+
|
44
|
+
# Direction list in order of positioning preference.
|
45
|
+
DIRLIST = [ 0, 4, 2, 6, 1, 3, 5, 7 ]
|
46
|
+
|
47
|
+
DIR_EQ = "(#{DIRECTIONS.keys.join('|')})#{EQ}"
|
48
|
+
DIR_TO = /(?:^|\s+)#{DIR_EQ}/
|
49
|
+
DIR = /(?:^|\s+)#{DIR_EQ}(\w+)/
|
50
|
+
DIR_OPEN = /(?:^|\s+)#{DIR_EQ}\(\s*[\d\w]+\.isOpen\s*\?\s*([\d\w]+)/
|
51
|
+
DIR_INSELF = /(?:^|\s+)#{DIR_EQ}\(\s*[\d\w]+\.isIn\(\s*self\s*\)\s*\?\s*([\d\w]+)/
|
52
|
+
DIR_MSG = /(?:^|\s+)(#{DIRECTIONS.keys.join('|')})\s*\:\s*TravelMessage\s*\{\s*\->\s*(\w+)/
|
53
|
+
|
54
|
+
ENTER_DIR = //i # needed?
|
55
|
+
|
56
|
+
OBJLOCATION = /(?:^|\s+)(?:(?:destination|location)#{EQ}(\w+)|@(\w+)|locationList#{EQ}\[([\w\s,]+)\])/
|
57
|
+
OBJNAME = /(?:^|\s+)name#{EQ}(?:'#{SQ}'|\(\s*described\s*\?\s*'#{SQ}')/
|
58
|
+
CONNECTOR = /(?:^|\s+)room\d+\s*#{EQ}\s*(\w+)/
|
59
|
+
ROOMNAME = /(?:^|\s+)roomName#{EQ}'#{SQ}'/
|
60
|
+
DESCRIPTION = /(?:^|\s+)desc#{EQ}(?:\s*$|\s+"#{DQ}?("?))/
|
61
|
+
|
62
|
+
|
63
|
+
# TADS3 template definitions are like:
|
64
|
+
# [+] [TAG:] Classes ['adjective nouns'] 'Name' @location
|
65
|
+
PLUS = '\s*([\+]+\s*)?'
|
66
|
+
TAG = '(?:([\w\d]+)\s*:)?\s*'
|
67
|
+
CLS = '([\w\s\-\>,]+)'
|
68
|
+
NOMS = "(?:\'#{SQ}\')?"
|
69
|
+
NAME = "(?:\s+\'#{SQ}\')?"
|
70
|
+
LOC = '\s+(?:@([\d\w]+))?'
|
71
|
+
|
72
|
+
CLASS = /^class\s+(\w+)\s*:\s*([\w,\s]+)/i
|
73
|
+
DOOR = /(?:^|\s+)door_to(?:\s+([^,;]*)|$)/i
|
74
|
+
INCLUDE = /^#include\s+[<"]([^">]+)[">]/
|
75
|
+
|
76
|
+
STD_LIB = [
|
77
|
+
'adv3.h',
|
78
|
+
'en_us.h',
|
79
|
+
]
|
80
|
+
|
81
|
+
|
14
82
|
# Take a quoted TADS string and return a valid ASCII one, replacing
|
15
83
|
# TADS's special characters.
|
16
84
|
def self.unquote(text)
|
@@ -63,6 +131,9 @@ class TADSReader
|
|
63
131
|
def to_s
|
64
132
|
"#@name tag:#@tag"
|
65
133
|
end
|
134
|
+
def num_exits
|
135
|
+
return @exits.nitems
|
136
|
+
end
|
66
137
|
def name=(x)
|
67
138
|
@name = TADSReader::unquote(x)
|
68
139
|
end
|
@@ -75,47 +146,6 @@ class TADSReader
|
|
75
146
|
end
|
76
147
|
end
|
77
148
|
|
78
|
-
# TADS 3 directional properties need to be spelled fully
|
79
|
-
DIRECTIONS = {
|
80
|
-
'north' => 0,
|
81
|
-
'northeast' => 1,
|
82
|
-
'east' => 2,
|
83
|
-
'southeast' => 3,
|
84
|
-
'south' => 4,
|
85
|
-
'southwest' => 5,
|
86
|
-
'west' => 6,
|
87
|
-
'northwest' => 7,
|
88
|
-
'up' => 8,
|
89
|
-
'down' => 9,
|
90
|
-
'in' => 10,
|
91
|
-
'out' => 11
|
92
|
-
}
|
93
|
-
|
94
|
-
FUNCTION = /^\[ (\w+);/
|
95
|
-
|
96
|
-
GO_OBJ = /\b(#{DIRECTIONS.keys.join('|').gsub(/_to/, '_obj')})\s*:/i
|
97
|
-
|
98
|
-
# SINGLE QUOTED STRING
|
99
|
-
SQ = '((?:\\\'|[^\'])+)'
|
100
|
-
|
101
|
-
# DOUBLE QUOTED STRING
|
102
|
-
DQ = '((?:\\\"|[^"])+)'
|
103
|
-
|
104
|
-
# Equal sign (TADS supports C or Pascal-like =)
|
105
|
-
EQ = '\s*(?:=|\:=)\s*'
|
106
|
-
|
107
|
-
# Direction list in order of positioning preference.
|
108
|
-
DIRLIST = [ 0, 4, 2, 6, 1, 3, 5, 7 ]
|
109
|
-
|
110
|
-
DIR_TO = /(?:^|\s+)(#{DIRECTIONS.keys.join('|')})#{EQ}/
|
111
|
-
DIR = /(?:^|\s+)(#{DIRECTIONS.keys.join('|')})#{EQ}(\w+)/
|
112
|
-
ENTER_DIR = //i # needed?
|
113
|
-
|
114
|
-
OBJLOCATION = /(?:^|\s+)(?:(?:destination|location)#{EQ}(\w+)|@(\w+)|locationList#{EQ}\[([\w\s,]+)\])/
|
115
|
-
OBJNAME = /(?:^|\s+)name#{EQ}'#{SQ}'/
|
116
|
-
CONNECTOR = /(?:^|\s+)room\d+\s*#{EQ}\s*(\w+)/
|
117
|
-
ROOMNAME = /(?:^|\s+)roomName#{EQ}'#{SQ}'/
|
118
|
-
DESCRIPTION = /(?:^|\s+)desc#{EQ}(?:\s*$|\s+"#{DQ}?("?))/
|
119
149
|
|
120
150
|
attr_reader :map
|
121
151
|
|
@@ -167,7 +197,7 @@ class TADSReader
|
|
167
197
|
full_line = @line.dup
|
168
198
|
begin
|
169
199
|
parse_line
|
170
|
-
rescue ParseError => e
|
200
|
+
rescue ParseError, MapError => e
|
171
201
|
$stderr.puts
|
172
202
|
$stderr.puts "#{e} at #{file.path}, line #{line_number}:"
|
173
203
|
$stderr.puts ">>>> #{full_line};"
|
@@ -178,15 +208,6 @@ class TADSReader
|
|
178
208
|
end
|
179
209
|
|
180
210
|
|
181
|
-
CLASS = /^class\s+(\w+)\s*:\s*([\w,\s]+)/i
|
182
|
-
DOOR = /(?:^|\s+)door_to(?:\s+([^,;]*)|$)/i
|
183
|
-
INCLUDE = /^#include\s+[<"]([^">]+)[">]/
|
184
|
-
|
185
|
-
STD_LIB = [
|
186
|
-
'adv3.h',
|
187
|
-
'en_us.h',
|
188
|
-
]
|
189
|
-
|
190
211
|
|
191
212
|
def new_room
|
192
213
|
# We assume we are a room (albeit we could be an obj)
|
@@ -263,15 +284,20 @@ class TADSReader
|
|
263
284
|
#
|
264
285
|
# Handle room description
|
265
286
|
#
|
266
|
-
if @in_desc == 1
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
287
|
+
if @in_desc == 1 then
|
288
|
+
if @line =~ /^\s*"#{DQ}("\s*)?$/
|
289
|
+
# check for possible start description
|
290
|
+
@room.desc << $1
|
291
|
+
if $2
|
292
|
+
@in_desc = nil
|
293
|
+
else
|
294
|
+
@in_desc = 2
|
295
|
+
end
|
296
|
+
return
|
297
|
+
elsif @room.name == @room.tag and @line =~ /^\s*#{NOMS}#{NAME}\s*/
|
298
|
+
name = $1 || $2
|
299
|
+
@room.name = name
|
273
300
|
end
|
274
|
-
return
|
275
301
|
end
|
276
302
|
|
277
303
|
if @in_desc == 2
|
@@ -284,13 +310,7 @@ class TADSReader
|
|
284
310
|
|
285
311
|
# TADS3 definition is like:
|
286
312
|
# [+] [TAG:] Classes ['adjective nouns'] 'Name' @location
|
287
|
-
|
288
|
-
tag = '(?:(\w+)\s*:)?\s*'
|
289
|
-
cls = '([\w\s\-\>,]+)'
|
290
|
-
noms = "(?:\'#{SQ}\'\s+)?"
|
291
|
-
name = "(?:\'#{SQ}\')?"
|
292
|
-
loc = '\s+(?:@(\w+))?'
|
293
|
-
re = /^#{plus}#{tag}#{cls}#{noms}#{name}#{loc}/
|
313
|
+
re = /^#{PLUS}#{TAG}#{CLS}#{NOMS}#{NAME}#{LOC}/
|
294
314
|
if @line =~ re
|
295
315
|
|
296
316
|
prev = $1
|
@@ -329,7 +349,7 @@ class TADSReader
|
|
329
349
|
@obj.tag = @tag
|
330
350
|
@tags[@tag] = @obj
|
331
351
|
@doors << @obj
|
332
|
-
elsif @clas =~ /\b(?:(?:Hidden|Secret)?Door|ThroughPassage|Stairway(?:Up|Down))\b/
|
352
|
+
elsif @clas =~ /\b(?:(?:Hidden|Secret)?Door|ThroughPassage|PathPassage|TravelWithMessage|Stairway(?:Up|Down))\b/
|
333
353
|
@desc = ''
|
334
354
|
@name = @name[0] || @name[1]
|
335
355
|
@tag = @name if not @tag
|
@@ -353,10 +373,12 @@ class TADSReader
|
|
353
373
|
@tags[@tag] = @obj
|
354
374
|
@doors << @obj
|
355
375
|
end
|
376
|
+
@obj.connector = true if @clas =~ /Passage|Stairway/
|
356
377
|
elsif @clas =~ /\b(?:Thing|Food|Person)\b/
|
357
378
|
@obj = nil
|
358
379
|
@desc = ''
|
359
380
|
@name = @name[0] || @name[1]
|
381
|
+
@name = '' if @name =~ /\//
|
360
382
|
@tag = @name if not @tag
|
361
383
|
new_obj(loc) if @tag
|
362
384
|
else
|
@@ -374,7 +396,12 @@ class TADSReader
|
|
374
396
|
end
|
375
397
|
|
376
398
|
if @obj
|
377
|
-
|
399
|
+
|
400
|
+
if @obj.name == '' and @line =~ /^\s*#{NOMS}#{NAME}\s*$/
|
401
|
+
name = $2 || $1
|
402
|
+
@obj.name = name
|
403
|
+
end
|
404
|
+
@obj.name = $1 || $2 if @line =~ OBJNAME
|
378
405
|
if @line =~ OBJLOCATION
|
379
406
|
if $1
|
380
407
|
locs = $1.split(/\s*,\s*/)
|
@@ -394,10 +421,11 @@ class TADSReader
|
|
394
421
|
@in_desc = 2 if $2 == ''
|
395
422
|
end
|
396
423
|
|
397
|
-
dirs = @line.scan(DIR_TO) + @line.scan(DIR)
|
424
|
+
# dirs = @line.scan(DIR_TO) + @line.scan(DIR) + @line.scan(DIR_MSG)
|
425
|
+
dirs = @line.scan(DIR) + @line.scan(DIR_MSG) + @line.scan(DIR_OPEN) + @line.scan(DIR_INSELF)
|
398
426
|
if dirs.size > 0
|
399
427
|
dirs.each { |d, room|
|
400
|
-
next if room == 'nil'
|
428
|
+
next if not room or room == 'nil' or room == 'noTravel'
|
401
429
|
dir = DIRECTIONS[d]
|
402
430
|
@room.exits[dir] = room
|
403
431
|
}
|
@@ -520,23 +548,30 @@ class TADSReader
|
|
520
548
|
return best
|
521
549
|
end
|
522
550
|
|
523
|
-
def make_room(
|
551
|
+
def make_room(to, x, y, dx = 1, dy = 0)
|
552
|
+
if not @map.free?(x, y)
|
553
|
+
@map.shift(x, y, dx, dy)
|
554
|
+
end
|
555
|
+
room = @map.new_room(x, y)
|
556
|
+
room.name = to.name
|
557
|
+
desc = to.desc
|
558
|
+
desc.gsub!(/[\t\n]/, ' ')
|
559
|
+
desc.squeeze!(' ')
|
560
|
+
room.desc = TADSReader::unquote(desc)
|
561
|
+
room.darkness = !to.light
|
562
|
+
@tags[to.tag] = room
|
563
|
+
return room
|
564
|
+
end
|
565
|
+
|
566
|
+
def get_exit(from, to, x, y, dx = 1, dy = 0 )
|
524
567
|
elem = @tags[to.tag]
|
525
568
|
if elem.kind_of?(TADSRoom)
|
526
|
-
|
527
|
-
@map.shift(x, y, dx, dy)
|
528
|
-
end
|
529
|
-
room = @map.new_room(x, y)
|
530
|
-
room.name = to.name
|
531
|
-
desc = to.desc
|
532
|
-
desc.gsub!(/[\t\n]/, ' ')
|
533
|
-
desc.squeeze!(' ')
|
534
|
-
room.desc = TADSReader::unquote(desc)
|
535
|
-
room.darkness = !to.light
|
536
|
-
@tags[to.tag] = room
|
569
|
+
room = create_room(to, x, y, dx, dy)
|
537
570
|
return [room, Connection::FREE]
|
538
571
|
elsif elem.kind_of?(TADSDoor)
|
539
|
-
if elem.
|
572
|
+
if elem.connector
|
573
|
+
type = Connection::FREE
|
574
|
+
elsif elem.locked
|
540
575
|
type = Connection::LOCKED_DOOR
|
541
576
|
else
|
542
577
|
type = Connection::CLOSED_DOOR
|
@@ -547,8 +582,8 @@ class TADSReader
|
|
547
582
|
o.exits.each { |e|
|
548
583
|
next unless e
|
549
584
|
if @tags[e] == elem
|
550
|
-
res =
|
551
|
-
return [ res
|
585
|
+
res = create_room( o, x, y, dx, dy )
|
586
|
+
return [ res, type ]
|
552
587
|
end
|
553
588
|
}
|
554
589
|
}
|
@@ -558,21 +593,22 @@ class TADSReader
|
|
558
593
|
next if @tags[tag] == from
|
559
594
|
@rooms.each { |o|
|
560
595
|
next if o.tag != tag
|
561
|
-
res =
|
562
|
-
return [ res
|
596
|
+
res = create_room( o, x, y, dx, dy )
|
597
|
+
return [ res, type ]
|
563
598
|
}
|
564
599
|
}
|
565
600
|
|
566
|
-
#raise "error: no room with door #{to.name} #{elem.name}"
|
601
|
+
#raise MapError, "error: no room with door #{to.name} #{elem.name}"
|
567
602
|
return [nil, nil]
|
568
603
|
else
|
569
604
|
return [elem, Connection::FREE]
|
570
605
|
end
|
571
606
|
end
|
572
607
|
|
573
|
-
def create_room(r, x, y, dx =
|
574
|
-
|
575
|
-
|
608
|
+
def create_room(r, x, y, dx = 2, dy = 0)
|
609
|
+
return @tags[r.tag] if @tags[r.tag].kind_of?(Room)
|
610
|
+
from, = make_room(r, x, y, dx, dy)
|
611
|
+
debug "CREATE ROOM #{r.name} TAG:#{r.tag}"
|
576
612
|
|
577
613
|
r.exits.each_with_index { |e, exit|
|
578
614
|
next unless e
|
@@ -582,7 +618,10 @@ class TADSReader
|
|
582
618
|
to = @tags[e]
|
583
619
|
if not to
|
584
620
|
next if @functions.include?(e)
|
585
|
-
|
621
|
+
if not to
|
622
|
+
$stderr.puts "Exit to #{e} (#{e.class}) not found, ignored."
|
623
|
+
next
|
624
|
+
end
|
586
625
|
end
|
587
626
|
|
588
627
|
go = c = nil
|
@@ -615,14 +654,13 @@ class TADSReader
|
|
615
654
|
x = from.x + dx
|
616
655
|
y = from.y + dy
|
617
656
|
debug "#{exit} CREATE TO #{from} -> #{to.tag}"
|
618
|
-
to, type =
|
657
|
+
to, type = get_exit(from, to, x, y, dx, dy)
|
619
658
|
next if not to
|
620
659
|
end
|
621
660
|
|
622
661
|
if exit > 7
|
623
662
|
# choose a dir for up/down/in/out
|
624
663
|
go = exit - 7
|
625
|
-
p "GO: #{go} choose_dir"
|
626
664
|
dir = choose_dir(from, to, go)
|
627
665
|
end
|
628
666
|
|
@@ -696,14 +734,20 @@ class TADSReader
|
|
696
734
|
end
|
697
735
|
}
|
698
736
|
|
699
|
-
return
|
737
|
+
return from
|
700
738
|
end
|
701
739
|
|
702
740
|
#
|
703
741
|
# Create all the stuff we found
|
704
742
|
#
|
705
743
|
def create
|
706
|
-
@rooms.
|
744
|
+
@rooms = @rooms.sort_by { |r| r.num_exits }
|
745
|
+
@rooms.reverse!
|
746
|
+
|
747
|
+
@rooms.each { |r|
|
748
|
+
min, max = @map.sections[@map.section].min_max_rooms
|
749
|
+
create_room(r, max[0] + 2, 0)
|
750
|
+
}
|
707
751
|
@rooms = []
|
708
752
|
|
709
753
|
# Add objects to rooms
|
@@ -758,7 +802,21 @@ class TADSReader
|
|
758
802
|
return false
|
759
803
|
end
|
760
804
|
|
761
|
-
|
805
|
+
def parse_makefile(file)
|
806
|
+
dir = File.dirname(file)
|
807
|
+
files = []
|
808
|
+
File.foreach(file) { |line|
|
809
|
+
if line =~ /-source\s*([^\s]+)/
|
810
|
+
f = $1
|
811
|
+
if f !~ /^(?:[A-Z]:|\/)/
|
812
|
+
f = dir + '/' + f
|
813
|
+
end
|
814
|
+
files << "#{f}.t"
|
815
|
+
end
|
816
|
+
}
|
817
|
+
|
818
|
+
return files
|
819
|
+
end
|
762
820
|
|
763
821
|
def set_include_dirs
|
764
822
|
# Try to find t3make(.exe) in path.
|
@@ -796,13 +854,23 @@ class TADSReader
|
|
796
854
|
return unless properties
|
797
855
|
end
|
798
856
|
|
799
|
-
|
800
|
-
|
801
|
-
|
857
|
+
|
858
|
+
if file =~ /.t3m/
|
859
|
+
files = parse_makefile(file)
|
860
|
+
else
|
861
|
+
files = file
|
862
|
+
end
|
863
|
+
|
864
|
+
files.each_with_index { |file, idx|
|
865
|
+
debug "Start parsing #{file}"
|
866
|
+
File.open(file) { |f|
|
867
|
+
parse(f)
|
868
|
+
}
|
869
|
+
debug "Done parsing #{file}"
|
802
870
|
}
|
803
|
-
|
871
|
+
|
804
872
|
puts "Rooms: #{@rooms.size}"
|
805
|
-
puts "Doors: #{@doors.size}"
|
873
|
+
puts "Doors/Connectors: #{@doors.size}"
|
806
874
|
puts "Objects: #{@objects.size}"
|
807
875
|
|
808
876
|
create
|
@@ -810,7 +878,6 @@ class TADSReader
|
|
810
878
|
|
811
879
|
if @map.kind_of?(FXMap)
|
812
880
|
@map.filename = file.sub(/\.t$/i, '.map')
|
813
|
-
@map.navigation = true
|
814
881
|
@map.options['Location Description'] = true
|
815
882
|
@map.window.show
|
816
883
|
end
|
@@ -1,24 +1,62 @@
|
|
1
1
|
|
2
2
|
class TranscriptDialogBox < FXDialogBox
|
3
3
|
|
4
|
+
EXPLANATION_TEXT = [
|
5
|
+
"Classic Mode expects a short name description for all
|
6
|
+
locations, where all words of 5 or more characters to are
|
7
|
+
capitalized and where there is no period.
|
8
|
+
Commands always begin with a > prompt.",
|
9
|
+
"Capitalized Mode expects a short name description for all
|
10
|
+
locations, where only the first word needs to be capitalized
|
11
|
+
and there is no period.
|
12
|
+
Commands always begin with a > prompt.",
|
13
|
+
"Moonmist mode describes locations in parenthesis, with 'You
|
14
|
+
are...' prefixed and a period at the end, inside the parenthesis.
|
15
|
+
Commands always begin with a > prompt.",
|
16
|
+
"Witness mode expects locations described as normal prose, using
|
17
|
+
'You are...' as an introductory paragraph. When in brief mode,
|
18
|
+
locations are expected to be in parenthesis.
|
19
|
+
Commands always begin with a > prompt.",
|
20
|
+
"ADRIFT mode expects locations to be like in Classic Mode (short
|
21
|
+
names where all words of 5 or more characters are capitalized).
|
22
|
+
However, commands do not begin with any type of prompt but start
|
23
|
+
with a lowercase word without any margin.",
|
24
|
+
]
|
25
|
+
|
4
26
|
LOCATION_TEXT = [
|
5
27
|
"
|
28
|
+
> look
|
6
29
|
West of House
|
7
30
|
You are standing in an open field west of a white house, with a boarded
|
8
31
|
front door.
|
9
32
|
",
|
10
33
|
"
|
34
|
+
> look
|
35
|
+
Women's change room
|
36
|
+
Your heels click loudly on the tiles, echoing down the banks of lockers
|
37
|
+
that line the sides of the room.
|
38
|
+
",
|
39
|
+
"
|
40
|
+
> look
|
11
41
|
(You are now in the driveway.)
|
12
42
|
(You're sitting in the sports car.)
|
13
43
|
You are by the front gate of the Tresyllian Castle. You can hear the ocean
|
14
44
|
beating urgently against the rocks far below.
|
15
45
|
",
|
16
46
|
"
|
47
|
+
> look
|
17
48
|
You are now in the driveway entrance.
|
18
|
-
You are standing at the foot of the driveway, the entrance to the
|
19
|
-
property. The entire lot is screened from the street and the
|
20
|
-
a wooden fence, except on the east side, which fronts on
|
21
|
-
bamboo woods.
|
49
|
+
You are standing at the foot of the driveway, the entrance to the
|
50
|
+
Linder property. The entire lot is screened from the street and the
|
51
|
+
neighbors by a wooden fence, except on the east side, which fronts on
|
52
|
+
dense bamboo woods.
|
53
|
+
",
|
54
|
+
"
|
55
|
+
look
|
56
|
+
Front of Mall
|
57
|
+
Although four-wheeled vehicles do pass through, this autonomous
|
58
|
+
spot of pavement is too narrow a place for them to stall. It is just
|
59
|
+
right for bicycles and motorbikes such as yours.
|
22
60
|
",
|
23
61
|
]
|
24
62
|
|
@@ -27,10 +65,16 @@ bamboo woods.
|
|
27
65
|
West of House
|
28
66
|
",
|
29
67
|
"
|
68
|
+
Women's change room
|
69
|
+
",
|
70
|
+
"
|
30
71
|
(You are in the driveway.)
|
31
72
|
",
|
32
73
|
"
|
33
74
|
(driveway entrance)
|
75
|
+
",
|
76
|
+
"
|
77
|
+
Front of Mall
|
34
78
|
",
|
35
79
|
]
|
36
80
|
|
@@ -41,14 +85,17 @@ West of House
|
|
41
85
|
|
42
86
|
SHORTNAME_TYPE = [
|
43
87
|
'Classic',
|
44
|
-
'
|
45
|
-
'
|
88
|
+
'Capitalized',
|
89
|
+
'Moonmist',
|
90
|
+
'Witness',
|
91
|
+
'ADRIFT',
|
46
92
|
]
|
47
93
|
|
48
94
|
def copy_from(transcript)
|
49
95
|
@transcript = transcript
|
50
96
|
@type.currentNo = transcript.identify
|
51
97
|
@short.currentNo = transcript.shortName
|
98
|
+
@exp.text = EXPLANATION_TEXT[@short.currentNo]
|
52
99
|
@show.text = LOCATION_TEXT[@short.currentNo]
|
53
100
|
@show2.text = LOCATION2_TEXT[@short.currentNo]
|
54
101
|
parent = transcript.map.window
|
@@ -57,6 +104,7 @@ West of House
|
|
57
104
|
def copy_to()
|
58
105
|
@transcript.identify = @type.currentNo
|
59
106
|
@transcript.shortName = @short.currentNo
|
107
|
+
@exp.text = EXPLANATION_TEXT[@short.currentNo]
|
60
108
|
@show.text = LOCATION_TEXT[@short.currentNo]
|
61
109
|
@show2.text = LOCATION2_TEXT[@short.currentNo]
|
62
110
|
end
|
@@ -76,6 +124,17 @@ West of House
|
|
76
124
|
FRAME_SUNKEN|FRAME_THICK|
|
77
125
|
LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
78
126
|
|
127
|
+
frame = FXHorizontalFrame.new(mainFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
|
128
|
+
FXLabel.new(frame, "Transcript Style: ", nil, 0, LAYOUT_FILL_X)
|
129
|
+
pane = FXPopup.new(self)
|
130
|
+
SHORTNAME_TYPE.each { |t|
|
131
|
+
FXOption.new(pane, t, nil, nil, 0, JUSTIFY_HZ_APART|ICON_AFTER_TEXT)
|
132
|
+
}
|
133
|
+
@short = FXOptionMenu.new(frame, pane, FRAME_RAISED|FRAME_THICK|
|
134
|
+
JUSTIFY_HZ_APART|ICON_AFTER_TEXT|
|
135
|
+
LAYOUT_CENTER_X|LAYOUT_CENTER_Y)
|
136
|
+
|
137
|
+
|
79
138
|
frame = FXHorizontalFrame.new(mainFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
|
80
139
|
FXLabel.new(frame, "Identify Locations: ", nil, 0, LAYOUT_FILL_X)
|
81
140
|
pane = FXPopup.new(self)
|
@@ -87,20 +146,19 @@ West of House
|
|
87
146
|
LAYOUT_CENTER_X|LAYOUT_CENTER_Y)
|
88
147
|
|
89
148
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
@
|
97
|
-
|
98
|
-
LAYOUT_CENTER_X|LAYOUT_CENTER_Y)
|
149
|
+
|
150
|
+
frame = FXVerticalFrame.new(mainFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
|
151
|
+
FXLabel.new(frame, "Explanation: ", nil, 0, LAYOUT_FILL_X)
|
152
|
+
@exp = FXText.new(frame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
153
|
+
@exp.visibleRows = 4
|
154
|
+
@exp.visibleColumns = 60
|
155
|
+
@exp.backColor = mainFrame.backColor
|
156
|
+
@exp.disable
|
99
157
|
|
100
158
|
frame = FXVerticalFrame.new(mainFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
|
101
159
|
FXLabel.new(frame, "Sample Verbose Mode: ", nil, 0, LAYOUT_FILL_X)
|
102
160
|
@show = FXText.new(frame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
103
|
-
@show.visibleRows =
|
161
|
+
@show.visibleRows = 9
|
104
162
|
@show.visibleColumns = 60
|
105
163
|
@show.disable
|
106
164
|
FXLabel.new(frame, "Sample Brief Mode: ", nil, 0, LAYOUT_FILL_X)
|