diff --git a/game/scripts/wardrobe/studio.rpy b/game/scripts/wardrobe/studio.rpy index 3f8003b5..13fe690f 100644 --- a/game/scripts/wardrobe/studio.rpy +++ b/game/scripts/wardrobe/studio.rpy @@ -48,16 +48,17 @@ init python in studio: d = {} for i in renpy.store.states.dolls: - d[i] = {} - d[i]["eyebrows"] = faces[i].get("eyebrows", [None]).index("base") - d[i]["eyes"] = faces[i].get("eyes", [None]).index("base") - d[i]["mouth"] = faces[i].get("mouth", [None]).index("base") - d[i]["pupils"] = faces[i].get("pupils", [None]).index("mid") - d[i]["cheeks"] = faces[i].get("cheeks", [False]).index(False) - d[i]["tears"] = faces[i].get("tears", [False]).index(False) - d[i]["zoom"] = 0.5 - d[i]["flip"] = 1 - d[i]["alpha"] = 1.0 + d[i] = di = {} + fi = faces[i] + di["eyebrows"] = fi.get("eyebrows", [None]).index("base") + di["eyes"] = fi.get("eyes", [None]).index("base") + di["mouth"] = fi.get("mouth", [None]).index("base") + di["pupils"] = fi.get("pupils", [None]).index("mid") + di["cheeks"] = fi.get("cheeks", [False]).index(False) + di["tears"] = fi.get("tears", [False]).index(False) + di["zoom"] = 0.5 + di["flip"] = 1 + di["alpha"] = 1.0 d["background"] = { "image": 0, @@ -89,20 +90,22 @@ init python in studio: return d def get_face(char): - eyebrows = choices[char]["eyebrows"] - eyes = choices[char]["eyes"] - mouth = choices[char]["mouth"] - pupils = choices[char]["pupils"] - cheeks = choices[char]["cheeks"] - tears = choices[char]["tears"] + cho = choices[char] + eyebrows = cho["eyebrows"] + eyes = cho["eyes"] + mouth = cho["mouth"] + pupils = cho["pupils"] + cheeks = cho["cheeks"] + tears = cho["tears"] + fa = faces[char] d = { - "eyebrows": faces[char]["eyebrows"][eyebrows], - "eyes": faces[char]["eyes"][eyes], - "mouth": faces[char]["mouth"][mouth], - "pupils": faces[char]["pupils"][pupils], - "cheeks": faces[char]["cheeks"][cheeks], - "tears": faces[char]["tears"][tears], + "eyebrows": fa["eyebrows"][eyebrows], + "eyes": fa["eyes"][eyes], + "mouth": fa["mouth"][mouth], + "pupils": fa["pupils"][pupils], + "cheeks": fa["cheeks"][cheeks], + "tears": fa["tears"][tears], } return d @@ -134,9 +137,10 @@ init python in studio: def drag_update(drag): drag.char_obj.set_face(**get_face(drag.char_name)) - zoom = choices[drag.char_name]["zoom"] - flip = choices[drag.char_name]["flip"] - alpha = choices[drag.char_name]["alpha"] + cho = choices[drag.char_name] + zoom = cho["zoom"] + flip = cho["flip"] + alpha = cho["alpha"] d = Flatten(drag.char_obj.image) d = Transform(d, zoom=zoom, xzoom=flip, alpha=alpha) @@ -144,15 +148,17 @@ init python in studio: return def drag_reset(drag): - choices[drag.char_name]["eyebrows"] = faces[drag.char_name]["eyebrows"].index("base") - choices[drag.char_name]["eyes"] = faces[drag.char_name]["eyes"].index("base") - choices[drag.char_name]["mouth"] = faces[drag.char_name]["mouth"].index("base") - choices[drag.char_name]["pupils"] = faces[drag.char_name]["pupils"].index("mid") - choices[drag.char_name]["cheeks"] = faces[drag.char_name]["cheeks"].index(False) - choices[drag.char_name]["tears"] = faces[drag.char_name]["tears"].index(False) - choices[drag.char_name]["zoom"] = 0.5 - choices[drag.char_name]["flip"] = 1 - choices[drag.char_name]["alpha"] = 1.0 + cho = choices[drag.char_name] + fa = faces[drag.char_name] + cho["eyebrows"] = fa["eyebrows"].index("base") + cho["eyes"] = fa["eyes"].index("base") + cho["mouth"] = fa["mouth"].index("base") + cho["pupils"] = fa["pupils"].index("mid") + cho["cheeks"] = fa["cheeks"].index(False) + cho["tears"] = fa["tears"].index(False) + cho["zoom"] = 0.5 + cho["flip"] = 1 + cho["alpha"] = 1.0 drag.char_obj.set_face(**get_face(drag.char_name))