diff options
author | echinelli <emilianochinelli@gmail.com> | 2010-12-07 16:00:45 (GMT) |
---|---|---|
committer | echinelli <emilianochinelli@gmail.com> | 2010-12-07 16:00:45 (GMT) |
commit | 3843d4d00f4444d14c72b7a80e0742e7a1a25fd6 (patch) | |
tree | 6cf7e996a5b6d927419f0163dfa659a716636fc2 | |
parent | 58528ea11a501604d59cd039ed0b3eca74d6e4f4 (diff) |
Save character properties improvements. Changes in modules: customization, main_window, character
-rwxr-xr-x | Saludame.activity/character.py | 25 | ||||
-rwxr-xr-x | Saludame.activity/customization.py | 41 | ||||
-rwxr-xr-x | Saludame.activity/windows_controller.py | 2 |
3 files changed, 39 insertions, 29 deletions
diff --git a/Saludame.activity/character.py b/Saludame.activity/character.py index a6d3545..53771fc 100755 --- a/Saludame.activity/character.py +++ b/Saludame.activity/character.py @@ -31,10 +31,17 @@ class Character: Get the character current status, and returns a dictionary. """ - status = {"hair_color" : self.hair_color, - "socks_color" : self.socks_color, - "skin_color" : self.skin_color, - "shoes_color" : self.shoes_color, + #status = {"hair_color" : self.hair_color, + # "socks_color" : self.socks_color, + # "skin_color" : self.skin_color, + # "shoes_color" : self.shoes_color, + # "current_place" : self.current_place, + # "name" : self.name, + # "level" : self.level, + # "grade" : self.grade, + # "clothes" : self.clothes + # } + status = {"character_colors" : self.mappings, # add by CustomizatedKid in module customization. "current_place" : self.current_place, "name" : self.name, "level" : self.level, @@ -47,10 +54,11 @@ class Character: """ Load the character properties from previous data """ - self.hair_color = game_status["hair_color"] - self.socks_color = game_status["socks_color"] - self.skin_color = game_status["skin_color"] - self.shoes_color = game_status["shoes_color"] + #self.hair_color = game_status["hair_color"] + #self.socks_color = game_status["socks_color"] + #self.skin_color = game_status["skin_color"] + #self.shoes_color = game_status["shoes_color"] + self.mappings = game_status["character_colors"] self.name = game_status["name"] self.clothes = game_status["clothes"] self.grade = game_status["grade"] @@ -103,3 +111,4 @@ class Clothes: self.texture_path = texture_path self.weather_effects_list = weather_effects_list #list of tuples (id_weather, effect_indoor, effect_outdoor) + diff --git a/Saludame.activity/customization.py b/Saludame.activity/customization.py index 642894a..257e742 100755 --- a/Saludame.activity/customization.py +++ b/Saludame.activity/customization.py @@ -9,10 +9,10 @@ import utilities from gettext import gettext as _ COLORS_HAIR = [ - ("#000000", "#191919"), # BLACK - ("#fce94f", "#edd400"), # YELLOW - ("#803310", "#552210"), # BROWN - ("#A03310", "#852210"), # Red + ("#000000", "#191919"), # BLACK + ("#fce94f", "#edd400"), # YELLOW + ("#803310", "#552210"), # BROWN + ("#A03310", "#852210"), # Red ] COLORS_SKIN = [ @@ -29,20 +29,20 @@ COLORS_SKIN = [ ] TANGO_PALETTE = [ - ("#edd400", "#c4a000"), # Yellow - ("#f57700", "#ce5c00"), # Orange - ("#c17d11", "#8f5902"), # Brown - ("#73d216", "#4e9a06"), # Green - ("#3465a4", "#204a87"), # Blue - ("#75507b", "#5c3566"), # Plum - ("#cc0000", "#a40000"), # Red - ("#ffffff", "#d3d7cf"), # White - ("#d3d7cf", "#babdb6"), # Aluminium light - ("#555753", "#2e3436"), # Aluminium dark - ("#000000", "#2e3436"), # Black + ("#edd400", "#c4a000"), # Yellow + ("#f57700", "#ce5c00"), # Orange + ("#c17d11", "#8f5902"), # Brown + ("#73d216", "#4e9a06"), # Green + ("#3465a4", "#204a87"), # Blue + ("#75507b", "#5c3566"), # Plum + ("#cc0000", "#a40000"), # Red + ("#ffffff", "#d3d7cf"), # White + ("#d3d7cf", "#babdb6"), # Aluminium light + ("#555753", "#2e3436"), # Aluminium dark + ("#000000", "#2e3436"), # Black # Original design (not tango) - ("#fd8255", "#db601f"), # Orange + ("#fd8255", "#db601f"), # Orange ("#eeea00", "#938200") # Yellow ] @@ -55,7 +55,7 @@ class CustomizationWindow(window.Window): window.Window.__init__(self, container, rect, frame_rate, windows_controller, "customization_window") self.set_bg_image("assets/windows/window_2.png") - kid_rect = pygame.Rect((20, 20), (1,1)) + kid_rect = pygame.Rect((20, 20), (1, 1)) self.kid = CustomizatedKid(self.rect, kid_rect, 1, character) self.add_child(self.kid) @@ -133,14 +133,14 @@ class CustomizatedKid(widget.Widget): self.set_mapping("hair", (pygame.Color("#000000"), pygame.Color("#191919"))) def set_mapping(self, key, colors): - self.mappings[key] = tuple(colors) + self.character.mappings[key] = tuple(colors) self.apply_mappings() def apply_mappings(self): self.background = self.kid.copy() for key in CustomizatedKid.COLOR_MAP: origin_colors = CustomizatedKid.COLOR_MAP[key] - mapped_colors = self.mappings[key] + mapped_colors = self.character.mappings[key] utilities.change_color(self.background, origin_colors[0], mapped_colors[0]) utilities.change_color(self.background, origin_colors[1], mapped_colors[1]) @@ -157,4 +157,5 @@ class CustomizatedKid(widget.Widget): self.kid = pygame.image.load(path) self.set_rect_size(self.kid.get_size()) self.apply_mappings() -
\ No newline at end of file + + diff --git a/Saludame.activity/windows_controller.py b/Saludame.activity/windows_controller.py index 120b79d..42652b1 100755 --- a/Saludame.activity/windows_controller.py +++ b/Saludame.activity/windows_controller.py @@ -55,7 +55,7 @@ class WindowsController: self.update(0) # Activate Customization over main window - self.set_active_window("customization_window") + #self.set_active_window("customization_window") ##### Windows ##### def close_active_window(self): |