From 5ea395ba29c9debb2095e5277ac1d04092ffc3a2 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sun, 11 Oct 2009 17:59:57 +0000 Subject: overflowerror alert --- diff --git a/talogo.py b/talogo.py index 5008ea2..f0ecc65 100644 --- a/talogo.py +++ b/talogo.py @@ -627,9 +627,11 @@ def show_picture(lc, media, x, y, w, h): raise logoerror("#nomedia") # check to see if it is a movie print dsobject.file_path + print "object has file suffix of: " + dsobject.file_path[-4:] if dsobject.file_path[-4:] == '.ogv' or \ dsobject.file_path[-4:] == '.vob' or \ dsobject.file_path[-4:] == '.mp4' or \ + dsobject.file_path[-4:] == '.wmv' or \ dsobject.file_path[-4:] == '.mov': print "playing movie x:" + str(x) + " y:" + str(y) + " w:" \ + str(w) + " h:" + str(h) @@ -1012,6 +1014,8 @@ def kbinput(lc): lc.tw.keypress = "" def showlabel(lc,label): + print "showlabel: " + str(label) + print lc if label=='#nostack': shp = 'nostack' label='' @@ -1033,8 +1037,12 @@ def showlabel(lc,label): elif label=='#syntaxerror': shp = 'syntaxerror' label='' + elif label=='#overflowerror': + shp = 'overflowerror' + label='' else: shp = 'status' + print shp setshape(lc.tw.status_spr, lc.tw.status_shapes[shp]) setlabel(lc.tw.status_spr, label) setlayer(lc.tw.status_spr, 710) diff --git a/tasetup.py b/tasetup.py index dbc86a0..d2a1de1 100644 --- a/tasetup.py +++ b/tasetup.py @@ -283,13 +283,14 @@ def setup_misc(tw): tw.status_shapes['emptybox'] = load_image(tw.path, '', 'emptybox') tw.status_shapes['nomedia'] = load_image(tw.path, '', 'nomedia') tw.status_shapes['nocode'] = load_image(tw.path, '', 'nocode') - tw.status_shapes['overflowerror'] = load_image, '', 'overflowerror') + tw.status_shapes['overflowerror'] = load_image(tw.path, '', 'overflowerror') tw.status_shapes['syntaxerror'] = load_image(tw.path, '', 'syntaxerror') tw.status_spr = sprNew(tw,0,(tw.height-175), \ tw.status_shapes['status'],True) tw.status_spr.type = 'status' setlayer(tw.status_spr,400) # everything should be loaded at this point + # print tw.status_shapes tw.loaded = True def setup_selector(tw,name,y,blockdescriptions): diff --git a/tawindow.py b/tawindow.py index a5f9658..9cbb9db 100644 --- a/tawindow.py +++ b/tawindow.py @@ -164,8 +164,8 @@ def button_press(tw, mask, x, y, verbose=False): tw.block_operation = 'click' if tw.selected_block!=None: unselect(tw) - # hide status block - setlayer(tw.status_spr,400) + else: + setlayer(tw.status_spr,400) spr = findsprite(tw,(x,y)) tw.dx = 0 tw.dy = 0 @@ -660,9 +660,11 @@ def unselect(tw): try: i = float(tw.selected_block.label) if i > 1000000: - setlabel(tw.selected_block,'0') + setlabel(tw.selected_block,'1') + showlabel(tw.lc,"#overflowerror") elif i < -1000000: - setlabel(tw.selected_block,'0') + setlabel(tw.selected_block,'-1') + showlabel(tw.lc,"#overflowerror") except ValueError: pass -- cgit v0.9.1