Fix hair, dick around with new game screen.
[18plus-7leafadventure.git] / src / org / sevenchan / dongs / screens / LoadSaveScreen.as
blobf8088587e9c7ad6f5a110776e99465f92ee46445
1 package org.sevenchan.dongs.screens
3 import org.sevenchan.dongs.creature.Player;
4 import org.sevenchan.dongs.Screen;
6 /**
7 * ...
8 * @author Harbinger
9 */
10 public class LoadSaveScreen extends Screen
13 private var text:String = "";
14 private var loading:Boolean;
16 public function LoadSaveScreen(load:Boolean)
18 this.loading = load;
19 this.exportGameButton = true;
20 this.importGameButton = true;
21 this.appearanceButton = false;
22 this.debugMenuButton = false;
23 this.loadOrSaveButton = false;
24 this.newGameButton = false;
25 this.showLoadOrSaveButton = false;
28 override public function getScreenText():String
30 return text;
33 override public function processButtonPress(id:int):Boolean
35 clearButtons();
36 switch(id) {
37 case -1:
38 text = "<h2>" + ((loading)?"Load":"Save") + " Game</h2>";
39 setButton(0, "CANCEL");
40 for (var i:int = 1; i < 12; i++) {
41 var slotInfo:String = Player.previewSlot(i);
42 if(!loading || slotInfo!="Slot Empty") {
43 setButton(i, "Slot " + i);
45 text += "<p>" + slotInfo + "</p>";
47 updateScreen();
48 return false;
49 break;
50 case 0:
51 return true;
52 default:
53 InfoScreen.push("Game " + ((loading)?"Loaded":"Saved") + "!");
54 if (loading) {
55 main.player = new Player(main);
56 main.player.setMain(main);
57 main.player.load(id);
58 } else {
59 main.player.save(id);
61 return true;