ifmapper 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.txt CHANGED
@@ -1,3 +1,7 @@
1
+ v1.1.3 Bug fixes:
2
+ - Fixed bug in transcript reader which could lead to a crash.
3
+ - Fixed bug in Trizbort Writer which could leave map in half.
4
+
1
5
  v1.1.2 Improvements:
2
6
  - Made room box use tabs for comments, descriptions and objects.
3
7
  - Made dark rooms select as orange.
data/IFMapper.gemspec CHANGED
@@ -2,7 +2,7 @@ require "rubygems"
2
2
 
3
3
  spec = Gem::Specification.new do |spec|
4
4
  spec.name = "ifmapper"
5
- spec.version = '1.1.2'
5
+ spec.version = '1.1.3'
6
6
  spec.author = "Gonzalo Garramuno"
7
7
  spec.email = 'ggarra13@gmail.com'
8
8
  spec.homepage = 'http://www.rubyforge.org/projects/ifmapper/'
@@ -910,9 +910,19 @@ class FXMap < Map
910
910
  def mousewheel_cb(sender, sel, event)
911
911
  case event.code
912
912
  when -120 # Hmm, there does not seem to be constants for these
913
+ pos = @scrollwindow.position
914
+ x = event.last_x
915
+ y = event.last_y
913
916
  zoom_out
917
+ # @scrollwindow.setPosition( -x, -y )
914
918
  when 120 # Hmm, there does not seem to be constants for these
919
+ pos = @scrollwindow.position
920
+ #puts "pos: #{pos[0]} #{pos[1]}"
921
+ x = event.last_x
922
+ y = event.last_y
923
+ #puts "event: #{x} #{y}"
915
924
  zoom_in
925
+ # @scrollwindow.setPosition( -x, -y )
916
926
  end
917
927
  end
918
928
 
@@ -1214,6 +1224,8 @@ class FXMap < Map
1214
1224
  else
1215
1225
  if selection.kind_of?(Connection) and selection.selected
1216
1226
  # Toggle arrow direction
1227
+ # If in navigation mode, we don't allow user to modify map.
1228
+ return if @navigation
1217
1229
  selection.toggle_direction
1218
1230
  draw
1219
1231
  return
@@ -145,7 +145,7 @@ class FXMapperSettings < Hash
145
145
  language = ARGV.shift
146
146
  language = language[0,2].downcase
147
147
  self['Language'] = language
148
- when /.*\.(?:map|ifm|gmp|t|t3m|inf)$/
148
+ when /.*\.(?:map|ifm|gmp|t|t3m|inf|trizbort)$/
149
149
  self['Map'] = param
150
150
  else
151
151
  $stderr.puts "Unknown parameter '#{param}'."
@@ -8,6 +8,7 @@ rescue LoadError
8
8
  end
9
9
 
10
10
  def no_fox
11
+ require "IFMapper/locales/en/Messages.rb"
11
12
  $stderr.puts ERR_NO_FOX
12
13
  if $rubygems
13
14
  $stderr.puts ERR_HAS_GEMS
@@ -46,8 +47,8 @@ require 'IFMapper/FXWarningBox'
46
47
  class FXMapperWindow < FXMainWindow
47
48
 
48
49
  PROGRAM_NAME = "Interactive Fiction Mapper"
49
- VERSION = '1.1.2'
50
- AUTHOR = "Gonzalo Garramuño"
50
+ VERSION = '1.1.3'
51
+ AUTHOR = "Gonzalo Garramuno"
51
52
 
52
53
  @@copy_buffer = nil
53
54
  @@default_options = FXMapperSettings.new
@@ -58,11 +59,11 @@ class FXMapperWindow < FXMainWindow
58
59
 
59
60
  LANGUAGES = {
60
61
  'English' => 'en',
61
- 'Español' => 'es',
62
+ 'Espanol' => 'es',
62
63
  # todo1
63
64
  'Deutsch' => 'de',
64
65
  'Italiano' => 'it',
65
- 'Fran�ais' => 'fr',
66
+ 'Francais' => 'fr',
66
67
  # todo2
67
68
  'Japanese' => 'ja',
68
69
  'Chinese' => 'ch',
@@ -430,13 +431,28 @@ class FXMapperWindow < FXMainWindow
430
431
  return unless map
431
432
 
432
433
  require 'IFMapper/FXMapFileDialog'
433
- d = FXMapFileDialog.new(self, MSG_SAVE_MAP_AS_INFORM,
434
+ d = FXMapFileDialog.new(self, MSG_SAVE_MAP_AS_INFORM6,
434
435
  [
435
- FMT_INFORM,
436
+ FMT_INFORM6,
436
437
  ])
437
438
  map.export_inform( d.filename ) if d.filename != ''
438
439
  end
439
440
 
441
+ #
442
+ # Export current map as an Inform source file
443
+ #
444
+ def inform7_export_cb(sender, sel, msg)
445
+ map = current_map
446
+ return unless map
447
+
448
+ require 'IFMapper/FXMapFileDialog'
449
+ d = FXMapFileDialog.new(self, MSG_SAVE_MAP_AS_INFORM7,
450
+ [
451
+ FMT_INFORM7,
452
+ ])
453
+ map.export_inform7( d.filename ) if d.filename != ''
454
+ end
455
+
440
456
 
441
457
  #
442
458
  # Export current map as a TADs source file
@@ -985,9 +1001,12 @@ class FXMapperWindow < FXMainWindow
985
1001
  cmd = FXMenuCommand.new(submenu, MENU_EXPORT_IFM, nil)
986
1002
  cmd.connect(SEL_COMMAND, method(:ifm_export_cb))
987
1003
 
988
- cmd = FXMenuCommand.new(submenu, MENU_EXPORT_INFORM, nil)
1004
+ cmd = FXMenuCommand.new(submenu, MENU_EXPORT_INFORM6, nil)
989
1005
  cmd.connect(SEL_COMMAND, method(:inform_export_cb))
990
1006
 
1007
+ cmd = FXMenuCommand.new(submenu, MENU_EXPORT_INFORM7, nil)
1008
+ cmd.connect(SEL_COMMAND, method(:inform7_export_cb))
1009
+
991
1010
  cmd = FXMenuCommand.new(submenu, MENU_EXPORT_TADS, nil)
992
1011
  cmd.connect(SEL_COMMAND, method(:tads_export_cb))
993
1012
 
@@ -120,9 +120,9 @@ class FXRoomDialogBox < FXDialogBox
120
120
  @objects.visibleRows = 8
121
121
  @objects.visibleColumns = 40
122
122
 
123
- FXTabItem.new(@tab, BOX_TASKS, nil)
124
- @tasksFrame = FXHorizontalFrame.new(@tab, FRAME_THICK|FRAME_RAISED)
125
- @tasks = FXText.new(@tasksFrame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
123
+ @tasksFrame = FXTabItem.new(@tab, BOX_TASKS, nil)
124
+ frame = FXHorizontalFrame.new(@tab, FRAME_THICK|FRAME_RAISED)
125
+ @tasks = FXText.new(frame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
126
126
  @tasks.visibleRows = 8
127
127
  @tasks.visibleColumns = 40
128
128
 
@@ -572,7 +572,7 @@ class TranscriptReader
572
572
  debug "CMD: #{cmd}"
573
573
  debug "ENDS AT: #{name}"
574
574
 
575
- desc = room[:desc]
575
+ desc = room[:desc].to_s
576
576
  desc.gsub!(/(\w)\s*\n/, '\1 ')
577
577
 
578
578
  line = move[:line]
@@ -1387,6 +1387,9 @@ class TranscriptReader
1387
1387
  # Step one user command at a time
1388
1388
  def step
1389
1389
  begin
1390
+ if @f.eof
1391
+ @map.status AUTOMAP_IS_WAITING_FOR_MORE_TEXT
1392
+ end
1390
1393
  parse_line(@f.gets)
1391
1394
  rescue => e
1392
1395
  $stderr.puts e
@@ -43,13 +43,11 @@ class TrizbortWriter
43
43
  @f.puts "\t<map>"
44
44
  hash = {}
45
45
  x = 0
46
- y = 0
47
- maxX = 0
48
- maxY = 0
49
46
  id = 0
50
47
  @map.sections.each { |s|
48
+ maxX = 0
51
49
  s.rooms.each { |r|
52
- @f.puts "\t\t<room id=\"#{id}\" name=\"#{r.name}\" x=\"#{x + r.x*(W+32)}\" y=\"#{y + r.y*(H+32)}\" w=\"#{W}\" h=\"#{H}\""
50
+ @f.puts "\t\t<room id=\"#{id}\" name=\"#{r.name}\" x=\"#{x + r.x*(W+32)}\" y=\"#{r.y*(H+32)}\" w=\"#{W}\" h=\"#{H}\""
53
51
  if r.darkness
54
52
  @f.puts " isDark=\"yes\""
55
53
  end
@@ -62,9 +60,8 @@ class TrizbortWriter
62
60
  hash[r] = id
63
61
  id += 1
64
62
  maxX = r.x if r.x > maxX
65
- maxY = r.y if r.y > maxY
66
63
  }
67
- x = maxX * (W+32)
64
+ x += maxX * (W+32)
68
65
  s.connections.each { |c|
69
66
  @f.print "\t\t<line id=\"#{id}\""
70
67
  if c.type == Connection::SPECIAL
@@ -102,6 +99,7 @@ class TrizbortWriter
102
99
  write_info
103
100
  write_map
104
101
  @f.puts '</trizbort>'
102
+ @f.close
105
103
  end
106
104
 
107
105
  def initialize(map, fileroot)
@@ -2,7 +2,11 @@
2
2
  TITLE = '#{PROGRAM_NAME} v#{VERSION} - Written by #{AUTHOR}'
3
3
 
4
4
  ################ Errors
5
+ ERR_NO_FOX = 'Please install the FXRuby (FOX) library version 1.6 o later.'
6
+ ERR_HAS_GEMS = 'You can do it if you run \'gem install -r fxruby\''
5
7
  ERR_NO_YAML =<<'EOF'
8
+ Please install the 'yaml' library.
9
+ Without it preferences cannot be loaded or saved.
6
10
  EOF
7
11
  ERR_COULD_NOT_SAVE = 'Could not save'
8
12
  ERR_COULD_NOT_LOAD = 'Could not load'
@@ -61,8 +65,10 @@ FMT_TRIZBORT = 'Trizbort Map (*.trizbort)'
61
65
  MSG_SAVE_MAP_AS_IFM = 'Save Map as IFM File'
62
66
  FMT_IFM = 'IFM Map (*.ifm)'
63
67
 
64
- MSG_SAVE_MAP_AS_INFORM = 'Save Map as Inform Files'
65
- FMT_INFORM = 'Inform Source Code (*.inf,*.inform)'
68
+ MSG_SAVE_MAP_AS_INFORM6 = 'Save Map as Inform 6 Files'
69
+ MSG_SAVE_MAP_AS_INFORM7 = 'Save Map as Inform 7 Files'
70
+ FMT_INFORM6 = 'Inform6 Source Code (*.inf)'
71
+ FMT_INFORM7 = 'Inform7 Source Code (*.inform)'
66
72
 
67
73
  MSG_SAVE_MAP_AS_TADS = 'Save Map as TADS Files'
68
74
  FMT_TADS = 'TADS Source Code (*.t)'
@@ -262,7 +268,8 @@ MENU_EXPORT = 'Export'
262
268
  MENU_EXPORT_PDF = "Export as &PDF...\t\tExport map as Acrobat PDF document."
263
269
  MENU_EXPORT_TRIZBORT = "Export as Triz&bort...\t\tExport map as a Trizbort map."
264
270
  MENU_EXPORT_IFM = "Export as &IFM...\t\tExport map as an IFM map."
265
- MENU_EXPORT_INFORM = "Export as &Inform Source...\t\tExport map as an Inform source code file."
271
+ MENU_EXPORT_INFORM6 = "Export as &Inform 6 Source...\t\tExport map as an Inform 6 source code file."
272
+ MENU_EXPORT_INFORM7 = "Export as &Inform 7 Source...\t\tExport map as an Inform 7 source code file."
266
273
  MENU_EXPORT_TADS = "Export as &TADS3 Source...\t\tExport map as a TADS3 source code file."
267
274
 
268
275
  MENU_PRINT = 'Print'
@@ -465,3 +472,5 @@ class Room
465
472
  'nw',
466
473
  ]
467
474
  end
475
+
476
+ AUTOMAP_IS_WAITING_FOR_MORE_TEXT = "Automap is waiting for more text."
@@ -2,7 +2,7 @@
2
2
  TITLE = '#{PROGRAM_NAME} v#{VERSION} - Programado por #{AUTHOR}'
3
3
 
4
4
  ################ Errores
5
- ERR_NO_FOX = 'Por favor instale la librería FXRuby (FOX) version 1.2 o posterior.'
5
+ ERR_NO_FOX = 'Por favor instale la librería FXRuby (FOX) version 1.6 o posterior.'
6
6
  ERR_HAS_GEMS = 'Puede hacerlo si corre \'gem install -r fxruby\''
7
7
  ERR_NO_YAML =<<'EOF'
8
8
  Por favor instale la librería 'yaml'.
@@ -65,8 +65,10 @@ FMT_TRIZBORT = 'Mapa Trizbort (*.trizbort)'
65
65
  MSG_SAVE_MAP_AS_IFM = 'Grabar Mapa como Archivo IFM'
66
66
  FMT_IFM = 'Mapa IFM (*.ifm)'
67
67
 
68
- MSG_SAVE_MAP_AS_INFORM = 'Grabar Mapa como Archivo Inform'
69
- FMT_INFORM = 'Codigo Fuente de Inform (*.inf,*.inform)'
68
+ MSG_SAVE_MAP_AS_INFORM6 = 'Grabar Mapa como Archivo Inform6'
69
+ MSG_SAVE_MAP_AS_INFORM7 = 'Grabar Mapa como Archivo Inform7'
70
+ FMT_INFORM6 = 'Inform6 Source Code (*.inf)'
71
+ FMT_INFORM7 = 'Inform7 Source Code (*.inform)'
70
72
 
71
73
  MSG_SAVE_MAP_AS_TADS = 'Grabar Mapa como Archivo TADS3'
72
74
  FMT_TADS = 'Codigo Fuente de TADS (*.t)'
@@ -267,7 +269,8 @@ MENU_EXPORT = 'Exportar'
267
269
  MENU_EXPORT_PDF = "Exportar como &PDF...\t\tExportar mapa como documento Acrobat PDF."
268
270
  MENU_EXPORT_TRIZBORT = "Exportar como Triz&bort...\t\tExportar mapa como un archivo Trizbort."
269
271
  MENU_EXPORT_IFM = "Exportar como &IFM...\t\tExportar mapa como un archivo IFM."
270
- MENU_EXPORT_INFORM = "Exportar como Código Fuente de &Inform...\t\tExportar mapa como un código fuente de Inform."
272
+ MENU_EXPORT_INFORM6 = "Exportar como Código Fuente de &Inform 6...\t\tExportar mapa como un código fuente de Inform 6."
273
+ MENU_EXPORT_INFORM7 = "Exportar como Código Fuente de &Inform 7...\t\tExportar mapa como un código fuente de Inform 7."
271
274
  MENU_EXPORT_TADS = "Exportar como Código Fuente de &TADS3...\t\tExportar mapa como un código fuente de TADS3."
272
275
 
273
276
  MENU_PRINT = 'Imprimir'
@@ -469,3 +472,5 @@ class Room
469
472
  'no',
470
473
  ]
471
474
  end
475
+
476
+ AUTOMAP_IS_WAITING_FOR_MORE_TEXT = "Automap espera por más texto."
data/maps/Hunter.map ADDED
Binary file
data/maps/Planetfall.map CHANGED
Binary file
Binary file
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ifmapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 2
10
- version: 1.1.2
9
+ - 3
10
+ version: 1.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gonzalo Garramuno
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-06 00:00:00 -03:00
18
+ date: 2011-06-13 00:00:00 -03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -246,6 +246,7 @@ files:
246
246
  - maps/heroes.map
247
247
  - maps/Heroine.map
248
248
  - maps/History Repeating.map
249
+ - maps/Hunter.map
249
250
  - maps/inhumane.map
250
251
  - maps/Janitor.map
251
252
  - maps/Jigsaw.map