source: tools/area_editor.py@ 225:c8ead015c48e

Last change on this file since 225:c8ead015c48e was 225:c8ead015c48e, checked in by Neil Muller <drnlmuller@…>, 8 years ago

Display list of objects to edit / delete

  • Property exe set to *
File size: 21.3 KB
RevLine 
[71]1#!/usr/bin/env python
2
[51]3# The basic area editor
4#
5# To edit an existing level, use
6# editor levelname
7#
8# To create a new level:
9#
10# editor levelname <xsize> <ysiz>
11# (size specified in pixels
12#
13
[71]14import os
15import sys
16
[51]17import pygame
18import pygame.locals as pgl
19
[152]20sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
21
[153]22import pymunk
23
[108]24from albow.root import RootWidget
25from albow.widget import Widget
[198]26from albow.controls import Button, Label, CheckBox
[225]27from albow.dialogs import alert, Dialog
28from albow.layout import Row
29from albow.table_view import TableView, TableColumn
[108]30
[199]31from nagslang.options import parse_args
[109]32from nagslang.constants import SCREEN
[204]33from nagslang.level import Level, POLY_COLORS, LINE_COLOR
[199]34from nagslang.enemies import Enemy
[51]35
36
[108]37# layout constants
38MENU_BUTTON_HEIGHT = 35
[115]39MENU_PAD = 6
40MENU_HALF_PAD = MENU_PAD // 2
41MENU_LEFT = SCREEN[0] + MENU_HALF_PAD
42MENU_WIDTH = 200 - MENU_PAD
[108]43
[220]44BUTTON_RECT = pygame.rect.Rect(0, 0, MENU_WIDTH, MENU_BUTTON_HEIGHT)
45CHECK_RECT = pygame.rect.Rect(0, 0, MENU_BUTTON_HEIGHT // 2,
46 MENU_BUTTON_HEIGHT // 2)
47
[108]48
[51]49class EditorLevel(Level):
50
51 def __init__(self, name, x=800, y=600):
52 super(EditorLevel, self).__init__(name)
53 self.x = x
54 self.y = y
55
56 def round_point(self, pos):
57 return (10 * (pos[0] // 10), 10 * (pos[1] // 10))
58
59 def point_to_pymunk(self, pos):
60 # inverse of point_to_pygame
61 # (this is also the same as point_to_pygame, but a additional
62 # function for sanity later in pyweek).
63 return (pos[0], self.y - pos[1])
64
65 def add_point(self, poly_index, pos):
66 self.polygons.setdefault(poly_index, [])
67 if not self.polygons[poly_index]:
[99]68 point = self.point_to_pymunk(self.round_point(pos))
69 self.polygons[poly_index].append(point)
[51]70 else:
[205]71 add_pos = self.fix_poly_angle(poly_index, pos)
[51]72 self.polygons[poly_index].append(add_pos)
73
[205]74 def _fix_angle(self, point1, pos):
[51]75 # We want the line (point1 to pos) to be an angle of
76 # 0, 45, 90, 135, 180, 225, 270, 305
77 # However, we only need to consider half the circle
78 # This is a hack to approximate the right thing
79 pos0 = (pos[0], point1[1])
80 pos90 = (point1[0], pos[1])
81 dist = max(abs(point1[0] - pos[0]), abs(point1[1] - pos[1]))
82 pos45 = (point1[0] + dist, point1[1] + dist)
83 pos135 = (point1[0] + dist, point1[1] - dist)
84 pos225 = (point1[0] - dist, point1[1] - dist)
85 pos305 = (point1[0] - dist, point1[1] + dist)
86 min_dist = 9999999
87 new_pos = point1
88 for cand in [pos0, pos90, pos45, pos135, pos225, pos305]:
89 dist = (pos[0] - cand[0]) ** 2 + (pos[1] - cand[1]) ** 2
90 if dist < min_dist:
91 new_pos = cand
92 min_dist = dist
93 return self.point_to_pymunk(new_pos)
94
[205]95 def fix_line_angle(self, start_pos, pos):
96 start_pos = self.round_point(start_pos)
97 pos = self.round_point(pos)
98 return self._fix_angle(start_pos, pos)
99
100 def fix_poly_angle(self, index, pos):
101 # Last point
102 point1 = self.point_to_pygame(self.polygons[index][-1])
103 pos = self.round_point(pos)
104 return self._fix_angle(point1, pos)
105
[51]106 def delete_point(self, index):
107 if index in self.polygons and len(self.polygons[index]) > 0:
108 self.polygons[index].pop()
109
[135]110 def close_poly(self, index):
111 """Attempts to close the current polygon.
112
113 We allow a small additional step to close the polygon, but
114 it's limited as it's a magic point addition"""
115 if len(self.polygons[index]) < 2:
116 # Too small
117 return False
118 first = self.polygons[index][0]
[205]119 if self.fix_poly_angle(index, self.point_to_pygame(first)) == first:
[135]120 self.add_point(index, self.point_to_pygame(first))
121 return True
122 candidates = [(first[0] + 10 * i, first[1]) for
123 i in (-3, -2, -1, 1, 2, 3)]
124 candidates.extend([(first[0], first[1] + 10 * i) for
125 i in (-3, -2, -1, 1, 2, 3)])
126 candidates.extend([(first[0] + 10 * i, first[1] + 10 * i) for
127 i in (-3, -2, -1, 1, 2, 3)])
128 candidates.extend([(first[0] + 10 * i, first[1] - 10 * i) for
129 i in (-3, -2, -1, 1, 2, 3)])
130 min_dist = 99999
131 poss = None
132 for cand in candidates:
[205]133 if self.fix_poly_angle(index, self.point_to_pygame(cand)) == cand:
[135]134 dist = (first[0] - cand[0]) ** 2 + (first[1] - cand[1]) ** 2
135 if dist < min_dist:
136 poss = cand
137 if poss is not None:
138 self.add_point(index, self.point_to_pygame(poss))
139 self.add_point(index, self.point_to_pygame(first))
140 return True
141 return False
142
[205]143 def add_line(self, start_pos, end_pos):
144 endpoint = self.fix_line_angle(start_pos, end_pos)
145 startpoint = self.point_to_pymunk(self.round_point(start_pos))
146 self.lines.append([startpoint, endpoint])
147
148 def draw(self, mouse_pos, mouse_poly, filled, draw_cand_line, start_pos):
[51]149 self._draw_background(True)
150 # Draw polygons as needed for the editor
[96]151 if filled:
152 self._draw_exterior(True)
[51]153 for index, polygon in self.polygons.items():
154 color = POLY_COLORS[index]
155 if len(polygon) > 1:
156 pointlist = [self.point_to_pygame(p) for p in polygon]
157 pygame.draw.lines(self._surface, color, False, pointlist, 2)
158 if index == mouse_poly and mouse_pos:
[205]159 endpoint = self.fix_poly_angle(index, mouse_pos)
[51]160 pygame.draw.line(self._surface, color,
[99]161 self.point_to_pygame(polygon[-1]),
162 self.point_to_pygame(endpoint))
[204]163 for line in self.lines:
164 pointlist = [self.point_to_pygame(p) for p in line]
165 pygame.draw.lines(self._surface, LINE_COLOR, False, pointlist, 2)
[205]166 if draw_cand_line and start_pos and mouse_pos:
167 endpoint = self.fix_line_angle(start_pos, mouse_pos)
168 pointlist = [self.round_point(start_pos),
[206]169 self.point_to_pygame(endpoint)]
[205]170 pygame.draw.lines(self._surface, LINE_COLOR, False, pointlist, 1)
[199]171 return self._surface.copy()
[51]172
[109]173
[225]174class ObjectTable(TableView):
175
176 columns = [TableColumn("Object", 690, 'l', '%r')]
177
178 def __init__(self, data):
179 super(ObjectTable, self).__init__(height=450)
180 self.data = data
181 self.selected_row = -1
182
183 def num_rows(self):
184 return len(self.data)
185
186 def row_data(self, i):
187 data = self.data[i]
188 if 'name' in data:
189 return ('%s (%s)' % (data['classname'], data['name']), )
190 return (data['classname'], )
191
192 def row_is_selected(self, i):
193 return self.selected_row == i
194
195 def click_row(self, i, ev):
196 self.selected_row = i
197
198 def get_selection(self):
199 if self.selected_row >= 0:
200 return self.data[self.selected_row]
201 return None
202
203
[108]204class LevelWidget(Widget):
[51]205
[108]206 def __init__(self, level):
207 super(LevelWidget, self).__init__(pygame.rect.Rect(0, 0,
[109]208 SCREEN[0], SCREEN[1]))
[51]209 self.level = level
210 self.pos = (0, 0)
[108]211 self.filled_mode = False
[51]212 self.mouse_pos = None
[108]213 self.cur_poly = None
[167]214 self._mouse_drag = False
[199]215 self._draw_objects = False
216 self._draw_enemies = False
[204]217 self._draw_lines = False
[205]218 self._start_pos = None
[51]219
[108]220 def _level_coordinates(self, pos):
221 # Move positions to level values
222 if not pos:
223 return (0, 0)
224 return pos[0] + self.pos[0], pos[1] + self.pos[1]
225
226 def _move_view(self, offset):
[51]227 new_pos = [self.pos[0] + offset[0], self.pos[1] + offset[1]]
228 if new_pos[0] < 0:
229 new_pos[0] = self.pos[0]
230 elif new_pos[0] > self.level.x - SCREEN[0]:
231 new_pos[0] = self.pos[0]
232 if new_pos[1] < 0:
233 new_pos[1] = self.pos[1]
234 elif new_pos[1] > self.level.y - SCREEN[1]:
235 new_pos[1] = self.pos[1]
236 self.pos = tuple(new_pos)
237
[199]238 def set_objects(self, value):
239 if self._draw_objects != value:
240 self._draw_objects = value
241 self.invalidate()
242
243 def set_enemies(self, value):
244 if self._draw_enemies != value:
245 self._draw_enemies = value
246 self.invalidate()
247
[108]248 def draw(self, surface):
[51]249 if (self.cur_poly is not None and self.cur_poly in self.level.polygons
250 and len(self.level.polygons[self.cur_poly])):
251 # We have an active polygon
252 mouse_pos = self._level_coordinates(self.mouse_pos)
[205]253 elif self._draw_lines:
254 # Interior wall mode
255 mouse_pos = self._level_coordinates(self.mouse_pos)
[51]256 else:
257 mouse_pos = None
[205]258 level_surface = level.draw(mouse_pos, self.cur_poly, self.filled_mode,
[206]259 self._draw_lines, self._start_pos)
[199]260 if self._draw_objects:
261 for thing in self.level.drawables:
262 if not isinstance(thing, Enemy):
263 thing.render(level_surface)
264 if self._draw_enemies:
265 for thing in self.level.drawables:
266 if isinstance(thing, Enemy):
267 thing.render(level_surface)
268 surface_area = pygame.rect.Rect(self.pos, SCREEN)
269 surface.blit(level_surface, (0, 0), surface_area)
[51]270
[115]271 def change_poly(self, new_poly):
272 self.cur_poly = new_poly
[204]273 self._draw_lines = False
[115]274 if self.cur_poly is not None:
275 self.filled_mode = False
276
[204]277 def line_mode(self):
278 self.cur_poly = None
279 self._draw_lines = True
280 self.filled_mode = False
[205]281 self._start_pos = None
[204]282
[108]283 def key_down(self, ev):
284 if ev.key == pgl.K_LEFT:
285 self._move_view((-10, 0))
286 elif ev.key == pgl.K_RIGHT:
287 self._move_view((10, 0))
288 elif ev.key == pgl.K_UP:
289 self._move_view((0, -10))
290 elif ev.key == pgl.K_DOWN:
291 self._move_view((0, 10))
[115]292 elif ev.key in (pgl.K_1, pgl.K_2, pgl.K_3, pgl.K_4, pgl.K_5, pgl.K_6):
293 self.change_poly(ev.key - pgl.K_0)
[108]294 elif ev.key == pgl.K_0:
[115]295 self.change_poly(None)
[108]296 elif ev.key == pgl.K_d and self.cur_poly:
297 self.level.delete_point(self.cur_poly)
298 elif ev.key == pgl.K_f:
[117]299 self.set_filled()
[135]300 elif ev.key == pgl.K_c:
301 self.close_poly()
[117]302
303 def set_filled(self):
[165]304 closed, _ = self.level.all_closed()
305 if closed:
[117]306 self.cur_poly = None
307 self.filled_mode = True
[204]308 self._draw_lines = False
[117]309 else:
[165]310 alert('Not all polygons closed, so not filling')
[108]311
[109]312 def mouse_move(self, ev):
313 old_pos = self.mouse_pos
314 self.mouse_pos = ev.pos
[205]315 if old_pos != self.mouse_pos and (self.cur_poly or self._draw_lines):
[109]316 self.invalidate()
317
[167]318 def mouse_drag(self, ev):
319 if self._mouse_drag:
320 old_pos = self.mouse_pos
321 self.mouse_pos = ev.pos
322 diff = (-self.mouse_pos[0] + old_pos[0],
323 -self.mouse_pos[1] + old_pos[1])
324 self._move_view(diff)
325 self.invalidate()
326
[109]327 def mouse_down(self, ev):
[184]328 if ev.button == 1:
[204]329 if self._draw_lines:
[205]330 if self._start_pos is None:
331 self._start_pos = ev.pos
332 else:
333 self.level.add_line(self._start_pos, ev.pos)
334 self._start_pos = None
[204]335 else:
336 print "Click: %r" % (
337 self.level.point_to_pymunk(
338 self._level_coordinates(ev.pos)),)
[157]339 if ev.button == 4: # Scroll up
340 self._move_view((0, -10))
341 elif ev.button == 5: # Scroll down
342 self._move_view((0, 10))
343 elif ev.button == 6: # Scroll left
344 self._move_view((-10, 0))
345 elif ev.button == 7: # Scroll right
346 self._move_view((10, 0))
[167]347 elif self.cur_poly and ev.button == 1:
[109]348 # Add a point
349 self.level.add_point(self.cur_poly,
350 self._level_coordinates(ev.pos))
[167]351 elif ev.button == 3:
352 self._mouse_drag = True
353
354 def mouse_up(self, ev):
355 if ev.button == 3:
356 self._mouse_drag = False
[108]357
[135]358 def close_poly(self):
359 if self.cur_poly is None:
360 return
361 if self.level.close_poly(self.cur_poly):
362 alert("Successfully closed the polygon")
363 self.change_poly(None)
364 else:
365 alert("Failed to close the polygon")
366
[225]367 def _make_edit_dialog(self, entries):
368 # Dialog to hold the editor
369 edit_box = Dialog()
370 edit_box.rect = pygame.rect.Rect(0, 0, 700, 500)
371 table = ObjectTable(entries)
372 edit_box.add(table)
373 buttons = []
374 for text in ['OK', 'Delete', 'Cancel']:
375 but = Button(text, action=lambda x=text: edit_box.dismiss(x))
376 buttons.append(but)
377 row = Row(buttons)
378 row.rect = pygame.rect.Rect(0, 450, 700, 50)
379 edit_box.add(row)
380 return edit_box
381
382 def edit_objects(self):
383 edit_box = self._make_edit_dialog(self.level._game_objects)
384 res = edit_box.present()
385 if res == 'OK':
386 # Edit object stuff goes here
387 pass
388 elif res == 'Delete':
389 pass
390
391 def edit_enemies(self):
392 edit_box = self._make_edit_dialog(self.level._enemies)
393 res = edit_box.present()
394 if res == 'OK':
395 # Edit object stuff goes here
396 pass
397 elif res == 'Delete':
398 pass
399
[108]400
[115]401class PolyButton(Button):
402 """Button for coosing the correct polygon"""
403
404 def __init__(self, index, level_widget):
405 if index is not None:
406 text = "Draw: %s" % index
407 else:
408 text = 'Exit Draw Mode'
409 super(PolyButton, self).__init__(text)
410 self.index = index
411 self.level_widget = level_widget
412
413 def action(self):
414 self.level_widget.change_poly(self.index)
415
416
[108]417class EditorApp(RootWidget):
418
419 def __init__(self, level, surface):
420 super(EditorApp, self).__init__(surface)
421 self.level = level
422 self.level_widget = LevelWidget(self.level)
423 self.add(self.level_widget)
424
[220]425 self._dMenus = {}
426
427 self._make_draw_menu()
428 self._make_objects_menu()
429
430 self._menu_mode = 'drawing'
431 self._populate_menu()
432
433 def _make_draw_menu(self):
434 widgets = []
435
[115]436 # Add poly buttons
437 y = 15
438 for poly in range(1, 7):
439 but = PolyButton(poly, self.level_widget)
440 but.rect = pygame.rect.Rect(0, 0, MENU_WIDTH // 2 - MENU_PAD,
441 MENU_BUTTON_HEIGHT)
442 if poly % 2:
443 but.rect.move_ip(MENU_LEFT, y)
444 else:
445 but.rect.move_ip(MENU_LEFT + MENU_WIDTH // 2 - MENU_HALF_PAD,
446 y)
447 y += MENU_BUTTON_HEIGHT + MENU_PAD
[220]448 widgets.append(but)
[198]449
[115]450 end_poly_but = PolyButton(None, self.level_widget)
[220]451 end_poly_but.rect = BUTTON_RECT.copy()
[115]452 end_poly_but.rect.move_ip(MENU_LEFT, y)
[220]453 widgets.append(end_poly_but)
[115]454 y += MENU_BUTTON_HEIGHT + MENU_PAD
455
[204]456 draw_line = Button("Draw interior wall", self.level_widget.line_mode)
[220]457 draw_line.rect = BUTTON_RECT.copy()
[204]458 draw_line.rect.move_ip(MENU_LEFT, y)
[220]459 widgets.append(draw_line)
[204]460 y += MENU_BUTTON_HEIGHT + MENU_PAD
461
[117]462 fill_but = Button('Fill exterior', action=self.level_widget.set_filled)
[220]463 fill_but.rect = BUTTON_RECT.copy()
[117]464 fill_but.rect.move_ip(MENU_LEFT, y)
[220]465 widgets.append(fill_but)
[117]466 y += MENU_BUTTON_HEIGHT + MENU_PAD
467
[116]468 save_but = Button('Save Level', action=self.save)
[220]469 save_but.rect = BUTTON_RECT.copy()
[116]470 save_but.rect.move_ip(MENU_LEFT, y)
[220]471 widgets.append(save_but)
[116]472 y += MENU_BUTTON_HEIGHT + MENU_PAD
473
[135]474 close_poly_but = Button('Close Polygon',
475 action=self.level_widget.close_poly)
[220]476 close_poly_but.rect = BUTTON_RECT.copy()
[135]477 close_poly_but.rect.move_ip(MENU_LEFT, y)
[220]478 widgets.append(close_poly_but)
[135]479 y += MENU_BUTTON_HEIGHT + MENU_PAD
480
[198]481 white = pygame.color.Color("white")
482 self.show_objs = CheckBox(fg_color=white)
[220]483 self.show_objs.rect = CHECK_RECT.copy()
[198]484 self.show_objs.rect.move_ip(MENU_LEFT, y)
485 label = Label("Show Objects", fg_color=white)
486 label.rect.move_ip(MENU_LEFT + MENU_BUTTON_HEIGHT // 2 + MENU_PAD, y)
[220]487 widgets.append(self.show_objs)
488 widgets.append(label)
[198]489 y += label.rect.height + MENU_PAD
490
491 self.show_enemies = CheckBox(fg_color=white)
[220]492 self.show_enemies.rect = CHECK_RECT.copy()
[198]493 self.show_enemies.rect.move_ip(MENU_LEFT, y)
494 label = Label("Show enemy start pos", fg_color=white)
495 label.rect.move_ip(MENU_LEFT + MENU_BUTTON_HEIGHT // 2 + MENU_PAD, y)
[220]496 widgets.append(self.show_enemies)
497 widgets.append(label)
[198]498 y += label.rect.height + MENU_PAD
499
[220]500 switch_but = Button('Switch to Objects', action=self.switch_to_objects)
501 switch_but.rect = BUTTON_RECT.copy()
502 switch_but.rect.move_ip(MENU_LEFT, y)
503 widgets.append(switch_but)
504 y += switch_but.rect.height + MENU_PAD
505
[108]506 quit_but = Button('Quit', action=self.quit)
[220]507 quit_but.rect = BUTTON_RECT.copy()
[115]508 quit_but.rect.move_ip(MENU_LEFT, y)
[220]509 widgets.append(quit_but)
510
511 self._dMenus['drawing'] = widgets
512
513 def _make_objects_menu(self):
514 widgets = []
515
516 # Add poly buttons
517 y = 15
518
[225]519 edit_objs_but = Button('Edit Objects',
520 action=self.level_widget.edit_objects)
521 edit_objs_but.rect = BUTTON_RECT.copy()
522 edit_objs_but.rect.move_ip(MENU_LEFT, y)
523 widgets.append(edit_objs_but)
524 y += MENU_BUTTON_HEIGHT + MENU_PAD
525
526 edir_enemies_but = Button('Edit Enemies',
527 action=self.level_widget.edit_enemies)
528 edir_enemies_but.rect = BUTTON_RECT.copy()
529 edir_enemies_but.rect.move_ip(MENU_LEFT, y)
530 widgets.append(edir_enemies_but)
531 y += MENU_BUTTON_HEIGHT + MENU_PAD
532
[220]533 save_but = Button('Save Level', action=self.save)
534 save_but.rect = BUTTON_RECT.copy()
535 save_but.rect.move_ip(MENU_LEFT, y)
536 widgets.append(save_but)
537 y += MENU_BUTTON_HEIGHT + MENU_PAD
538
539 switch_but = Button('Switch to Drawing', action=self.switch_to_draw)
540 switch_but.rect = BUTTON_RECT.copy()
541 switch_but.rect.move_ip(MENU_LEFT, y)
542 widgets.append(switch_but)
543 y += switch_but.rect.height + MENU_PAD
544
545 quit_but = Button('Quit', action=self.quit)
546 quit_but.rect = BUTTON_RECT.copy()
547 quit_but.rect.move_ip(MENU_LEFT, y)
548 widgets.append(quit_but)
549
550 self._dMenus['objects'] = widgets
[108]551
552 def key_down(self, ev):
553 if ev.key == pgl.K_ESCAPE:
554 self.quit()
[116]555 elif ev.key == pgl.K_s:
556 self.save()
[108]557 else:
558 self.level_widget.key_down(ev)
[51]559
[116]560 def save(self):
[122]561 closed, messages = self.level.all_closed()
562 if closed:
563 self.level.save()
564 # display success
565 alert("Level %s saved successfully." % self.level.name)
566 else:
567 # display errors
568 alert("Failed to save level.\n\n%s" % '\n'.join(messages))
[116]569
[220]570 def switch_to_draw(self):
571 if self._menu_mode != 'drawing':
572 self._clear_menu()
573 self._menu_mode = 'drawing'
574 self._populate_menu()
575
576 def switch_to_objects(self):
577 if self._menu_mode != 'objects':
578 self._clear_menu()
579 self._menu_mode = 'objects'
580 self._populate_menu()
581
582 def _clear_menu(self):
583 for widget in self._dMenus[self._menu_mode]:
584 self.remove(widget)
585
586 def _populate_menu(self):
587 self.level_widget.change_poly(None)
588 for widget in self._dMenus[self._menu_mode]:
589 self.add(widget)
590 self.invalidate()
591
[109]592 def mouse_move(self, ev):
593 self.level_widget.mouse_move(ev)
594
[199]595 def draw(self, surface):
596 # Update checkbox state
[223]597 if self._menu_mode == 'drawing':
598 self.level_widget.set_objects(self.show_objs.value)
599 self.level_widget.set_enemies(self.show_enemies.value)
600 else:
601 self.level_widget.set_objects(True)
602 self.level_widget.set_enemies(True)
[199]603 super(EditorApp, self).draw(surface)
604
[51]605
606if __name__ == "__main__":
[195]607 if len(sys.argv) not in [2, 4]:
[51]608 print 'Please supply a levelname or levelname and level size'
609 sys.exit()
[199]610 # Need to ensure we have defaults for rendering
611 parse_args([])
[51]612 pygame.display.init()
613 pygame.font.init()
[108]614 pygame.display.set_mode((SCREEN[0] + MENU_WIDTH, SCREEN[1]),
[109]615 pgl.SWSURFACE)
[195]616 if len(sys.argv) == 2:
617 level = EditorLevel(sys.argv[1])
618 level.load(pymunk.Space())
619 elif len(sys.argv) == 4:
620 level = EditorLevel(sys.argv[1], int(sys.argv[2]), int(sys.argv[3]))
[51]621 pygame.display.set_caption('Nagslang Area Editor')
[108]622 pygame.key.set_repeat(200, 100)
623 app = EditorApp(level, pygame.display.get_surface())
624 app.run()
Note: See TracBrowser for help on using the repository browser.