samsulmaarif / endgame-singularity

Automatically exported from code.google.com/p/endgame-singularity
0 stars 0 forks source link

Patch for SI prefixes, misc cleanups and tweaks #75

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
* Changes all the cash and CPU displays to use SI prefixes, as well as
using a decimal point rather than a comma
* Defines "cred" as the unit of currency
* Includes pun when money exceeds 1000 yottacredits :)
* Removes "Cash:" and "CPU:" form the map, as the units are now given as
part of the value
* Deletes dead global functions in finance.py
* Displays a count of live bases in each location, in addition to total bases
* Replaces "x == None" comparisons with "x is None"

I'd like to delete g.to_cpu() entirely, but that requires normalizing the
CPU and cash values used throughout the game.  A Fraction type, possibly
backported from 2.6/3.0, might make this easier (if we don't have
performance limitations).

Some of my lines are a little long.  I'm not sure if you care about it or not.

The size of the finance screen had to be tweaked to handle displaying units
on every line.  I tried to scale down the font, but it seems the text
sizing engine can't handle that.

Original issue reported on code.google.com by rha...@gmail.com on 11 Mar 2009 at 4:05

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the suggestions and patch! 

Most of your requested changes were already done in git:

* Decimal point in cash and CPU displays: in v0.30c (and possibly much earlier) 
this respects user's locale: some languages uses point, some comma. The same 
about thousand separators.

* SI prefixes: Since commit a7a8265 the prefixes are translatable strings, and 
can be changed via .po files

* Cash overflow was handled in git commit f8eadb73, the limit set to 3.14qu, 
and the "pi" pun was improved in commit 6c50a659

* Dead code from finance.py was removed in git commit a7a8265fc

* Replacing "CASH: xxx / CPU: xxx" for "xxx cred / xxx CPU" seems redundant. 
Won't fix

The remaining issues are:

* replace "x == None" for "x is None". Nice one, that is indeed the pythonic 
way. It is obviously non-critical, but we'll apply that and credit you, thanks!

* Count of live bases:

This is a good UI enhancement idea. Although it is easy to make, it will 
further increase the width of locations (continents) buttons by 3 chars, 
assuming we use the "LOCATION (XX/XX)" notation, and those buttons, specially 
North America and Far Reaches, are a layout pain : their width constantly fall 
outside range in lower resolutions for several languages (try French and you'll 
see). We could further move them to the right to avoid this, but...

... I also fear that XX/XX might confuse users. They may have some trouble 
figuring out what the pair means. Maybe we could only use xx/xx notation if the 
user actually has a base in Sleep in that location? 

I'll leave this open so we can debate the best solution. Suggestions anyone?

Original comment by singular...@rodrigosilva.com on 20 Dec 2012 at 2:23