public MapMedia( IMapTable table, IMapDeserializer deserializer, IMapperOptions options, IMapConfig config) { this._table = table; this._deserializer = deserializer; this._options = options; this._config = config; }
/// <summary> /// Creates an EditMapForm. /// </summary> /// <param name="map">The map to be edited.</param> void CreateEditMapForm(IMapTable map) { var editorFrm = new EditMapForm(); editorFrm.MapScreenControl.ChangeMap(map.ID); editorFrm.Text = "[" + map.ID + "] " + map.Name; editorFrm.Show(dockPanel); var settings = EditorSettings.Default; settings.InitialMapId = (int)map.ID; settings.Save(); }
/// <summary> /// Copies the column values into the given DbParameterValues using the database column name /// with a prefixed @ as the key. The key must already exist in the DbParameterValues /// for the value to be copied over. If any of the keys in the DbParameterValues do not /// match one of the column names, or if there is no field for a key, then it will be /// ignored. Because of this, it is important to be careful when using this method /// since columns or keys can be skipped without any indication. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="paramValues">The DbParameterValues to copy the values into.</param> public static void TryCopyValues(this IMapTable source, DbParameterValues paramValues) { for (var i = 0; i < paramValues.Count; i++) { switch (paramValues.GetParameterName(i)) { case "id": paramValues[i] = (UInt16)source.ID; break; case "name": paramValues[i] = source.Name; break; } } }
/// <summary> /// Copies the column values into the given DbParameterValues using the database column name /// with a prefixed @ as the key. The key must already exist in the DbParameterValues /// for the value to be copied over. If any of the keys in the DbParameterValues do not /// match one of the column names, or if there is no field for a key, then it will be /// ignored. Because of this, it is important to be careful when using this method /// since columns or keys can be skipped without any indication. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="paramValues">The DbParameterValues to copy the values into.</param> public static void TryCopyValues(this IMapTable source, NetGore.Db.DbParameterValues paramValues) { for (int i = 0; i < paramValues.Count; i++) { switch (paramValues.GetParameterName(i)) { case "id": paramValues[i] = (System.UInt16)source.ID; break; case "name": paramValues[i] = (System.String)source.Name; break; } } }
/// <summary> /// Checks if this <see cref="IMapTable"/> contains the same values as another <see cref="IMapTable"/>. /// </summary> /// <param name="source">The source <see cref="IMapTable"/>.</param> /// <param name="otherItem">The <see cref="IMapTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IMapTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this IMapTable source, IMapTable otherItem) { return Equals(source.ID, otherItem.ID) && Equals(source.Name, otherItem.Name); }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this MapTable. /// </summary> /// <param name="source">The IMapTable to copy the values from.</param> public void CopyValuesFrom(IMapTable source) { this.ID = (NetGore.World.MapID)source.ID; this.Name = (System.String)source.Name; }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IMapTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic) { dic["id"] = (NetGore.World.MapID)source.ID; dic["name"] = (System.String)source.Name; }
public MapSerializeContext(IMapSerializer serializer, IMapTable table) { this._serializer = serializer; this.Table = table; }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this MapTable. /// </summary> /// <param name="source">The IMapTable to copy the values from.</param> public void CopyValuesFrom(IMapTable source) { ID = source.ID; Name = source.Name; }
/// <summary> /// Initializes a new instance of the <see cref="MapTable"/> class. /// </summary> /// <param name="source">IMapTable to copy the initial values from.</param> public MapTable(IMapTable source) { CopyValuesFrom(source); }
/// <summary> /// Raises the <see cref="E:System.Windows.Forms.Form.Load"/> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data.</param> protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (DesignMode) { return; } tssInfo.Text = string.Empty; UpdateCursorPos(Vector2.Zero, Vector2.Zero); Show(); // Set the ToolBarVisibility values. Do it here instead of setting the properties to avoid messing up // the controls order. tbGlobal.ToolBarVisibility = ToolBarVisibility.Global; tbMap.ToolBarVisibility = ToolBarVisibility.Map; // Auto-update GrhDatas SetStatusMessageLoading("Updating GrhData"); GlobalState.Instance.AutoUpdateGrhDatas(); GlobalState.Instance.AutoUpdateMusic(); GlobalState.Instance.AutoUpdateSounds(); SetStatusMessageLoading("Updating cached GrhData sizes"); AutomaticGrhDataSizeUpdater.Instance.UpdateSizes(); // Enable the update timer GlobalState.Instance.IsTickEnabled = true; // Create the child form instances SetStatusMessageLoading("Creating child forms"); _frmGrhTreeView = new GrhTreeViewForm(); _frmGrhTreeView.VisibleChanged += _frmGrhTreeView_VisibleChanged; _frmSelectedMapObjs = new SelectedMapObjectsForm(); _frmSelectedMapObjs.VisibleChanged += _frmSelectedMapObjs_VisibleChanged; _frmNPCChatEditor = new NPCChatEditorForm(); _frmNPCChatEditor.VisibleChanged += _frmNPCChatEditor_VisibleChanged; _frmSkeletonEditor = new SkeletonEditorForm(); _frmSkeletonEditor.VisibleChanged += _frmSkeletonEditor_VisibleChanged; _frmDbEditor = new DbEditorForm(); _frmDbEditor.VisibleChanged += _frmDbEditor_VisibleChanged; _frmMusicEditor = new MusicEditorForm(); _frmMusicEditor.VisibleChanged += _frmMusicEditor_VisibleChanged; _frmBodyEditor = new BodyEditorForm(); _frmBodyEditor.VisibleChanged += _frmBodyEditor_VisibleChanged; _frmSoundEditor = new SoundEditorForm(); _frmSoundEditor.VisibleChanged += _frmSoundEditor_VisibleChanged; _frmGrhTilesetForm = new GrhTilesetForm(); _frmGrhTilesetForm.VisibleChanged += new EventHandler(_frmGrhTilesetForm_VisibleChanged); // Set up some other stuff var mapPropertiesTool = ToolManager.Instance.TryGetTool <MapPropertiesTool>(); if (mapPropertiesTool != null) { mapPropertiesTool.DockPanel = dockPanel; } else { const string errmsg = "Unable to set DockPanel on MapPropertiesTool - couldn't find tool instance."; Debug.Fail(errmsg); } // Load the settings SetStatusMessageLoading("Loading user settings"); LoadDockSettings("User"); // Set up map state control listeners & display initial values SetStatusMessageLoading("Hooking up map events"); GlobalState.Instance.Map.LayerDepthChanged -= Map_LayerDepthChanged; GlobalState.Instance.Map.LayerDepthChanged += Map_LayerDepthChanged; GlobalState.Instance.Map.LayerChanged -= Map_LayerChanged; GlobalState.Instance.Map.LayerChanged += Map_LayerChanged; Map_LayerChanged(GlobalState.Instance, EventArgs.Empty); Map_LayerDepthChanged(GlobalState.Instance, EventArgs.Empty); // Clean up bad maps SetStatusMessageLoading("Validating map ids"); MapHelper.DeleteMissingMapIds(); // Load the initial map SetStatusMessageLoading("Loading the initial map"); var validMaps = MapHelper.FindAllMaps().ToArray(); if (validMaps.Length > 0) { MapID initialMapId = (MapID)EditorSettings.Default.InitialMapId; IMapTable initialMap = validMaps.FirstOrDefault(x => x.ID == initialMapId); if (initialMap == null) { initialMap = validMaps.MinElement(x => x.ID); } CreateEditMapForm(initialMap); } // Global not currently used... tbGlobal.Visible = false; // Bind help SetStatusMessageLoading("Setting up F1 help"); var helpManager = EditorHelpManager.Instance; helpManager.StatusLabel = tssInfo; helpManager.Add(cmbLayer, "Map Layers", "Map layers"); helpManager.Add(trackBarDepth, "Layer Depth", "Layer depth"); SetStatusMessage(string.Empty); }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IMapTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic) { dic["id"] = (NetGore.World.MapID)source.ID; dic["name"] = (System.String)source.Name; }
/// <summary> /// Copies the column values into the given DbParameterValues using the database column name /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="paramValues">The DbParameterValues to copy the values into.</param> public static void CopyValues(this IMapTable source, DbParameterValues paramValues) { paramValues["id"] = (UInt16)source.ID; paramValues["name"] = source.Name; }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IMapTable source, IDictionary<String, Object> dic) { dic["id"] = source.ID; dic["name"] = source.Name; }
/// <summary> /// Checks if this <see cref="IMapTable"/> contains the same values as another <see cref="IMapTable"/>. /// </summary> /// <param name="source">The source <see cref="IMapTable"/>.</param> /// <param name="otherItem">The <see cref="IMapTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IMapTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this IMapTable source, IMapTable otherItem) { return(Equals(source.ID, otherItem.ID) && Equals(source.Name, otherItem.Name)); }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IMapTable source, IDictionary <String, Object> dic) { dic["id"] = source.ID; dic["name"] = source.Name; }
/// <summary> /// Copies the column values into the given DbParameterValues using the database column name /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="paramValues">The DbParameterValues to copy the values into.</param> public static void CopyValues(this IMapTable source, NetGore.Db.DbParameterValues paramValues) { paramValues["id"] = (System.UInt16)source.ID; paramValues["name"] = (System.String)source.Name; }
public MapDeserializeContext(IMapDeserializer deserializer, IMapTable table) { this._deserializer = deserializer; this.Table = table; }