Documentation ¶
Index ¶
- Constants
- func Edit(m game.Mobile, o game.Object)
- func InjectMethods(fn func(game.NetState, string))
- func MungHTMLForGUMP(in string) string
- func TypeCodeByName(name string) uo.Serial
- type BaseGUMP
- func (g *BaseGUMP) AlphaRegion(x, y, w, h int)
- func (g *BaseGUMP) Background(x, y, w, h int, bg uo.GUMP)
- func (g *BaseGUMP) Checkbox(x, y int, normal, pressed uo.GUMP, id uint32, checked bool)
- func (g *BaseGUMP) CroppedLabel(x, y, w, h int, hue uo.Hue, text string)
- func (g *BaseGUMP) EndGroup()
- func (g *BaseGUMP) Group(n uint32)
- func (g *BaseGUMP) HTML(x, y, w, h int, html string, background, scrollbar bool)
- func (g *BaseGUMP) Image(x, y int, gump uo.GUMP, hue uo.Hue)
- func (g *BaseGUMP) InsertLine(l string) int
- func (g *BaseGUMP) InvalidateLayout()
- func (g *BaseGUMP) Item(x, y int, item uo.Graphic, hue uo.Hue)
- func (g *BaseGUMP) Label(x, y int, hue uo.Hue, text string)
- func (g *BaseGUMP) NoClose()
- func (g *BaseGUMP) NoDispose()
- func (g *BaseGUMP) NoMove()
- func (g *BaseGUMP) NoResize()
- func (g *BaseGUMP) Packet(x, y int, sender, typeCode uo.Serial) serverpacket.Packet
- func (g *BaseGUMP) Page(page uint32)
- func (g *BaseGUMP) PageButton(x, y int, normal, pressed uo.GUMP, page uint32)
- func (g *BaseGUMP) RadioButton(x, y int, normal, pressed uo.GUMP, id uint32, on bool)
- func (g *BaseGUMP) ReplyButton(x, y int, normal, pressed uo.GUMP, id uint32)
- func (g *BaseGUMP) SetTypeCode(c uo.Serial)
- func (g *BaseGUMP) TextEntry(x, y, w, h int, hue uo.Hue, text string, limit int, id uint32)
- func (g *BaseGUMP) TiledImage(x, y, w, h int, gump uo.GUMP)
- func (g *BaseGUMP) TypeCode() uo.Serial
- type GUMP
- type SGFlag
- type SGGemButton
- type StandardGUMP
- func (g *StandardGUMP) CheckSwitch(x, y, w, h int, hue uo.Hue, text string, id uint32, checked bool)
- func (g *StandardGUMP) CheckedReplyButton(x, y, w, h int, hue uo.Hue, text string, id uint32)
- func (g *StandardGUMP) DebugCheckBackground()
- func (g *StandardGUMP) GemButton(x, y int, which SGGemButton, id uint32)
- func (g *StandardGUMP) Group()
- func (g *StandardGUMP) HTML(x, y, w, h int, html string, scrollbar bool)
- func (g *StandardGUMP) HorizontalBar(x, y, w int)
- func (g *StandardGUMP) Image(x, y, v, h int, hue uo.Hue, id uo.GUMP)
- func (g *StandardGUMP) InvalidateLayout()
- func (g *StandardGUMP) Item(x, y, v, h int, hue uo.Hue, id uo.Graphic)
- func (g *StandardGUMP) Packet(x, y int, sender, typeCode uo.Serial) serverpacket.Packet
- func (g *StandardGUMP) PageButton(x, y, w, h int, hue uo.Hue, text string, page uint32)
- func (g *StandardGUMP) RadioSwitch(x, y, w, h int, hue uo.Hue, text string, id uint32, checked bool)
- func (g *StandardGUMP) ReplyButton(x, y, w, h int, hue uo.Hue, text string, id uint32)
- func (g *StandardGUMP) Separator(y int)
- func (g *StandardGUMP) SetTypeCode(c uo.Serial)
- func (g *StandardGUMP) StandardReplyHandler(p *clientpacket.GUMPReply) bool
- func (g *StandardGUMP) Text(x, y, w int, hue uo.Hue, text string)
- func (g *StandardGUMP) TextEntry(x, y, w int, hue uo.Hue, text string, limit int, id uint32)
- func (g *StandardGUMP) TypeCode() uo.Serial
- func (g *StandardGUMP) Window(w, h int, title string, flags SGFlag, numPages uint32)
Constants ¶
const ( GUMPIDDecorate uo.Serial = 1 GUMPIDRegions uo.Serial = 2 )
Static GUMP IDs, these shouldn't be needed often.
Variables ¶
This section is empty.
Functions ¶
func InjectMethods ¶
InjectMethods is responsible for injecting methods for cross-package communication.
func MungHTMLForGUMP ¶
MungHTMLForGUMP manipulates the input line-by-line in the following way: 1. All leading and trailing whitespace is removed 2. The trailing newline is replaced with a single space 3. Consecutive whitespace is collapsed into a single space
func TypeCodeByName ¶
TypeCodeByName returns the type code for the given name.
Types ¶
type BaseGUMP ¶
type BaseGUMP struct {
// contains filtered or unexported fields
}
BaseGUMP represents a generic GUMP and is the basis for all other GUMPs.
func (*BaseGUMP) AlphaRegion ¶
AlphaRegion is supposed to add a checkered transparent region to the GUMP. However ClassicUO - at least as of version 0.1.11.39 - adds this region but also makes the entire GUMP 50% alpha.
func (*BaseGUMP) Background ¶
Background creates a 3x3 background tiled to the given dimensions.
func (*BaseGUMP) CroppedLabel ¶
CroppedLabel like Label but within a cropped area.
func (*BaseGUMP) EndGroup ¶
func (g *BaseGUMP) EndGroup()
EndGroup ends the current RadioButton group. RadioButton groups must be book- ended by the EndGroup function otherwise they will not work on pages after 1 according to the POL GUMP documentation. No idea if this is an issue in ClassicUO.
func (*BaseGUMP) Group ¶
Group starts a RadioButton group. RadioButton groups must be book-ended by the EndGroup function otherwise they will not work on pages after 1 according to the POL GUMP documentation. No idea if this is an issue in ClassicUO.
func (*BaseGUMP) HTML ¶
HTML creates an HTML view.
According to the POL GUMP documentation these are the HTML tags that are supported: <B></B>..................................... Bold <BIG></BIG>................................. Bigger font <SMALL></SMALL>............................. Smaller font <EM></EM>................................... Emphasis <I></I>..................................... Italicized <U></U>..................................... Underlined <H1></H1>................................... Heading 1 - largest <H2></H2>................................... Heading 2 <H3></H3>................................... Heading 3 <H4></H4>................................... Heading 4 <H5></H5>................................... Heading 5 <H6></H6>................................... Heading 6 - smallest <a href=""></a>............................. Hyperlink <div align="right"></DIV>................... Division on the right <div align="left"></DIV>.................... Division on the left <left></left>............................... Left-align text <P>......................................... Paragraph block <CENTER></CENTER>........................... Center-align text <BR></BR>................................... Line break <BASEFONT color=#ffffff size=1-7></BASEFONT> Set default font?
func (*BaseGUMP) InsertLine ¶
InsertLine adds l to the GUMP's list of text lines and returns the reference number.
func (*BaseGUMP) InvalidateLayout ¶
func (g *BaseGUMP) InvalidateLayout()
InvalidateLayout implements the GUMP interface.
func (*BaseGUMP) NoClose ¶
func (g *BaseGUMP) NoClose()
NoClose flags the GUMP as not closable with right-click.
func (*BaseGUMP) NoDispose ¶
func (g *BaseGUMP) NoDispose()
NoDispose flags the GUMP as not closable with the escape key. This is the default for most GUMPs.
func (*BaseGUMP) NoMove ¶
func (g *BaseGUMP) NoMove()
NoMove disables the ability to close the GUMP to be moved on screen.
func (*BaseGUMP) NoResize ¶
func (g *BaseGUMP) NoResize()
NoResize disables the ability to resize certain GUMPs.
func (*BaseGUMP) PageButton ¶
PageButton creates a button that will change pages.
func (*BaseGUMP) RadioButton ¶
RadioButton creates a radio button switch. See Group and EndGroup.
func (*BaseGUMP) ReplyButton ¶
ReplyButton creates a button that will generate a reply packet.
func (*BaseGUMP) SetTypeCode ¶
SetTypeCode implements the GUMP interface.
func (*BaseGUMP) TextEntry ¶
TextEntry creates a text entry area. If limit is less than 1 no limit will be enforced.
func (*BaseGUMP) TiledImage ¶
TiledImage places a tiled GUMP image.
type GUMP ¶
type GUMP interface { // Layout executes all of the layout functions that comprise this GUMP. // Must be called before Packet(). Layout(target, param game.Object) // InvalidateLayout resets the internal state so that Layout() may be called // again. InvalidateLayout() // Packet returns a newly created serverpacket.Packet for this GUMP. Packet(x, y int, sender, serial uo.Serial) serverpacket.Packet // HandleReply is called to process all replies for this GUMP. HandleReply // is not expected to handle GUMP close requests. The server keeping track // of open GUMPs should do that. Additionally the server needs to call // Layout again and send the new GUMP packet back to the client. HandleReply(n game.NetState, p *clientpacket.GUMPReply) // TypeCode returns the GUMP's type code. TypeCode() uo.Serial // SetTypeCode sets the GUMP's type code. SetTypeCode(uo.Serial) }
GUMP is the interface all GUMP objects implement.
type SGGemButton ¶
type SGGemButton uint8
SGGemButton is an enumeration of the available gem buttons available to the GemButton() function.
const ( SGGemButtonOptions SGGemButton = 0 SGGemButtonLogOut SGGemButton = 1 SGGemButtonJournal SGGemButton = 2 SGGemButtonSkills SGGemButton = 3 SGGemButtonChat SGGemButton = 4 SGGemButtonPeace SGGemButton = 5 SGGemButtonWar SGGemButton = 6 SGGemButtonStatus SGGemButton = 7 SGGemButtonCharacter SGGemButton = 8 SGGemButtonHelp SGGemButton = 9 SGGemButtonAuto SGGemButton = 10 SGGemButtonManual SGGemButton = 11 SGGemButtonCancel SGGemButton = 12 SGGemButtonApply SGGemButton = 13 SGGemButtonDefault SGGemButton = 14 SGGemButtonOK SGGemButton = 15 SGGemButtonStrategy SGGemButton = 16 SGGemButtonAdd SGGemButton = 17 SGGemButtonDelete SGGemButton = 18 )
All valid values for SGGemButton
type StandardGUMP ¶
type StandardGUMP struct {
// contains filtered or unexported fields
}
StandardGUMP provides a set of layout methods built on top of BaseGUMP's layout methods that make it a little more convenient to build GUMPs with the standard theme. The methods of this struct accept coordinates and dimensions in cells, not pixels. A cell is 32x32 pixels.
func (*StandardGUMP) CheckSwitch ¶
func (g *StandardGUMP) CheckSwitch(x, y, w, h int, hue uo.Hue, text string, id uint32, checked bool)
CheckSwitch creates a checkbox element with a numbered switch and a label.
func (*StandardGUMP) CheckedReplyButton ¶
CheckedReplyButton creates a small gem button with the text to the right. The dimensions given are for the total width including the button. This means that the text is cropped to an area w-1xh. This button will generate a GUMP reply packet and close the GUMP. This differs from ReplyButton in that the gem button will contain a check mark.
func (*StandardGUMP) DebugCheckBackground ¶
func (g *StandardGUMP) DebugCheckBackground()
DebugCheckBackground creates a checked background to illustrate the size and position of each cell.
func (*StandardGUMP) GemButton ¶
func (g *StandardGUMP) GemButton(x, y int, which SGGemButton, id uint32)
GemButton creates a standardized button from the gem theme with a word baked into the button image. The button is always two cells wide by one cell tall.
func (*StandardGUMP) HTML ¶
func (g *StandardGUMP) HTML(x, y, w, h int, html string, scrollbar bool)
HTML creates an HTML view without background.
func (*StandardGUMP) HorizontalBar ¶
func (g *StandardGUMP) HorizontalBar(x, y, w int)
HorizontalBar creates a horizontal element within the background that may be used to separate vertical sections of a GUMP.
func (*StandardGUMP) Image ¶
Image places the given GUMP image at the location with the given offsets.
func (*StandardGUMP) InvalidateLayout ¶
func (g *StandardGUMP) InvalidateLayout()
InvalidateLayout implements the GUMP interface.
func (*StandardGUMP) Item ¶
Item places the given item image at the location with the given offsets.
func (*StandardGUMP) Packet ¶
func (g *StandardGUMP) Packet(x, y int, sender, typeCode uo.Serial) serverpacket.Packet
Packet implements the GUMP interface.
func (*StandardGUMP) PageButton ¶
PageButton creates a small gem button with the text to the right. The dimensions given are for the total width including the button. This means that the text is cropped to an area w-1xh. This button will hide the currently visible page and show the indicated page. No packets are generated. The standard scroll interface has page buttons included on the right-hand side of the scroll that can be used to sequentially cycle through the pages forward and backward. Only use this function if a different use case is required.
func (*StandardGUMP) RadioSwitch ¶
func (g *StandardGUMP) RadioSwitch(x, y, w, h int, hue uo.Hue, text string, id uint32, checked bool)
RadioSwitch creates a radio button element with a numbered switch and a label.
func (*StandardGUMP) ReplyButton ¶
ReplyButton creates a small gem button with the text to the right. The dimensions given are for the total width including the button. This means that the text is cropped to an area w-1xh. This button will generate a GUMP reply packet and close the GUMP.
func (*StandardGUMP) Separator ¶
func (g *StandardGUMP) Separator(y int)
Separator like HorizontalBar but forces the bar to cover the entire width of the GUMP.
func (*StandardGUMP) SetTypeCode ¶
func (g *StandardGUMP) SetTypeCode(c uo.Serial)
SetTypeCode implements the GUMP interface.
func (*StandardGUMP) StandardReplyHandler ¶
func (g *StandardGUMP) StandardReplyHandler(p *clientpacket.GUMPReply) bool
StandardReplyHandler returns true if the reply was totally handled by this function and should be ignored. This function alters the packet in ways required for the proper function of the GUMP, therefore this function must be called first thing in any HandleReply function.
func (*StandardGUMP) Text ¶
func (g *StandardGUMP) Text(x, y, w int, hue uo.Hue, text string)
Text creates a cropped label element. Text elements are always one line tall and do not respect newlines. If more functionality is needed see HTML().
func (*StandardGUMP) TextEntry ¶
TextEntry creates a text entry element. Text entries are always one line tall and does not support newlines. The width of the text entry must be at least 2.
func (*StandardGUMP) TypeCode ¶
func (g *StandardGUMP) TypeCode() uo.Serial
TypeCode implements the GUMP interface.
func (*StandardGUMP) Window ¶
func (g *StandardGUMP) Window(w, h int, title string, flags SGFlag, numPages uint32)
Window creates a new Window for the GUMP. Window dimensions are given in cells and specifies the inner size of the window. If closable is true a close button is generated and the GUMP may be closed with right-clicking and - in some situations - the escape key. If minimizeable is true a minimize button is generated and the GUMP will have minimize behavior. If pageButtons is true page buttons are generated for every page.