public ProfessionInfoGump(ProfessionInfo info) { _info = info; ClilocLoader localization = ClilocLoader.Instance; ResizePic background = new ResizePic(3000) { Width = 175, Height = 34 }; background.SetTooltip(localization.GetString(info.Description), 250); Add(background); Add ( new Label(localization.GetString(info.Localization), true, 0x00, font: 1) { X = 7, Y = 8 } ); Add(new GumpPic(121, -12, info.Graphic, 0)); }
public static string GetError(byte packetID, byte code) { ClilocLoader cliloc = ClilocLoader.Instance; switch (packetID) { case 0x53: if (code >= 10) { code = 9; } Tuple <int, string> t = _loginErrors[code]; return(cliloc.GetString(t.Item1, t.Item2)); case 0x85: if (code >= 6) { code = 5; } t = _errorCode[code]; return(cliloc.GetString(t.Item1, t.Item2)); case 0x27: if (code >= 5) { code = 4; } t = _pickUpErrors[code]; return(cliloc.GetString(t.Item1, t.Item2)); case 0x82: if (code >= 9) { code = 8; } t = _generalErrors[code]; return(cliloc.GetString(t.Item1, t.Item2)); } return(string.Empty); }
public CreateCharProfessionGump(ProfessionInfo parent = null) : base(0, 0) { _Parent = parent; if (parent == null || !ProfessionLoader.Instance.Professions.TryGetValue(parent, out List <ProfessionInfo> professions) || professions == null) { professions = new List <ProfessionInfo>(ProfessionLoader.Instance.Professions.Keys); } /* Build the gump */ Add(new ResizePic(2600) { X = 100, Y = 80, Width = 470, Height = 372 }); Add(new GumpPic(291, 42, 0x0589, 0)); Add(new GumpPic(214, 58, 0x058B, 0)); Add(new GumpPic(300, 51, 0x15A9, 0)); ClilocLoader localization = ClilocLoader.Instance; Add(new Label(localization.GetString(3000326, "Choose a Trade for Your Character"), false, 0x0386, font: 2) { X = 158, Y = 132 }); for (int i = 0; i < professions.Count; i++) { int cx = i % 2; int cy = i >> 1; Add(new ProfessionInfoGump(professions[i]) { X = 145 + cx * 195, Y = 168 + cy * 70, Selected = SelectProfession }); } Add(new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2) { X = 586, Y = 445, ButtonAction = ButtonAction.Activate }); }
public CreateCharProfessionGump(ProfessionInfo parent = null) : base(0, 0) { _Parent = parent; if (parent == null || !ProfessionLoader.Instance.Professions.TryGetValue(parent, out List <ProfessionInfo> professions) || professions == null) { professions = new List <ProfessionInfo>(ProfessionLoader.Instance.Professions.Keys); } /* Build the gump */ Add ( new ResizePic(2600) { X = 100, Y = 80, Width = 470, Height = 372 } ); Add(new GumpPic(291, 42, 0x0589, 0)); Add(new GumpPic(214, 58, 0x058B, 0)); Add(new GumpPic(300, 51, 0x15A9, 0)); ClilocLoader localization = ClilocLoader.Instance; bool isAsianLang = string.Compare(Settings.GlobalSettings.Language, "CHT", StringComparison.InvariantCultureIgnoreCase) == 0 || string.Compare(Settings.GlobalSettings.Language, "KOR", StringComparison.InvariantCultureIgnoreCase) == 0 || string.Compare(Settings.GlobalSettings.Language, "JPN", StringComparison.InvariantCultureIgnoreCase) == 0; bool unicode = isAsianLang; byte font = (byte)(isAsianLang ? 1 : 2); ushort hue = (ushort)(isAsianLang ? 0xFFFF : 0x0386); Add ( new Label(localization.GetString(3000326, "Choose a Trade for Your Character"), unicode, hue, font: font) { X = 158, Y = 132 } ); for (int i = 0; i < professions.Count; i++) { int cx = i % 2; int cy = i >> 1; Add ( new ProfessionInfoGump(professions[i]) { X = 145 + cx * 195, Y = 168 + cy * 70, Selected = SelectProfession } ); } Add ( new Button((int)Buttons.Prev, 0x15A1, 0x15A3, 0x15A2) { X = 586, Y = 445, ButtonAction = ButtonAction.Activate } ); }