Ejemplo n.º 1
0
        public MapleEditorImplementation(PluginManager manager)
        {
            this.manager = manager;

            minimap = new MyMinimap();

            var minimapContainer = new Gtk.Alignment(1.0f, 1.0f, 1.0f, 1.0f);

            var list = new List <string>(new string[] {
                "Present (Ricky)",
                "Present (Dimitri)",
                "Present (Moosh)"
            });

            if (Project.Game == Game.Ages)
            {
                list.Add("Past");
            }

            Gtk.ComboBox comboBox = new Gtk.ComboBox(list.ToArray());

            comboBox.Changed += (a, b) => {
                int  i = comboBox.Active;
                Data data;
                Map  map;

                if (i == 3)
                {
                    data = Project.GetData("maplePastLocations");
                    map  = Project.GetWorldMap(1, manager.GetActiveRoomLayout().Season);
                }
                else
                {
                    data = Project.GetData(Project.GetData("maplePresentLocationsTable", i * 2).GetValue(0));
                    map  = Project.GetWorldMap(0, manager.GetActiveRoomLayout().Season);
                }

                minimap.Width  = map.MapWidth;
                minimap.Height = map.MapHeight;

                minimap.SetData(data);
                minimap.SetMap(map);
                minimap.Selectable = false;

                minimapContainer.Foreach((c) => minimapContainer.Remove(c));
                minimapContainer.Add(minimap);
                minimapContainer.ShowAll();
            };
            if (manager.GetActiveMap().MainGroup == 1)
            {
                comboBox.Active = 3;
            }
            else
            {
                comboBox.Active = 0;
            }

            Gtk.VBox vbox = new Gtk.VBox();
            vbox.Add(comboBox);
            vbox.Add(minimapContainer);

            this.Add(vbox);
            ShowAll();
        }
Ejemplo n.º 2
0
 public override void Init(PluginManager manager)
 {
     this.manager = manager;
 }