public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) { pluginScreenSpace.Text = "库啵标点工具"; InitMap(); pluginScreenSpace.Controls.Add(this); subscription.ProcessChanged += OnProcessChanged; subscription.ZoneChanged += OnZoneChanged; statusLabel = pluginStatusText; statusLabel.Text = "Working :D"; Log("库啵标点已启动"); uint id = repository.GetCurrentTerritoryID(); Log("当前区域ID: " + id.ToString()); if (map.ContainsKey(id)) { Namazu = Namazu.Instance; area = map[id](); area.AddDelegates(); } }
private void OnZoneChanged(uint id, string name) { try { SendCommand(string.Format("/e {0}:{1}", id, name)); if (area != null) { area.RemoveDelegates(); area = null; } if (map.ContainsKey(id)) { area = map[id](); area.AddDelegates(); } } catch (Exception e) { Log(e.ToString()); } }