//================================================================== private static void UpdateItemData(int itemIndex, int dataindex, string data) { switch (dataindex) { case 0: curItemGameSetting = data; break; case 1: curItemFairyLevel = int.Parse(data); break; case 2: data = data.Replace("(newline)", "\n"); curItemValue = data; // Add setting to list foreach (SettingsDataItem CurItem in settingsList) { if (CurItem.gameSetting == curItemGameSetting) { CurItem.AddValue(curItemFairyLevel, curItemValue); return; } } SettingsDataItem NewItem = new SettingsDataItem(); NewItem.gameSetting = curItemGameSetting; NewItem.AddValue(curItemFairyLevel, curItemValue); settingsList.Add(NewItem); break; } }
public void ChCp(object sender, EventArgs e) //change codepage { //BUG: the f*cking runtime substitutes selected by user menuitem with "unicode". wtf? Xwt.CheckBoxMenuItem SelItem = (Xwt.CheckBoxMenuItem)sender; Content = Encoding.GetEncoding(Convert.ToInt32(SelItem.Tag)).GetString(FS.GetFile(URL, new int()).Content); txtBox.Text = Content; #if DEBUG Console.WriteLine("Codepage debug: CP" + SelItem.Tag.ToString() + "=" + Encoding.GetEncoding(Convert.ToInt32(SelItem.Tag)).EncodingName + " (wanted:" + SelItem.Label + ")"); #endif foreach (Xwt.MenuItem CurItem in SettingsMenu) { if (CurItem.GetType() == new Xwt.CheckBoxMenuItem().GetType())//if the menuitem is checkbox { Xwt.CheckBoxMenuItem SelItem2 = (Xwt.CheckBoxMenuItem)SelItem; if (Convert.ToInt32(SelItem.Tag) == Convert.ToInt32(CurItem.Tag)) {//this is that! SelItem2.Checked = true; } else {//no, removing possibly mark SelItem2.Checked = false; } } } }
public void WriteXml(System.Xml.XmlWriter writer) { writer.WriteAttributeString("CurHp", CurHP.ToString()); writer.WriteAttributeString("MaxHp", HP.ToString()); writer.WriteAttributeString("Sword", Sword.ToString()); writer.WriteAttributeString("Item", CurItem.ToString()); writer.WriteAttributeString("Face", curFacing.ToString()); writer.WriteAttributeString("Location", location.X.ToString() + "," + location.Y.ToString()); }