public string updatePlot(PlotItem newPlot) { activePlot = newPlot; dialogueTexts[0].text = newPlot.speaker + ": " + newPlot.plot.line; for (int i = 1; i < dialogueTexts.Length; i++) { if (newPlot.options.Count >= i && newPlot.options[i - 1].line.Length > 0) { optionButtons[i - 1].gameObject.SetActive(true); if (optionButtons[i - 1].onClick.GetPersistentEventCount() == 0) UnityEventTools.AddStringPersistentListener(optionButtons[i - 1].onClick, setupPlot, newPlot.options[i - 1].next); else UnityEventTools.RegisterStringPersistentListener(optionButtons[i - 1].onClick, 0, setupPlot, newPlot.options[i - 1].next); dialogueTexts[i].text = newPlot.options[i - 1].line; } else { optionButtons[i - 1].gameObject.SetActive(false); } } return null; }
public EditMenuItem(MainForm form, PlotItem item) { this.item = item; this.Click += new EventHandler(form.EditClick); }
private bool Load(BinaryReader reader) { // header _type = reader.ReadByte(); //byte -- Type/version indicator. See Notes below. width = reader.ReadInt32(); //int -- Map Width height = reader.ReadInt32(); //int -- Map Height _numOfPlayers = reader.ReadByte(); //byte -- Possibly number of players for scenario. _wrap = reader.ReadInt32(); //int -- Unknown; seems to be a world wrap indicator (1 if wrap, 0 if no wrap) _lengthOfTerrainTypeList = reader.ReadInt32(); //int -- Length of Terrain type list _lengthOf1StFeatureTypeList = reader.ReadInt32(); //int -- Length of 1st Feature type list _lengthOf2NdFeatureTypeList = reader.ReadInt32(); //int -- Length of 2nd Feature type list _lengthOfResourceTypeList = reader.ReadInt32(); //int -- Length of Resource type list reader.ReadInt32(); //int -- Unknown _lengthOfMapName = reader.ReadInt32(); //int -- Length of Map Name string _lengthOfDescription = reader.ReadInt32(); //int -- Length of Description string terrainTypes = new string(reader.ReadChars(_lengthOfTerrainTypeList));//string[] -- Terrain type list featureTypes = new string(reader.ReadChars(_lengthOf1StFeatureTypeList)); //string[] -- 1st Feature type list feature2ndType = new string(reader.ReadChars(_lengthOf2NdFeatureTypeList)); //string[] -- 2nd Feature type list resourceTypes = new string(reader.ReadChars(_lengthOfResourceTypeList)); //string[] -- Resource type list mapName = reader.ReadStringZ(); //string -- Map Name string description = reader.ReadStringZ(); //string -- Description string if (_type > 135) { lengthOfStr = reader.ReadInt32(); //int -- Length of String3 (only present in version xB or later) str = new string(reader.ReadChars(lengthOfStr)); //string -- String3 (only present in version xB or later) } // data (x*y) plots = new PlotItem[width, height]; for (int y = 0; y < height; y++) for (int x = 0; x < width; x++) plots[x, y] = new PlotItem(reader); // scenario byte[] unused = reader.ReadBytes(84); //84 unknown bytes lengthOfImprovementTypeList = reader.ReadInt32(); //int -- Length of Improvement type list lengthOfUnitTypeList = reader.ReadInt32(); //int -- Length of Unit type list lengthOfTechTypeList = reader.ReadInt32(); //int -- Length of Tech type list lengthOfPolicyTypeList = reader.ReadInt32(); //int -- Length of Policy type list lengthOfBuildingTypeList = reader.ReadInt32(); //int -- Length of Building type list lengthOfPromotionTypeList = reader.ReadInt32(); //int -- Length of Promotion type list int unusedInt = reader.ReadInt32(); lengthOfVictoryTypeList = reader.ReadInt32(); int unusedInt2 = reader.ReadInt32(); improvementTypes = new string(reader.ReadChars(lengthOfImprovementTypeList)); //string[] -- Improvement type list unitTypes = new string(reader.ReadChars(lengthOfUnitTypeList)); //string[] -- Unit type list techTypes = new string(reader.ReadChars(lengthOfTechTypeList)); //string[] -- Tech type list policyTypes = new string(reader.ReadChars(lengthOfPolicyTypeList)); //string[] -- Policy type list buildingTypes = new string(reader.ReadChars(lengthOfBuildingTypeList)); //string[] -- Building type list promotionTypes = new string(reader.ReadChars(lengthOfPromotionTypeList)); //string[] -- Promotion type list victoryTypes = new string(reader.ReadChars(lengthOfVictoryTypeList)); string rest = ""; while (reader.PeekChar() != -1) rest += reader.ReadChar(); rest = "<start>" + rest + "<end>"; return true; }
public void Init() { plots = new PlotItem[width, height]; for (int x = 0; x < width; ++x) for (int y = 0; y < height; ++y) plots[x, y] = new PlotItem(); }
public ItemSelectedEventArgs(RoutedEvent e, PlotItem item, BaseGraph graph) { RoutedEvent = e; Item = item; Graph = graph; }