コード例 #1
0
 public void SetNoteList()
 {
     ObjectListUI.SetActive(false);
     InformationDisplay.SetActive(false);
     KeyListUI.SetActive(false);
     NoteListUI.SetActive(true);
 }
コード例 #2
0
    private void Start()
    {
        Genetic_Manager = GetComponent <GeneticManager>();
        display         = GameObject.FindGameObjectWithTag("Display").GetComponent <InformationDisplay>();

        //Calculate Track Length
        TrackLenght = CalculateTrackLength();
    }
コード例 #3
0
        private void PortForwardingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            InformationDisplay DebugScreen = new InformationDisplay {
                DebugFunction = 5
            };

            DebugScreen.Show();
        }
コード例 #4
0
 private void pictureBox1_Click(object sender, EventArgs e)
 {
     if (mapLoaded)
     {
         var relativePoint = PointToClient(Cursor.Position);
         InformationDisplay.Text          += "{X = " + relativePoint.X + " : Y = " + relativePoint.Y + "}" + Environment.NewLine;
         InformationDisplay.Text          += map.RegionInfo(relativePoint.X, relativePoint.Y);
         InformationDisplay.Text          += Environment.NewLine;
         InformationDisplay.SelectionStart = InformationDisplay.Text.Length;
         InformationDisplay.ScrollToCaret();
     }
 }
コード例 #5
0
        public static void DisplayPlaythrough(List <LogicObjects.PlaythroughItem> Playthrough, LogicObjects.TrackerInstance CopyInstance, int GameclearItem, List <LogicObjects.LogicEntry> MainLogic)
        {
            List <string> PlaythroughString = new List <string>();
            int           lastSphere        = -1;

            string FinalTask = CopyInstance.Logic[GameclearItem].DictionaryName;

            if (FinalTask == "MMRTGameClear")
            {
                FinalTask = (CopyInstance.IsMM()) ? "Defeat Majora" : "Beat the game";
            }
            foreach (var i in Playthrough)
            {
                if (i.SphereNumber != lastSphere)
                {
                    PlaythroughString.Add("Sphere: " + i.SphereNumber + " ====================================="); lastSphere = i.SphereNumber;
                }
                if (i.Check.ID == GameclearItem)
                {
                    PlaythroughString.Add(FinalTask);
                }
                else
                {
                    var ObtainLine = "Check \"" + i.Check.LocationName + "\" to obtain \"" + CopyInstance.Logic[i.Check.RandomizedItem].ItemName + "\"";
                    if (MainLogic.Count() > i.Check.ID && MainLogic[i.Check.ID].Checked)
                    {
                        ObtainLine += " ✅";
                    }
                    PlaythroughString.Add(ObtainLine);
                }
                string items = "    Using Items: ";
                foreach (var j in i.ItemsUsed)
                {
                    items = items + CopyInstance.Logic[j].ItemName + ", ";
                }
                if (items != "    Using Items: ")
                {
                    PlaythroughString.Add(items);
                }
            }

            InformationDisplay DisplayPlaythrough = new InformationDisplay();

            InformationDisplay.Playthrough   = PlaythroughString;
            DisplayPlaythrough.DebugFunction = 3;
            DisplayPlaythrough.Show();
            InformationDisplay.Playthrough = new List <string>();
        }
コード例 #6
0
    public void CloseDescription()
    {
        descriptionOpen = false;
        InformationDisplay.SetActive(false);
        for (int i = 0; i < INV.Objects.objList.Count; i++)
        {
            ObjectButtons[i].enabled = true;
        }

        for (int i = 0; i < INV.Notes.objList.Count; i++)
        {
            NoteButtons[i].enabled = true;
        }

        for (int i = 0; i < INV.Objects.objList.Count; i++)
        {
            KeyButtons[i].enabled = true;
        }
    }
コード例 #7
0
 public void OpenDescription()
 {
     if (!descriptionOpen)
     {
         foreach (var button in ObjectButtons)
         {
             button.enabled = false;
         }
         foreach (var button in KeyButtons)
         {
             button.enabled = false;
         }
         foreach (var button in NoteButtons)
         {
             button.enabled = false;
         }
         descriptionOpen = true;
         InformationDisplay.SetActive(true);
     }
 }
コード例 #8
0
        public static void WhatUnlockedThis()
        {
            var    Requirements = Tools.FindRequirements(Tools.CurrentSelectedItem, LogicObjects.MainTrackerInstance.Logic).ResolvedRealItems;
            var    FakeItems    = Tools.FindRequirements(Tools.CurrentSelectedItem, LogicObjects.MainTrackerInstance.Logic).FakeItems;
            var    Playthrough  = Tools.FindRequirements(Tools.CurrentSelectedItem, LogicObjects.MainTrackerInstance.Logic).playthrough;
            var    ItemsUsed    = Tools.FindRequirements(Tools.CurrentSelectedItem, LogicObjects.MainTrackerInstance.Logic).UsedItems;
            string message      = "Logic Entries used:\n";

            if (Requirements.Count == 0)
            {
                MessageBox.Show("Nothing is needed to check this location.", Tools.CurrentSelectedItem.LocationName + " Was Unlocked with:");
                return;
            }
            foreach (var i in ItemsUsed)
            {
                message = message + (LogicObjects.MainTrackerInstance.Logic[i].ItemName ?? LogicObjects.MainTrackerInstance.Logic[i].DictionaryName) + "\n";
            }
            message = message + "\nReal items used:\n";
            foreach (var i in Requirements)
            {
                message = message + LogicObjects.MainTrackerInstance.Logic[i].ItemName + "\n";
            }
            message = message + "\nFake Items Breakdown:\n";
            foreach (var i in FakeItems.OrderBy(x => LogicObjects.MainTrackerInstance.Logic[x].DictionaryName))
            {
                var ItemInPlaythrough = Playthrough.Find(x => x.Check.ID == i) ?? new LogicObjects.PlaythroughItem {
                    ItemsUsed = new List <int>()
                };
                message = message + LogicObjects.MainTrackerInstance.Logic[i].DictionaryName + "\n";
                message = message + WhatUnlockedThisDetailed(i, "", Playthrough, ItemInPlaythrough.ItemsUsed);
            }
            InformationDisplay Display = new InformationDisplay();

            Display.Text = Tools.CurrentSelectedItem.LocationName + " Was Unlocked with:";
            InformationDisplay.Playthrough = message.Split(new[] { "\n" }, StringSplitOptions.None).ToList();
            Display.DebugFunction          = 4;
            Display.Show();
            Tools.CurrentSelectedItem = new LogicObjects.LogicEntry();
        }
コード例 #9
0
        public static void CreateOptionsFile()
        {
            if (!File.Exists("options.txt"))
            {
                List <string> options = new List <string>();
                var           file    = File.Create("options.txt");
                file.Close();

                if (!Debugging.ISDebugging || (Control.ModifierKeys == Keys.Shift))
                {
                    var firsttime = MessageBox.Show("Welcome to the Majoras Mask Randomizer Tracker by thedrummonger! It looks like this is your first time running the tracker. If so select Yes. Otherwise, select No.", "First Time Setup", MessageBoxButtons.YesNo);
                    if (firsttime == DialogResult.Yes)
                    {
                        MessageBox.Show("Please Take this opportunity to familliarize yourself with how to use this tracker. There are many features that are not obvious or explained anywhere outside of the about page. This information can be accessed at any time by selecting 'Info' -> 'About'. Click OK to show the About Page. Once you have read through the information, close the window to return to setup.", "How to Use", MessageBoxButtons.OK);
                        InformationDisplay DebugScreen = new InformationDisplay();
                        DebugScreen.DebugFunction = 2;
                        DebugScreen.ShowDialog();
                    }

                    var DefaultSetting = MessageBox.Show("If you would like to change the default options, press Yes. Otherwise, press No. Selecting Cancel at an option prompt will leave it default. These can be changed later in the Options text document that will be created in your tracker folder. The can also be changed per instance in the options tab", "Default Setting", MessageBoxButtons.YesNo);
                    if (DefaultSetting == DialogResult.Yes)
                    {
                        var ShowToolTips = MessageBox.Show("Would you like to see tooltips that display the full name of an item when you mouse over it?", "Show Tool Tips", MessageBoxButtons.YesNoCancel);
                        if (ShowToolTips == DialogResult.No)
                        {
                            options.Add("ToolTips:0");
                        }
                        else
                        {
                            options.Add("ToolTips:1");
                        }

                        var SeperateMArkedItems = MessageBox.Show("Would you like Marked locations to be moved to the bottom of the list?", "Show Tool Tips", MessageBoxButtons.YesNoCancel);
                        if (SeperateMArkedItems == DialogResult.Yes)
                        {
                            options.Add("SeperateMarked:1");
                        }
                        else
                        {
                            options.Add("SeperateMarked:0");
                        }

                        var MiddleClickFunction = MessageBox.Show("Would you like Middle Click to star a location instead of Setting it? Staring a location will allow you to mark it as important so you can easily refrence it later. Setting a location will add what item or entrance is placed at that location. (Yes: Star, No: Set)", "Star or Set", MessageBoxButtons.YesNoCancel);
                        if (MiddleClickFunction == DialogResult.Yes)
                        {
                            options.Add("MiddleClickFunction:1");
                        }
                        else
                        {
                            options.Add("MiddleClickFunction:0");
                        }

                        var DisableEntrances = MessageBox.Show("Would you like the tracker to automatically mark entrances as unrandomized when creating an instance? This is usefull if you don't plan to use entrance randomizer often.", "Start with Entrance Rando", MessageBoxButtons.YesNoCancel);
                        if (DisableEntrances == DialogResult.No)
                        {
                            options.Add("DisableEntrancesOnStartup:0");
                        }
                        else
                        {
                            options.Add("DisableEntrancesOnStartup:1");
                        }

                        var UpdateCheck = MessageBox.Show("Would you like the tracker to notify you when a newer version has been released?", "Check For Updates", MessageBoxButtons.YesNoCancel);
                        if (UpdateCheck == DialogResult.No)
                        {
                            options.Add("CheckForUpdates:0");
                        }
                        else
                        {
                            options.Add("CheckForUpdates:1");
                        }
                    }
                }
                else
                {
                    options.Add("ToolTips:1");
                    options.Add("SeperateMarked:0");
                    options.Add("DisableEntrancesOnStartup:0");
                    options.Add("CheckForUpdates:0");
                }
                File.WriteAllLines("options.txt", options);
            }
        }
コード例 #10
0
        public static void GeneratePlaythrough(LogicObjects.TrackerInstance Instance)
        {
            List <LogicObjects.PlaythroughItem> Playthrough = new List <LogicObjects.PlaythroughItem>();
            Dictionary <int, int> SpoilerToID = new Dictionary <int, int>();
            var playLogic = Utility.CloneTrackerInstance(Instance);
            var GameClear = GetGameClearEntry(playLogic.Logic, Instance.EntranceRando);

            if (GameClear < 0)
            {
                MessageBox.Show("Could not find game clear requirements. Playthrough can not be generated."); return;
            }

            if (!Utility.CheckforSpoilerLog(playLogic.Logic))
            {
                var file = Utility.FileSelect("Select A Spoiler Log", "Spoiler Log (*.txt;*html)|*.txt;*html");
                if (file == "")
                {
                    return;
                }
                LogicEditing.WriteSpoilerLogToLogic(playLogic, file);
            }

            if (!Utility.CheckforSpoilerLog(playLogic.Logic, true))
            {
                MessageBox.Show("Not all items have spoiler data. Playthrough may not generate correctly. Ensure you are using the same version of logic used to generate your selected spoiler log");
            }

            List <int> importantItems = new List <int>();

            foreach (var i in playLogic.Logic)
            {
                i.Available = false;
                i.Checked   = false;
                i.Aquired   = false;
                if (i.IsFake)
                {
                    i.SpoilerRandom = i.ID; i.RandomizedItem = i.ID; i.LocationName = i.DictionaryName; i.ItemName = i.DictionaryName;
                }
                if (i.Unrandomized() && i.ID == i.SpoilerRandom)
                {
                    i.IsFake = true;
                }
                if (i.SpoilerRandom > -1)
                {
                    i.RandomizedItem = i.SpoilerRandom;
                }
                SpoilerToID.Add(i.SpoilerRandom, i.ID);
                //Check for all items mentioned in the logic file
                if (i.Required != null)
                {
                    foreach (var k in i.Required)
                    {
                        if (!importantItems.Contains(k))
                        {
                            importantItems.Add(k);
                        }
                    }
                }
                if (i.Conditionals != null)
                {
                    foreach (var j in i.Conditionals)
                    {
                        foreach (var k in j)
                        {
                            if (!importantItems.Contains(k))
                            {
                                importantItems.Add(k);
                            }
                        }
                    }
                }
                if (i.ID == GameClear)
                {
                    importantItems.Add(i.ID);
                }
            }

            SwapAreaClearLogic(playLogic);
            MarkAreaClearAsEntry(playLogic);
            CalculatePlaythrough(playLogic.Logic, Playthrough, 0, importantItems);


            importantItems = new List <int>();
            bool MajoraReachable          = false;
            var  GameClearPlaythroughItem = new LogicObjects.PlaythroughItem();

            foreach (var i in Playthrough)
            {
                if (i.Check.ID == GameClear)
                {
                    GameClearPlaythroughItem = i;
                    importantItems.Add(i.Check.ID);
                    FindImportantItems(i, importantItems, Playthrough, SpoilerToID);
                    MajoraReachable = true;
                    break;
                }
            }
            if (!MajoraReachable)
            {
                MessageBox.Show("This seed is not beatable using this logic! Playthrough could not be generated!"); return;
            }

            Playthrough = Playthrough.OrderBy(x => x.SphereNumber).ThenBy(x => x.Check.ItemSubType).ThenBy(x => x.Check.LocationArea).ThenBy(x => x.Check.LocationName).ToList();

            //Replace all fake items with the real items used to unlock those fake items
            foreach (var i in Playthrough)
            {
                i.ItemsUsed = Tools.ResolveFakeToRealItems(i, Playthrough, playLogic.Logic).Distinct().ToList();
            }

            List <string> PlaythroughString = new List <string>();
            int           lastSphere        = -1;

            foreach (var i in Playthrough)
            {
                if (!importantItems.Contains(i.Check.ID) || i.Check.IsFake)
                {
                    continue;
                }
                if (i.SphereNumber != lastSphere)
                {
                    PlaythroughString.Add("Sphere: " + i.SphereNumber + " ====================================="); lastSphere = i.SphereNumber;
                }
                PlaythroughString.Add("Check \"" + i.Check.LocationName + "\" to obtain \"" + playLogic.Logic[i.Check.RandomizedItem].ItemName + "\"");
                string items = "    Using Items: ";
                foreach (var j in i.ItemsUsed)
                {
                    items = items + playLogic.Logic[j].ItemName + ", ";
                }
                if (items != "    Using Items: ")
                {
                    PlaythroughString.Add(items);
                }
            }

            var h = GameClearPlaythroughItem;

            PlaythroughString.Add("Sphere: " + h.SphereNumber + " ====================================="); lastSphere = h.SphereNumber;
            PlaythroughString.Add("Defeat Majora");
            string items2 = "    Using Items: ";

            foreach (var j in h.ItemsUsed)
            {
                items2 = items2 + playLogic.Logic[j].ItemName + ", ";
            }
            if (items2 != "    Using Items: ")
            {
                PlaythroughString.Add(items2);
            }

            InformationDisplay DisplayPlaythrough = new InformationDisplay();

            InformationDisplay.Playthrough   = PlaythroughString;
            DisplayPlaythrough.DebugFunction = 3;
            DisplayPlaythrough.Show();
            InformationDisplay.Playthrough = new List <string>();
        }
コード例 #11
0
 public void OpenDescription(Item item)
 {
     descriptionOpen = true;
     InformationDisplay.SetActive(true);
 }