Ejemplo n.º 1
0
 /// <summary>
 /// (re)load information from given binary (protobuf) file
 /// </summary>
 /// <param name="libraryFile"></param>
 public void LoadBin(string libraryFile)
 {
     using (var file = File.OpenRead(libraryFile))
     {
         gamesCollection = new GameCollection(GardenSizeX, GardenSizeY, Serializer.Deserialize <List <GardenItem> >(file));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// (re)load information from given Json file
 /// </summary>
 /// <exception cref="">various IO exceptions may occur when library file could not be found/loaded</exception>
 public void LoadJson(string libraryFile)
 {
     json            = new JSONStore(libraryFile); // TODO use all json files in there?
     gamesCollection = new GameCollection(GardenSizeX, GardenSizeY, new List <GardenItem>());
     ParseJson(json);
     FinalizeGamelibForUse();
 }
        /// <summary>
        /// construct new menu
        /// </summary>
        public GameChooserMenu()
        {
            ActiveInState = new StateBrowsingMenu();
            panel = new GardenGamesPanel(this);
            panel.Motion.Position = new Vector2(0.0f, 0.0f);

            // get the items to display
            gamesList = GardenGame.Instance.GameLib.GetList();

            // background
            Spritelet bg = new Spritelet("parc-by-gadl.png");
            bg.Motion.Position = new Vector2(0.66667f, 0.22f);
            bg.DrawInfo.LayerDepth = 1f;
            //bg.DrawInfo.DrawColor = new Color(0.3f, 0.3f, 0.3f, 0.3f);
            // bg color 169, 157, 241
            bg.Motion.Add(new MyFuncyModifier( delegate(float v) { return v/70.0f; }, "Rotate"));
            bg.Motion.Add(new MyFuncyModifier(delegate(float v) { return (0.45f + 0.75f * (float) Math.Sqrt(v/430.0)); }, "Scale"));
            bg.Motion.TargetPos = new Vector2(0.66667f, 0.9f);
            bg.Motion.TargetPosSpeed = 0.004f;
            Add(bg);
            background = bg;

            // logo
            Spritelet logo = new Spritelet("igglogo");
            Add(logo);
            logo.DrawInfo.Alpha = 0.7f;
            logo.Motion.Scale = 0.55f;
            logo.Motion.Position = new Vector2(Screen.AspectRatio - 0.24f, 0.04f);
            ColorChangeBehavior fadeIn = new ColorChangeBehavior();
            logo.Add(fadeIn);
            fadeIn.Intensity = 0f;
            fadeIn.FadeToTarget(0.9344f, 6f);
            logo.Motion.Add(new SineModifier("ScaleModifier", 0.03124f, 0.07344f, 1.0f));

            // set my panel and games list
            Add(panel);
            panel.OnUpdateList(gamesList);
        }
 public override void OnUpdateList(GameCollection gl)
 {
     this.gl = gl;
     SelectGameBelowCursor();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// user action caused update of the games to be displayed
 /// </summary>
 /// <param name="gl">new list of games to use</param>
 public abstract void OnUpdateList(GameCollection gl);
Ejemplo n.º 6
0
 /// <summary>
 /// (re)load information from given Json file
 /// </summary>
 /// <exception cref="">various IO exceptions may occur when library file could not be found/loaded</exception>
 public void LoadJson(string libraryFile)
 {
     json = new JSONStore(libraryFile); // TODO use all json files in there?
     gamesCollection = new GameCollection(GardenSizeX, GardenSizeY, new List<GardenItem>());
     ParseJson(json);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// (re)load information from given binary (protobuf) file
 /// </summary>
 /// <param name="libraryFile"></param>
 public void LoadBin(string libraryFile)
 {
     using (var file = File.OpenRead(libraryFile))
     {
         gamesCollection = new GameCollection(GardenSizeX, GardenSizeY, Serializer.Deserialize<List<GardenItem>>(file));
     }
 }