Main menu option comes up instead of context specific menu

30 views
Skip to first unread message

Kraitos

unread,
May 7, 2011, 2:19:33 PM5/7/11
to endgame-singularity
I've installed Singularity 0.30b on Ubuntu 11.04 and I am getting a
strange bug - nearly half of the in-game buttons show a main menu when
clicked. I.e. "finance" button, or "Items" in "Knowledge".

The following messages are printed in the console at the same time:

Exception in function show at Sat May 7 22:18:24 2011 MSD:
Traceback (most recent call last):
File "/usr/share/games/singularity/code/safety.py", line 58, in
safe_call
return func(*args, **kwargs)
File "/usr/share/games/singularity/code/graphics/dialog.py", line
200, in show
result = self.handle(event)
File "/usr/share/games/singularity/code/graphics/dialog.py", line
327, in handle
return self.call_handlers(handlers, event)
File "/usr/share/games/singularity/code/graphics/dialog.py", line
339, in call_handlers
handler(event)
File "/usr/share/games/singularity/code/graphics/button.py", line
111, in handle_event
self.activate_with_sound(event)
File "/usr/share/games/singularity/code/graphics/button.py", line
124, in activate_with_sound
self.activated(event)
File "/usr/share/games/singularity/code/graphics/button.py", line
153, in activated
self.function(*self.args, **self.kwargs)
File "/usr/share/games/singularity/code/graphics/button.py", line
201, in show_dialog
raise constants.Handled, dialog.call_dialog(self.dialog, self)
File "/usr/share/games/singularity/code/graphics/dialog.py", line
94, in call_dialog
retval = dialog.show()
File "/usr/share/games/singularity/code/screens/knowledge.py", line
201, in show
return super(KnowledgeScreen, self).show()
File "/usr/share/games/singularity/code/graphics/dialog.py", line
200, in show
result = self.handle(event)
File "/usr/share/games/singularity/code/graphics/dialog.py", line
327, in handle
return self.call_handlers(handlers, event)
File "/usr/share/games/singularity/code/graphics/dialog.py", line
339, in call_handlers
handler(event)
File "/usr/share/games/singularity/code/graphics/listbox.py", line
83, in on_click
self.list_pos = self.safe_pos(index + self.scrollbar.scroll_pos)
File "/usr/share/games/singularity/code/graphics/widget.py", line
51, in set
setattr(self, data_member, my_value)
File "/usr/share/games/singularity/code/graphics/widget.py", line
52, in set
call_me(self, *args, **kwargs)
File "/usr/share/games/singularity/code/graphics/listbox.py", line
208, in _on_selection_change
self.update_func(self.list_pos)
File "/usr/share/games/singularity/code/screens/knowledge.py", line
122, in set_knowledge_type
self.set_knowledge(0)
File "/usr/share/games/singularity/code/screens/knowledge.py", line
133, in set_knowledge
self.knowledge_inner_list_key[list_pos])
File "/usr/share/games/singularity/code/screens/knowledge.py", line
181, in show_info
desc_text += g.to_percent(g.items[knowledge_key].item_qual)
File "/usr/share/games/singularity/code/g.py", line 268, in
to_percent
return locale.format("%.2f%%", raw_percent /
100.).decode(encoding)
File "/usr/lib/python2.7/locale.py", line 189, in format
"format specifier, %s not valid") % repr(percent))
ValueError: format() must be given exactly one %char format specifier,
'%.2f%%' not valid

evilm...@emhsoft.com

unread,
May 7, 2011, 3:54:16 PM5/7/11
to endgame-s...@googlegroups.com
That means it's crashing, and the code is catching it. It looks like it's
coming from the locale stuff, so try playing around with the language.

I don't have time to fix this right now, unfortunately.

Rain

unread,
May 8, 2011, 12:25:04 PM5/8/11
to endgame-singularity
On May 7, 12:54 pm, evilmrhe...@emhsoft.com wrote:
> That means it's crashing, and the code is catching it. It looks like it's
> coming from the locale stuff, so try playing around with the language.
>
> I don't have time to fix this right now, unfortunately.

The workaround is to use locale.format_string() instead of
locale.format() in g.py

Patrick

unread,
May 12, 2011, 9:23:46 PM5/12/11
to endgame-singularity
Is this something I can do if I installed from Ubuntu Software Centre?
If so, where can I find this file?

evilmrhenry

unread,
May 12, 2011, 9:27:48 PM5/12/11
to endgame-s...@googlegroups.com
Patrick wrote:
> Is this something I can do if I installed from Ubuntu Software Centre?
> If so, where can I find this file?

It's python, so you should have the source already. The traceback says
it's in:
/usr/share/singularity/code/g.py line 270.

(I'll try to spend a couple hours taking care of this properly in a week
or two, but I'm moving right now.)

Patrick

unread,
May 13, 2011, 7:00:25 PM5/13/11
to endgame-singularity
Got it! replaced four lines and finished the game!
Reply all
Reply to author
Forward
0 new messages