ifmapper 1.0.0 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. data/HISTORY.txt +648 -627
  2. data/IFMapper.gemspec +29 -28
  3. data/IFMapper.rbw +31 -31
  4. data/TODO.txt +8 -7
  5. data/bin/IFMapper +31 -31
  6. data/docs/en/index.html +0 -0
  7. data/docs/en/start.html +3 -2
  8. data/docs/en/start.html~ +516 -0
  9. data/docs/es/index.html +0 -0
  10. data/docs/es/start.html +13 -14
  11. data/docs/es/start.html~ +1280 -0
  12. data/docs/images/IFMapper_main.gif +0 -0
  13. data/docs/images/automap.gif +0 -0
  14. data/docs/images/complex_connection.gif +0 -0
  15. data/docs/images/connection.gif +0 -0
  16. data/docs/images/connection_menu.gif +0 -0
  17. data/docs/images/room_description.gif +0 -0
  18. data/docs/images/room_small.gif +0 -0
  19. data/icons/copy.png +0 -0
  20. data/icons/cut.png +0 -0
  21. data/icons/filenew.png +0 -0
  22. data/icons/fileopen.png +0 -0
  23. data/icons/filesave.png +0 -0
  24. data/icons/filesaveas.png +0 -0
  25. data/icons/help.png +0 -0
  26. data/icons/kill.png +0 -0
  27. data/icons/nextpage.png +0 -0
  28. data/icons/paste.png +0 -0
  29. data/icons/prevpage.png +0 -0
  30. data/icons/printicon.png +0 -0
  31. data/icons/redo.png +0 -0
  32. data/icons/room_e.gif +0 -0
  33. data/icons/room_e.xpm +0 -0
  34. data/icons/room_n.gif +0 -0
  35. data/icons/room_n.xpm +0 -0
  36. data/icons/room_ne.gif +0 -0
  37. data/icons/room_ne.xpm +0 -0
  38. data/icons/room_nw.gif +0 -0
  39. data/icons/room_nw.xpm +0 -0
  40. data/icons/room_s.gif +0 -0
  41. data/icons/room_s.xpm +0 -0
  42. data/icons/room_se.gif +0 -0
  43. data/icons/room_se.xpm +0 -0
  44. data/icons/room_sw.gif +0 -0
  45. data/icons/room_sw.xpm +0 -0
  46. data/icons/room_w.gif +0 -0
  47. data/icons/room_w.xpm +0 -0
  48. data/icons/saveas.png +0 -0
  49. data/icons/undo.png +0 -0
  50. data/icons/winapp.png +0 -0
  51. data/icons/zoom.png +0 -0
  52. data/lib/IFMapper/AStar.rb +250 -250
  53. data/lib/IFMapper/Connection.rb +202 -202
  54. data/lib/IFMapper/FXAboutDialogBox.rb +32 -32
  55. data/lib/IFMapper/FXConnection.rb +364 -364
  56. data/lib/IFMapper/FXConnectionDialogBox.rb +124 -124
  57. data/lib/IFMapper/FXDCPostscript.rb +404 -404
  58. data/lib/IFMapper/FXDCPrint.rb +15 -15
  59. data/lib/IFMapper/FXItemList.rb +108 -0
  60. data/lib/IFMapper/FXMap.rb +2147 -2116
  61. data/lib/IFMapper/FXMapColorBox.rb +88 -88
  62. data/lib/IFMapper/FXMapDialogBox.rb +127 -127
  63. data/lib/IFMapper/FXMapFileDialog.rb +34 -34
  64. data/lib/IFMapper/FXMapperSettings.rb +206 -205
  65. data/lib/IFMapper/FXMapperWindow.rb +1592 -1571
  66. data/lib/IFMapper/FXPDFMapExporterOptionsDialogBox.rb +46 -0
  67. data/lib/IFMapper/FXRoom.rb +263 -263
  68. data/lib/IFMapper/FXRoomDialogBox.rb +159 -159
  69. data/lib/IFMapper/FXRoomList.rb +95 -95
  70. data/lib/IFMapper/FXSearchDialogBox.rb +51 -51
  71. data/lib/IFMapper/FXSection.rb +33 -33
  72. data/lib/IFMapper/FXSectionDialogBox.rb +38 -38
  73. data/lib/IFMapper/FXSpline.rb +52 -52
  74. data/lib/IFMapper/FXWarningBox.rb +51 -50
  75. data/lib/IFMapper/GUEReader.rb +445 -445
  76. data/lib/IFMapper/IFMReader.rb +584 -584
  77. data/lib/IFMapper/IFMWriter.rb +245 -227
  78. data/lib/IFMapper/Inform7Writer.rb +579 -573
  79. data/lib/IFMapper/InformReader.rb +478 -478
  80. data/lib/IFMapper/InformWriter.rb +364 -359
  81. data/lib/IFMapper/Map.rb +202 -200
  82. data/lib/IFMapper/MapPrinting.rb +162 -162
  83. data/lib/IFMapper/MapReader.rb +900 -900
  84. data/lib/IFMapper/PDFMapExporter.rb +526 -483
  85. data/lib/IFMapper/Room.rb +153 -151
  86. data/lib/IFMapper/Section.rb +234 -234
  87. data/lib/IFMapper/TADSReader.rb +474 -471
  88. data/lib/IFMapper/TADSWriter.rb +375 -370
  89. data/lib/IFMapper/TranscriptDialogBox.rb +0 -0
  90. data/lib/IFMapper/TranscriptReader.rb +1361 -1359
  91. data/lib/IFMapper/locales/en/Messages.rb +446 -435
  92. data/lib/IFMapper/locales/es/Messages.rb +451 -440
  93. data/lib/IFMapper/locales/es/Messages_iso-8859-1.rb +455 -440
  94. data/lib/IFMapper/locales/es/runme.sh +3 -3
  95. data/maps/A New Life.map b/data/maps/A New → Life.map +0 -0
  96. data/maps/AMFV.map +0 -0
  97. data/maps/AllRoads.map +0 -0
  98. data/maps/Aotearoa.map +0 -0
  99. data/maps/Bronze.map +0 -0
  100. data/maps/Bureaucracy.ifm +0 -0
  101. data/maps/Bureaucracy.map +0 -0
  102. data/maps/CityOfSecrets.map +0 -0
  103. data/maps/DDIV.map +0 -0
  104. data/maps/Following_A_Star.map +0 -0
  105. data/maps/Heated.map +0 -0
  106. data/maps/Heroine.map +0 -0
  107. data/maps/History Repeating.map b/data/maps/History → Repeating.map +0 -0
  108. data/maps/Hollywood_Hijinx.ifm +0 -0
  109. data/maps/Janitor.map +0 -0
  110. data/maps/Jigsaw.ifm +0 -0
  111. data/maps/Jigsaw.map +0 -0
  112. data/maps/LGOP.ifm +0 -0
  113. data/maps/Mercy.ifm +0 -0
  114. data/maps/Ninjas_Fate.map +0 -0
  115. data/maps/Pen_and_Paint.map +0 -0
  116. data/maps/Planetfall.ifm +0 -0
  117. data/maps/Planetfall.map +0 -0
  118. data/maps/Plundered_Hearts.ifm +0 -0
  119. data/maps/QuietEvening.map +0 -0
  120. data/maps/Ralph.ifm +0 -0
  121. data/maps/Reliques_of_Tolti_Alph.map +0 -0
  122. data/maps/Revolution.map +0 -0
  123. data/maps/Robots_of_Dawn.ifm +0 -0
  124. data/maps/SavoirFare.map +0 -0
  125. data/maps/Seastalker.ifm +0 -0
  126. data/maps/Seastalker.map +0 -0
  127. data/maps/Sherlock.ifm +0 -0
  128. data/maps/SoFar.ifm +0 -0
  129. data/maps/Starcross.ifm +0 -0
  130. data/maps/Suspended.ifm +0 -0
  131. data/maps/Tangle.map +0 -0
  132. data/maps/The_Lost_Sheep.map +0 -0
  133. data/maps/Unforgotten.map +0 -0
  134. data/maps/Warbler's Nest.map +0 -0
  135. data/maps/Warbler's_Nest.map +0 -0
  136. data/maps/Westminster_Abbey.map +0 -0
  137. data/maps/WinterWonderland.map +0 -0
  138. data/maps/Wishbringer.ifm +0 -0
  139. data/maps/Wishbringer2.ifm +0 -0
  140. data/maps/Zork1.ifm +0 -0
  141. data/maps/Zork2.ifm +0 -0
  142. data/maps/Zork3.ifm +0 -0
  143. data/maps/Zork_Zero.ifm +0 -0
  144. data/maps/anchor.ifm +0 -0
  145. data/maps/anchor.map +0 -0
  146. data/maps/atrox.ifm +0 -0
  147. data/maps/awaken.ifm +0 -0
  148. data/maps/babel.ifm +0 -0
  149. data/maps/balances.map +0 -0
  150. data/maps/ballerina.map +0 -0
  151. data/maps/bear.map +0 -0
  152. data/maps/bluechairs.map +0 -0
  153. data/maps/break_in.map +0 -0
  154. data/maps/bse.ifm +0 -0
  155. data/maps/building.map +0 -0
  156. data/maps/change.ifm +0 -0
  157. data/maps/christminster.map +0 -0
  158. data/maps/curses.ifm +0 -0
  159. data/maps/curves.ifm +0 -0
  160. data/maps/deadline.map +0 -0
  161. data/maps/delusions.map +0 -0
  162. data/maps/devours.map +0 -0
  163. data/maps/distress.map +0 -0
  164. data/maps/djinni.map +0 -0
  165. data/maps/dreamhold.map +0 -0
  166. data/maps/drift3.map +0 -0
  167. data/maps/eas.map +0 -0
  168. data/maps/eas2.map +0 -0
  169. data/maps/eas3.map +0 -0
  170. data/maps/edifice.ifm +0 -0
  171. data/maps/fallacy.map +0 -0
  172. data/maps/frozen.ifm +0 -0
  173. data/maps/gamlet.map +0 -0
  174. data/maps/glow.ifm +0 -0
  175. data/maps/guilty_bastards.map +0 -0
  176. data/maps/heist.map +0 -0
  177. data/maps/heroes.map +0 -0
  178. data/maps/inhumane.map +0 -0
  179. data/maps/kaged.map +0 -0
  180. data/maps/library.ifm +0 -0
  181. data/maps/lurkinghorror.map +0 -0
  182. data/maps/metamorphoses.map +0 -0
  183. data/maps/mindelec.ifm +0 -0
  184. data/maps/minster.ifm +0 -0
  185. data/maps/mite.map +0 -0
  186. data/maps/moonmist.map +0 -0
  187. data/maps/muldoon_legacy.map +0 -0
  188. data/maps/muse.ifm +0 -0
  189. data/maps/paperchase.ifm +0 -0
  190. data/maps/party.map +0 -0
  191. data/maps/pawn.map +0 -0
  192. data/maps/photograph.map +0 -0
  193. data/maps/pkgirl.map +0 -0
  194. data/maps/pytho.map +0 -0
  195. data/maps/risorgimento.map +0 -0
  196. data/maps/sherbet.map +0 -0
  197. data/maps/simple.map +0 -0
  198. data/maps/slouch.map +0 -0
  199. data/maps/space_st.ifm +0 -0
  200. data/maps/splashdown.map +0 -0
  201. data/maps/spring.map +0 -0
  202. data/maps/squarecircle.map +0 -0
  203. data/maps/stationfall.ifm +0 -0
  204. data/maps/theatre.ifm +0 -0
  205. data/maps/toonesia.ifm +0 -0
  206. data/maps/tortoise.ifm +0 -0
  207. data/maps/trinity.map +0 -0
  208. data/maps/vespers.map +0 -0
  209. data/maps/vgame.ifm +0 -0
  210. data/maps/wasp.map +0 -0
  211. data/maps/weather.ifm +0 -0
  212. data/maps/windhall.ifm +0 -0
  213. data/maps/worlds.map +0 -0
  214. data/maps/xtcontest.map +0 -0
  215. data/maps/zdungeon.map +0 -0
  216. data/maps/zebulon.ifm +0 -0
  217. data/maps/zerosum.map +0 -0
  218. metadata +226 -183
@@ -1,159 +1,159 @@
1
-
2
-
3
- #
4
- # Class used to display a room dialog box
5
- #
6
- class FXRoomDialogBox < FXDialogBox
7
-
8
- attr_writer :map
9
-
10
- def copy_to()
11
-
12
- @room.name = @name.text
13
- @room.objects = @objects.text
14
- @room.objects.gsub!(/[,\t]+/, "\n")
15
- @room.tasks = @tasks.text
16
- @room.darkness = (@darkness.checkState == 1)
17
- @room.desc = @desc.text
18
-
19
- @map.draw_room(@room)
20
- @map.update_roomlist
21
- end
22
-
23
-
24
- def copy_from(room)
25
- @room = room
26
- @name.text = room.name
27
- @darkness.checkState = room.darkness
28
- @objects.text = room.objects
29
- @tasks.text = room.tasks
30
- @desc.text = room.desc
31
-
32
- # Select text for quick editing if it uses default location name
33
- @name.setCursorPos room.name.size
34
- if room.name == MSG_NEW_LOCATION
35
- self.setFocus
36
- @name.selectAll
37
- @name.setFocus
38
- end
39
- if @map.navigation
40
- @name.disable
41
- @darkness.disable
42
- @objects.disable
43
- @tasks.disable
44
- @desc.disable
45
- else
46
- @name.enable
47
- @darkness.enable
48
- @objects.enable
49
- @tasks.enable
50
- @desc.enable
51
- end
52
-
53
- if @map.options['Location Tasks']
54
- @tasksFrame.show
55
- else
56
- @tasksFrame.hide
57
- end
58
- if @map.options['Location Description']
59
- @descFrame.show
60
- else
61
- @descFrame.hide
62
- end
63
-
64
- @desc.connect(SEL_CHANGED) { @room.desc = @desc.text }
65
-
66
- # Yuck! Fox's packer is absolutely oblivious to hiding/showing of
67
- # elements, so we need to force a dummy resize so the layout is
68
- # recalculated. But FUCK! This completely fucks up the focus.
69
- # Fox is a piece of ****. I **REALLY** need to go back to FLTK.
70
- ## self.resize(self.defaultWidth, self.defaultHeight)
71
- end
72
-
73
- def initialize(map, room, event = nil, modal = nil)
74
- pos = [40, 40]
75
- if event
76
- pos = [ event.last_x, event.last_y ]
77
- end
78
- maxW = map.window.width - 390
79
- maxH = map.window.height - 300
80
- pos[0] = maxW if pos[0] > maxW
81
- pos[1] = maxH if pos[1] > maxH
82
-
83
- if modal
84
- decor = DECOR_TITLE|DECOR_BORDER
85
- else
86
- decor = DECOR_TITLE|DECOR_BORDER|DECOR_CLOSE
87
- end
88
-
89
- super( map.window, BOX_ROOM_INFORMATION, decor, pos[0], pos[1], 0, 0 )
90
- mainFrame = FXVerticalFrame.new(self,
91
- FRAME_SUNKEN|FRAME_THICK|
92
- LAYOUT_FILL_X|LAYOUT_FILL_Y)
93
-
94
- frame = FXHorizontalFrame.new(mainFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
95
-
96
- FXLabel.new(frame, BOX_LOCATION, nil, 0, LAYOUT_FILL_X)
97
- @name = FXTextField.new(frame, 40, nil, 0, LAYOUT_FILL_ROW)
98
-
99
-
100
- all = FXHorizontalFrame.new(mainFrame,
101
- LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y)
102
-
103
- leftFrame = FXVerticalFrame.new(all,
104
- LAYOUT_SIDE_TOP|LAYOUT_SIDE_LEFT|
105
- LAYOUT_FILL_X|LAYOUT_FILL_Y)
106
-
107
- frame2 = FXHorizontalFrame.new(leftFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
108
- FXLabel.new(frame2, BOX_OBJECTS, nil, 0, LAYOUT_FILL_X)
109
- @darkness = FXCheckButton.new(frame2, BOX_DARKNESS, nil, 0,
110
- ICON_BEFORE_TEXT|LAYOUT_CENTER_X|
111
- LAYOUT_SIDE_RIGHT)
112
-
113
- @objects = FXText.new(leftFrame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
114
- @objects.visibleRows = 8
115
- @objects.visibleColumns = 40
116
-
117
- @tasksFrame = FXVerticalFrame.new(leftFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|
118
- LAYOUT_FILL_Y)
119
- FXLabel.new(@tasksFrame, BOX_TASKS, nil, 0, LAYOUT_FILL_X)
120
- @tasks = FXText.new(@tasksFrame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
121
- @tasks.visibleRows = 8
122
- @tasks.visibleColumns = 40
123
-
124
- ######## Add description
125
- @descFrame = FXVerticalFrame.new(all, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|
126
- LAYOUT_SIDE_RIGHT|LAYOUT_FILL_Y)
127
- FXLabel.new(@descFrame, BOX_DESCRIPTION, nil, 0, LAYOUT_FILL_X)
128
- @desc = FXText.new(@descFrame, nil, 0,
129
- LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
130
- @desc.visibleColumns = 70
131
- @desc.visibleRows = 18
132
-
133
- if modal
134
- buttons = FXHorizontalFrame.new(mainFrame,
135
- LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|
136
- PACK_UNIFORM_WIDTH)
137
- # Accept
138
- @ok = FXButton.new(buttons, BUTTON_ACCEPT, nil, self,
139
- FXDialogBox::ID_ACCEPT,
140
- FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
141
-
142
- # Cancel
143
- cmd = FXButton.new(buttons, BUTTON_CANCEL, nil, self,
144
- FXDialogBox::ID_CANCEL,
145
- FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
146
- else
147
- @name.connect(SEL_CHANGED) { copy_to() }
148
- @objects.connect(SEL_CHANGED) { copy_to()}
149
- @tasks.connect(SEL_CHANGED) { @room.tasks = @tasks.text }
150
- @darkness.connect(SEL_COMMAND) { copy_to() }
151
- @desc.connect(SEL_CHANGED) { @room.desc = @desc.text }
152
- end
153
-
154
- @map = map
155
-
156
- # We need to create the dialog box first, so we can use select text.
157
- create
158
- end
159
- end
1
+
2
+
3
+ #
4
+ # Class used to display a room dialog box
5
+ #
6
+ class FXRoomDialogBox < FXDialogBox
7
+
8
+ attr_writer :map
9
+
10
+ def copy_to()
11
+
12
+ @room.name = @name.text
13
+ @room.objects = @objects.text
14
+ @room.objects.gsub!(/[,\t]+/, "\n")
15
+ @room.tasks = @tasks.text
16
+ @room.darkness = (@darkness.checkState == 1)
17
+ @room.desc = @desc.text
18
+
19
+ @map.draw_room(@room)
20
+ @map.update_roomlist
21
+ end
22
+
23
+
24
+ def copy_from(room)
25
+ @room = room
26
+ @name.text = room.name
27
+ @darkness.checkState = room.darkness
28
+ @objects.text = room.objects
29
+ @tasks.text = room.tasks
30
+ @desc.text = room.desc
31
+
32
+ # Select text for quick editing if it uses default location name
33
+ @name.setCursorPos room.name.size
34
+ if room.name == MSG_NEW_LOCATION
35
+ self.setFocus
36
+ @name.selectAll
37
+ @name.setFocus
38
+ end
39
+ if @map.navigation
40
+ @name.disable
41
+ @darkness.disable
42
+ @objects.disable
43
+ @tasks.disable
44
+ @desc.disable
45
+ else
46
+ @name.enable
47
+ @darkness.enable
48
+ @objects.enable
49
+ @tasks.enable
50
+ @desc.enable
51
+ end
52
+
53
+ if @map.options['Location Tasks']
54
+ @tasksFrame.show
55
+ else
56
+ @tasksFrame.hide
57
+ end
58
+ if @map.options['Location Description']
59
+ @descFrame.show
60
+ else
61
+ @descFrame.hide
62
+ end
63
+
64
+ @desc.connect(SEL_CHANGED) { @room.desc = @desc.text }
65
+
66
+ # Yuck! Fox's packer is absolutely oblivious to hiding/showing of
67
+ # elements, so we need to force a dummy resize so the layout is
68
+ # recalculated. But FUCK! This completely fucks up the focus.
69
+ # Fox is a piece of ****. I **REALLY** need to go back to FLTK.
70
+ ## self.resize(self.defaultWidth, self.defaultHeight)
71
+ end
72
+
73
+ def initialize(map, room, event = nil, modal = nil)
74
+ pos = [40, 40]
75
+ if event
76
+ pos = [ event.last_x, event.last_y ]
77
+ end
78
+ maxW = map.window.width - 390
79
+ maxH = map.window.height - 300
80
+ pos[0] = maxW if pos[0] > maxW
81
+ pos[1] = maxH if pos[1] > maxH
82
+
83
+ if modal
84
+ decor = DECOR_TITLE|DECOR_BORDER
85
+ else
86
+ decor = DECOR_TITLE|DECOR_BORDER|DECOR_CLOSE
87
+ end
88
+
89
+ super( map.window, BOX_ROOM_INFORMATION, decor, pos[0], pos[1], 0, 0 )
90
+ mainFrame = FXVerticalFrame.new(self,
91
+ FRAME_SUNKEN|FRAME_THICK|
92
+ LAYOUT_FILL_X|LAYOUT_FILL_Y)
93
+
94
+ frame = FXHorizontalFrame.new(mainFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
95
+
96
+ FXLabel.new(frame, BOX_LOCATION, nil, 0, LAYOUT_FILL_X)
97
+ @name = FXTextField.new(frame, 40, nil, 0, LAYOUT_FILL_ROW)
98
+
99
+
100
+ all = FXHorizontalFrame.new(mainFrame,
101
+ LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y)
102
+
103
+ leftFrame = FXVerticalFrame.new(all,
104
+ LAYOUT_SIDE_TOP|LAYOUT_SIDE_LEFT|
105
+ LAYOUT_FILL_X|LAYOUT_FILL_Y)
106
+
107
+ frame2 = FXHorizontalFrame.new(leftFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
108
+ FXLabel.new(frame2, BOX_OBJECTS, nil, 0, LAYOUT_FILL_X)
109
+ @darkness = FXCheckButton.new(frame2, BOX_DARKNESS, nil, 0,
110
+ ICON_BEFORE_TEXT|LAYOUT_CENTER_X|
111
+ LAYOUT_SIDE_RIGHT)
112
+
113
+ @objects = FXText.new(leftFrame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
114
+ @objects.visibleRows = 8
115
+ @objects.visibleColumns = 40
116
+
117
+ @tasksFrame = FXVerticalFrame.new(leftFrame, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|
118
+ LAYOUT_FILL_Y)
119
+ FXLabel.new(@tasksFrame, BOX_TASKS, nil, 0, LAYOUT_FILL_X)
120
+ @tasks = FXText.new(@tasksFrame, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
121
+ @tasks.visibleRows = 8
122
+ @tasks.visibleColumns = 40
123
+
124
+ ######## Add description
125
+ @descFrame = FXVerticalFrame.new(all, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|
126
+ LAYOUT_SIDE_RIGHT|LAYOUT_FILL_Y)
127
+ FXLabel.new(@descFrame, BOX_DESCRIPTION, nil, 0, LAYOUT_FILL_X)
128
+ @desc = FXText.new(@descFrame, nil, 0,
129
+ LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP)
130
+ @desc.visibleColumns = 70
131
+ @desc.visibleRows = 18
132
+
133
+ if modal
134
+ buttons = FXHorizontalFrame.new(mainFrame,
135
+ LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|
136
+ PACK_UNIFORM_WIDTH)
137
+ # Accept
138
+ @ok = FXButton.new(buttons, BUTTON_ACCEPT, nil, self,
139
+ FXDialogBox::ID_ACCEPT,
140
+ FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
141
+
142
+ # Cancel
143
+ cmd = FXButton.new(buttons, BUTTON_CANCEL, nil, self,
144
+ FXDialogBox::ID_CANCEL,
145
+ FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y)
146
+ else
147
+ @name.connect(SEL_CHANGED) { copy_to() }
148
+ @objects.connect(SEL_CHANGED) { copy_to()}
149
+ @tasks.connect(SEL_CHANGED) { @room.tasks = @tasks.text }
150
+ @darkness.connect(SEL_COMMAND) { copy_to() }
151
+ @desc.connect(SEL_CHANGED) { @room.desc = @desc.text }
152
+ end
153
+
154
+ @map = map
155
+
156
+ # We need to create the dialog box first, so we can use select text.
157
+ create
158
+ end
159
+ end
@@ -1,95 +1,95 @@
1
-
2
- #
3
- # Class that lists all rooms in a map and allows you to jump to them
4
- #
5
- class FXRoomList < FXDialogBox
6
-
7
- def pick(sender, sel, ptr)
8
- item = @box.currentItem
9
- idx, r = @box.getItemData(item)
10
-
11
- @map.section = idx
12
- @map.clear_selection
13
- r.selected = true
14
- @map.center_view_on_room(r)
15
- @map.draw
16
- end
17
-
18
- def copy_from(map)
19
- @map = map
20
- sort
21
- end
22
-
23
- def sort
24
- item = @box.currentItem
25
- room = nil
26
- if item >= 0
27
- idx, room = @box.getItemData(item)
28
- end
29
-
30
- @box.clearItems
31
-
32
- rooms = []
33
- @map.sections.each_with_index { |s, idx|
34
- s.rooms.each { |r|
35
- rooms << [idx, r]
36
- }
37
- }
38
-
39
- dir = @box.header.getArrowDir(0)
40
- if dir != MAYBE
41
- rooms = rooms.sort_by { |r| r[0] }
42
- else
43
- dir = @box.header.getArrowDir(1)
44
- if dir != MAYBE
45
- rooms = rooms.sort_by { |r| r[1].name }
46
- end
47
- end
48
-
49
- if dir == Fox::TRUE
50
- rooms.reverse!
51
- end
52
-
53
- rooms.each { |r|
54
- item = "#{r[0] + 1}\t#{r[1].name}"
55
- @box.appendItem(item, nil, nil, r)
56
- }
57
-
58
- if room
59
- rooms.each_with_index { |r, idx|
60
- if r[1] == room
61
- @box.currentItem = idx
62
- break
63
- end
64
- }
65
- end
66
- end
67
-
68
- def initialize(map)
69
- super(map.window.parent, BOX_LOCATIONS, DECOR_ALL, 40, 40, 300, 400)
70
-
71
- @box = FXIconList.new(self, nil, 0,
72
- ICONLIST_BROWSESELECT|
73
- LAYOUT_FILL_X|LAYOUT_FILL_Y)
74
- @box.appendHeader(BOX_SECTION, nil, 60)
75
- @box.appendHeader(BOX_NAME, nil, 200)
76
- @box.header.connect(SEL_COMMAND) { |sender, sel, which|
77
- if @box.header.arrowUp?(which)
78
- dir = MAYBE
79
- elsif @box.header.arrowDown?(which)
80
- dir = TRUE
81
- else
82
- dir = FALSE
83
- end
84
- @box.header.setArrowDir(which, dir)
85
- @box.header.setArrowDir(which ^ 1, MAYBE)
86
- sort
87
- }
88
-
89
- @box.connect(SEL_COMMAND, method(:pick))
90
-
91
- create
92
- copy_from(map)
93
- end
94
-
95
- end
1
+
2
+ #
3
+ # Class that lists all rooms in a map and allows you to jump to them
4
+ #
5
+ class FXRoomList < FXDialogBox
6
+
7
+ def pick(sender, sel, ptr)
8
+ item = @box.currentItem
9
+ idx, r = @box.getItemData(item)
10
+
11
+ @map.section = idx
12
+ @map.clear_selection
13
+ r.selected = true
14
+ @map.center_view_on_room(r)
15
+ @map.draw
16
+ end
17
+
18
+ def copy_from(map)
19
+ @map = map
20
+ sort
21
+ end
22
+
23
+ def sort
24
+ item = @box.currentItem
25
+ room = nil
26
+ if item >= 0
27
+ idx, room = @box.getItemData(item)
28
+ end
29
+
30
+ @box.clearItems
31
+
32
+ rooms = []
33
+ @map.sections.each_with_index { |s, idx|
34
+ s.rooms.each { |r|
35
+ rooms << [idx, r]
36
+ }
37
+ }
38
+
39
+ dir = @box.header.getArrowDir(0)
40
+ if dir != MAYBE
41
+ rooms = rooms.sort_by { |r| r[0] }
42
+ else
43
+ dir = @box.header.getArrowDir(1)
44
+ if dir != MAYBE
45
+ rooms = rooms.sort_by { |r| r[1].name }
46
+ end
47
+ end
48
+
49
+ if dir == Fox::TRUE
50
+ rooms.reverse!
51
+ end
52
+
53
+ rooms.each { |r|
54
+ item = "#{r[0] + 1}\t#{r[1].name}"
55
+ @box.appendItem(item, nil, nil, r)
56
+ }
57
+
58
+ if room
59
+ rooms.each_with_index { |r, idx|
60
+ if r[1] == room
61
+ @box.currentItem = idx
62
+ break
63
+ end
64
+ }
65
+ end
66
+ end
67
+
68
+ def initialize(map)
69
+ super(map.window.parent, BOX_LOCATIONS, DECOR_ALL, 40, 40, 300, 400)
70
+
71
+ @box = FXIconList.new(self, nil, 0,
72
+ ICONLIST_BROWSESELECT|
73
+ LAYOUT_FILL_X|LAYOUT_FILL_Y)
74
+ @box.appendHeader(BOX_SECTION, nil, 60)
75
+ @box.appendHeader(BOX_NAME, nil, 200)
76
+ @box.header.connect(SEL_COMMAND) { |sender, sel, which|
77
+ if @box.header.arrowUp?(which)
78
+ dir = MAYBE
79
+ elsif @box.header.arrowDown?(which)
80
+ dir = TRUE
81
+ else
82
+ dir = FALSE
83
+ end
84
+ @box.header.setArrowDir(which, dir)
85
+ @box.header.setArrowDir(which ^ 1, MAYBE)
86
+ sort
87
+ }
88
+
89
+ @box.connect(SEL_COMMAND, method(:pick))
90
+
91
+ create
92
+ copy_from(map)
93
+ end
94
+
95
+ end