public int GetInt(string name) { IMGEntry e = GetChild(name); if (e == null) { return(0); } return(e.GetInt()); }
public GetMapInfo(IMGEntry info) { InitializeComponent(); List<string> MusicNames = new List<string>(); lock (MapEditor.SoundLock) { foreach (IMGFile bgms in MapEditor.sound.Directory.IMGs.Values) { if (bgms.Name.Substring(0, 3) == "Bgm") { foreach (IMGEntry sound in bgms.childs.Values) { MusicNames.Add(bgms.Name + "/" + sound.Name); } } } } MusicNames.Sort(); BGMsList.Items.AddRange(MusicNames.ToArray()); BGMsList.SelectedItem = info.GetString("bgm").Replace("/", ".img/"); int returnMap = info.GetInt("returnMap"); if (returnMap == 999999999) { IsReturnMap.Checked = true; ReturnMap.Enabled = false; } else { IsReturnMap.Checked = false; ReturnMap.Enabled = true; } ReturnMap.Text = returnMap.ToString(); IsTown.Checked = info.GetInt("town") == 1; IsSwim.Checked = info.GetInt("swim") == 1; IsMiniMap.Checked = info.parent.GetChild("miniMap") != null; selectedMark = info.GetString("mapMark"); MarkPreview.Image = MapMarkSelect.GetMark(selectedMark); Bitmap background = new Bitmap(800, 600); using (Graphics g = Graphics.FromImage(background)) { foreach (MapBack b in Map.Instance.backs) { b.Draw(g); } } Bitmap thumb = new Bitmap(160, 120); using (Graphics g = Graphics.FromImage(thumb)) { g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.DrawImage(background, 0, 0, 160, 120); g.Dispose(); } BackgroundPreview.Image = thumb; }
public static void SwapInt(IMGEntry e1, IMGEntry e2) { int temp = e1.GetInt(); e1.SetInt(e2.GetInt()); e2.SetInt(temp); }