Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/FortuneMaker.activity
diff options
context:
space:
mode:
authorJustin Lewis <jtl1728@rit.edu>2010-01-28 21:40:06 (GMT)
committer Justin Lewis <jtl1728@rit.edu>2010-01-28 21:40:06 (GMT)
commit6032611aa57f44ca17e3d10ce883d3fb77bd22f9 (patch)
tree91b3f81ea8c0386c0f72d93d71b69a18e834bf50 /FortuneMaker.activity
parent70ff3370b5ad091532a26c7303462b6602c4d92b (diff)
Added enemy text and color coded room type.
Diffstat (limited to 'FortuneMaker.activity')
-rw-r--r--FortuneMaker.activity/Room.py23
-rw-r--r--FortuneMaker.activity/constants.py6
2 files changed, 20 insertions, 9 deletions
diff --git a/FortuneMaker.activity/Room.py b/FortuneMaker.activity/Room.py
index e09be8f..e787a25 100644
--- a/FortuneMaker.activity/Room.py
+++ b/FortuneMaker.activity/Room.py
@@ -1,9 +1,11 @@
from constants import (
DOOR_ORDER, DOOR_INDEX, DOOR_FLAGS, SPEC_FLAGS,
- ENEM_INDEX, ITEM_INDEX, ITEM_FLAGS, DOOR_COLOR
+ ENEM_INDEX, ITEM_INDEX, ITEM_FLAGS, DOOR_COLOR,
+ SPEC_COLOR
)
import gtk
+import pango
class Room:
def __init__(self, x = -1, y = -1, str=None):
@@ -158,15 +160,12 @@ class Room:
door_thick = 5
third_w = w / 3
third_h = h / 3
- #xgc.set_rgb_fg_color(gtk.gdk.color_parse("yellow"))
- #widget.window.draw_arc(xgc, True, 200, 100, 200, 200, 0, 360*64)
# Fill in if room
if self.not_empty_room():
- xgc.set_rgb_fg_color(gtk.gdk.color_parse("#6666CC"))
+ xgc.set_rgb_fg_color(gtk.gdk.color_parse(SPEC_COLOR[self.special]))
widget.window.draw_rectangle(xgc, True, 1, 1, w-2, h-2)
-
# Draw Border
xgc.set_rgb_fg_color(gtk.gdk.color_parse("#000000"))
widget.window.draw_rectangle(xgc, False, 1, 1, w-2, h-2)
@@ -187,11 +186,17 @@ class Room:
xgc.set_rgb_fg_color(gtk.gdk.color_parse(DOOR_COLOR[self.doors['W'][1]]))
widget.window.draw_rectangle(xgc, True, 1, third_h, door_thick, third_h)
+ room_text = ""
+
+ for enemy in self.enemy:
+ if enemy != '0':
+ room_text += ENEM_INDEX[enemy] + "\n"
- #widget.window.draw_arc(xgc, True, 240, 145, 30, 40, 0, 360*64)
- #widget.window.draw_arc(xgc, True, 330, 145, 30, 40, 0, 360*64)
- #xgc.line_width = 6
- #widget.window.draw_arc(xgc, False, 240, 150, 120, 110, 200*64, 140*64)
+ xgc.set_rgb_fg_color(gtk.gdk.color_parse("#000000"))
+ font_desc = pango.FontDescription('Serif 4')
+ layout = widget.create_pango_layout( room_text )
+ layout.set_font_description(font_desc)
+ widget.window.draw_layout(xgc, 7, 7, layout)
drawing_area = gtk.DrawingArea()
drawing_area.set_size_request(100, 100)
diff --git a/FortuneMaker.activity/constants.py b/FortuneMaker.activity/constants.py
index ad9b676..c1f16c0 100644
--- a/FortuneMaker.activity/constants.py
+++ b/FortuneMaker.activity/constants.py
@@ -32,6 +32,12 @@ SPEC_FLAGS = {
'P':_('Puzzle')
}
+SPEC_COLOR = {
+ '0':"#6666CC",
+ 'M':'#666633',
+ 'P':'#CC6666'
+}
+
ENEM_INDEX = {
'0':_('None'),
'1':_('Wizard Adept'),