private void Activate() { this.AddPage(1); //The heart of the matter. If a plugin is enabled... try { if ((bool)QueryPageHelper.PluginsEnabled[arg]) { //Try to connect to the plugin's gump code repository. try { string toAct = "Server.TMSS." + (string)QueryPageHelper.GumpCalls[arg]; //+"."+ControlPageHelper.GumpCalls[num]+"()"; //SkillSettings.doTell( toAct ); ObjectHandle handle = Activator.CreateInstance(null, toAct); TMPlugin theObj = (TMPlugin)handle.Unwrap(); relplug = theObj; GumpType = relplug.getGumpType(); if (GumpType != "Underbar" && GumpType != "Master" && Mobile != null && Skin.HelpOn) { Dictionary <string, object> args = new Dictionary <string, object>(); args.Add("Skin", this.Skin); args.Add("Mobile", Mobile); args.Add("Get", relplug); associatedHelpGump = new TMQueryPage("TMSS Session Help Gump", args); //Mobile.SendGump(associatedHelpGump); } if (!(relplug is Gump)) { BaseSkinByType(this); } theObj.GetGumpCode(this); } //If you can't, throw this exception. catch (Exception e) { SkillSettings.DoTell("Plugin errors on use. Please report this error, and do not attempt to use: " + arg + " Exception: " + e); } } //If the plugin is NOT enabled... else { SkillSettings.DoTell("Plugin not enabled: " + arg); } } catch (Exception e) { SkillSettings.DoTell("Error while creating plugin info. Arg was: " + arg + ". Further info: " + e); } }
public void GetGumpCode(TMQueryPage page) { Dictionary <string, object> args = (Dictionary <string, object>)page.GetValueSet(); attemptHelpClose(page); page.BaseSkinByType(this); if (!args.ContainsKey("Get")) { return; } TMSS4Skin sk = (TMSS4Skin)args["Skin"]; TMPlugin plugin = (TMPlugin)args["Get"]; string text = plugin.getHelpText(); if (sk.IconHOn) { this.AddImage(sk.IconHX, sk.IconHY, sk.IconHID); } this.AddHtml(sk.HelpLabelX, sk.HelpLabelY, sk.HelpLabelW, sk.HelpLabelH, "<basefont size=4 face=2 color=#ffffff>" + text + "</basefont>", false, false); page.Mobile.SendGump(this); }
private void Activate() { this.AddPage(1); //The heart of the matter. If a plugin is enabled... try { if ((bool)QueryPageHelper.PluginsEnabled[arg]) { //Try to connect to the plugin's gump code repository. try { string toAct = "Server.TMSS." + (string)QueryPageHelper.GumpCalls[arg];//+"."+ControlPageHelper.GumpCalls[num]+"()"; //SkillSettings.doTell( toAct ); ObjectHandle handle = Activator.CreateInstance(null, toAct); TMPlugin theObj = (TMPlugin)handle.Unwrap(); relplug = theObj; GumpType = relplug.getGumpType(); if (GumpType != "Underbar" && GumpType != "Master" && Mobile != null && Skin.HelpOn) { Dictionary<string, object> args = new Dictionary<string, object>(); args.Add("Skin", this.Skin); args.Add("Mobile", Mobile); args.Add("Get", relplug); associatedHelpGump = new TMQueryPage("TMSS Session Help Gump", args); //Mobile.SendGump(associatedHelpGump); } if( !(relplug is Gump) ) BaseSkinByType(this); theObj.GetGumpCode(this); } //If you can't, throw this exception. catch (Exception e) { SkillSettings.DoTell("Plugin errors on use. Please report this error, and do not attempt to use: " + arg + " Exception: " + e); } } //If the plugin is NOT enabled... else { SkillSettings.DoTell("Plugin not enabled: " + arg); } } catch( Exception e ) { SkillSettings.DoTell("Error while creating plugin info. Arg was: "+arg+". Further info: "+e); } }