本文整理汇总了Python中wolfpack.gumps.cGump函数的典型用法代码示例。如果您正苦于以下问题:Python cGump函数的具体用法?Python cGump怎么用?Python cGump使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cGump函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: showWhoGump
def showWhoGump(player, page):
current_page = page
# Collect the current list of sockets first
wholist = []
worldsocket = wolfpack.sockets.first()
while worldsocket:
char = worldsocket.player
if char.invisible and char.rank > player.rank:
worldsocket = wolfpack.sockets.next()
continue
if not char.account:
wolfpack.sockets.next()
continue
wholist.append(char)
worldsocket = wolfpack.sockets.next()
count = len(wholist)
# Skip page * 10 users
newwholist = wholist[page * 10:]
while len(newwholist) == 0 and page > 0:
page -= 1
newwholist = wholist[page * 10:]
wholist = newwholist
# Player list increases by 22 pixels
pages = (count + 9) / 10 # 10 per page
gump = cGump( 0, 0, 0, 50, 50 )
gump.addBackground( 0xE10, 380, 360 )
gump.addCheckerTrans( 15, 15, 350, 330 );
gump.addGump( 130, 18, 0xFA8 )
gump.addText( 165, 20, tr("Who Menu"), 0x530 )
gump.addButton( 30, 320, 0xFB1, 0xFB3, 0 ) # Close Button
gump.addText( 70, 320, tr("Close"), 0x834 )
gump.addText( 145, 320, tr("Players: %u") % count, 0x834 )
gump.addText( 280, 320, tr( "Page %i of %i" % ( page + 1, pages ) ), 0x834 )
if page + 1 < pages:
gump.addButton( 260, 320, 0x0FA, 0x0FA, 1 ) # Next Page
if page > 0:
gump.addButton( 240, 320, 0x0FC, 0x0FC, 2 ) # Previous Page
offset = 22
wholist = wholist[:10]
for char in wholist:
gump.addButton( 20, 40 + offset, 0xFA5, 0xFA7, 2 + char.serial )
gump.addText( 54, 40 + offset, tr("%s [%s]") % ( char.name, char.account.name ), 0x834 )
gump.addText( 257, 40 + offset, unicode(char.socket.address), 0x834 )
offset += 24
gump.setArgs( [ current_page ] )
gump.setCallback( "commands.who.callbackWho" )
gump.send( player.socket )
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:60,代码来源:who.py
示例2: statictileinfo
def statictileinfo( socket, model, pos, tile ):
gump = cGump( 0, 0, 0, 0, 40 )
gump.addResizeGump( 0, 40, 0xA28, 450, 300 ) # Background
gump.addGump( 105, 18, 0x58B ) # Fancy top-bar
gump.addGump( 182, 0, 0x589 ) # "Button" like gump
gump.addTilePic( 202, 23, 0x14EF ) # Display our tile
gump.addText( 175, 90, "Static Info", 0x530 )
# Give information about the tile
gump.addText( 50, 120, "Name: "+tile['name'], 0x834 )
gump.addText( 50, 140, "ID: "+hex( model ), 0x834 )
gump.addText( 50, 160, "Position: "+unicode( pos.x )+","+unicode( pos.y )+","+unicode( pos.z ), 0x834 )
gump.addText( 50, 180, "Weight: "+unicode( tile['weight'] ), 0x834 )
gump.addText( 50, 200, "Height: "+unicode( tile['height'] ), 0x834 )
# Wet ? Impassable ? At least these are the most interesting
gump.addCroppedText( 50, 220, 230, 40, "Properties: "+ tile['flagnames'], 0x834 )
# OK button
gump.addButton( 50, 275, 0xF9, 0xF8, 0 ) # Only Exit possible
# Item Preview
gump.addResizeGump( 300, 120, 0xBB8, 110, 150 )
gump.addTilePic( 340, 160 - ( tile['height'] / 2 ), model )
gump.send( socket )
return
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:29,代码来源:info.py
示例3: onUse
def onUse( char, item ):
# We only can rename marked runes
if item.gettag( 'marked' ) != 1:
char.socket.sysmessage( tr("This rune is not marked.") )
return True
# We are only handling runes
if not isrune( item ):
return 0
# It needs to be on our body
if item.getoutmostchar() != char:
char.socket.sysmessage( tr("The rune needs to be in your posession to rename it.") )
return True
gump = cGump( 0, 0, 0, 50, 50 )
# Header
gump.addBackground( 0x24a4, 300, 200 )
gump.addTilePic( 80, 33, 0x1F14 )
gump.addHtmlGump( 10, 30, 300, 20, tr('<basefont size="7" color="#336699"><center>Rename rune</center></basefont>') )
# Rename Field
gump.addHtmlGump( 40, 60, 300, 20, tr('How do you like to name the rune?') )
gump.addResizeGump( 40, 80, 0x2486, 206, 26 )
gump.addInputField( 43, 83, 200, 20, 0x539, 1, item.name )
gump.addButton( 43, 125, 2128, 2129, 1000 ) # Ok
gump.addButton( 110, 125, 2119, 2120, 0 ) # Cancel
gump.setCallback( rename_callback )
gump.setArgs( [ item ] )
gump.send( char )
return True
开发者ID:Mutilador,项目名称:Wolfpack,代码行数:34,代码来源:rune.py
示例4: import_command
def import_command(socket, command, arguments):
char = socket.player
gump = cGump(x=100, y=100, callback="commands.import.callback")
gump.addBackground(id=0x2436, width=350, height=300)
text = '<basefont color="#FEFEFE"><h3>Import - <basefont color="#ff0000">Items Only</basefont></h3><br />Enter the name of the worldfile you want to import below. But before clicking Import, choose the correct file format from the list.</basefont>'
gump.addHtmlGump(x=20, y=20, width=310, height=200, html=text)
# Radiobuttons
gump.startGroup(0)
gump.addRadioButton(x=20, y=160, off=0x25F8, on=0x25FB, id=1)
gump.addText(x=55, y=165, text="Multi Txt", hue=0x835)
gump.addRadioButton(x=150, y=160, off=0x25F8, on=0x25FB, id=2, selected=1)
gump.addText(x=185, y=165, text="WSC", hue=0x835)
gump.addRadioButton(x=250, y=160, off=0x25F8, on=0x25FB, id=3)
gump.addText(x=285, y=165, text="Text", hue=0x835)
gump.addRadioButton(x=20, y=120, off=0x25F8, on=0x25FB, id=4)
gump.addText(x=55, y=125, text="Sphere 51a", hue=0x835)
# gump.addRadioButton( x=150, y=120, off=0x25f8, on=0x25fb, id=5 )
# gump.addText( x=185, y=125, text='Sphere 55i', hue=0x835 )
# InputField
gump.addResizeGump(x=20, y=210, id=0xBB8, width=310, height=25)
gump.addInputField(x=25, y=212, width=295, height=20, hue=0x834, id=1, starttext="export.wsc")
gump.addText(x=265, y=250, text="Import", hue=0x835)
gump.addButton(x=310, y=250, up=0x26AF, down=0x26B1, returncode=1)
gump.send(char)
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:35,代码来源:import.py
示例5: generate
def generate(self, arguments):
gump = cGump()
gump.callback = "system.craftmenu.CraftMenuResponse"
gump.setArgs([self.id] + arguments)
gump.setType(self.gumptype)
gump.startPage(0)
gump.addBackground(0x13BE, 530, 437)
gump.addTiledGump(10, 10, 510, 22, 0xA40)
gump.addTiledGump(10, 292, 150, 45, 0xA40)
gump.addTiledGump(165, 292, 355, 45, 0xA40)
gump.addTiledGump(10, 342, 510, 85, 0xA40)
gump.addTiledGump(10, 37, 200, 250, 0xA40)
gump.addTiledGump(215, 37, 305, 250, 0xA40)
gump.addCheckerTrans(10, 10, 510, 417)
if self.titleid > 0:
gump.addXmfHtmlGump(10, 12, 510, 20, self.titleid, color=0x7FFF)
else:
gump.addHtmlGump(10, 12, 510, 20, self.title)
gump.addXmfHtmlGump(10, 37, 200, 22, 1044010, color=0x7FFF)
gump.addXmfHtmlGump(215, 37, 305, 22, 1044011, color=0x7FFF)
gump.addXmfHtmlGump(10, 302, 150, 25, 1044012, color=0x7FFF)
if self.noticeid > 0:
gump.addXmfHtmlGump(170, 295, 350, 40, self.noticeid, color=0x7FFF, canScroll=1)
elif len(self.noticestr) > 0:
gump.addHtmlGump(170, 295, 350, 40, whitehtml % self.noticestr, canScroll=1)
return gump
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:29,代码来源:craftmenu.py
示例6: gump11
def gump11(char, callback, item):
# security remove a co owner
gump_params = ["a house", "sign"]
mygump = cGump()
mygump.addRawLayout("{page 0}")
mygump.addRawLayout("{resizepic 0 0 5054 420 440}")
mygump.addRawLayout("{gumppictiled 10 10 400 100 2624}")
mygump.addRawLayout("{checkertrans 10 10 400 100}")
mygump.addRawLayout("{gumppictiled 10 120 400 260 2624}")
mygump.addRawLayout("{checkertrans 10 120 400 260}")
mygump.addRawLayout("{gumppictiled 10 390 400 40 2624}")
mygump.addRawLayout("{checkertrans 10 390 400 40}")
mygump.addRawLayout("{button 250 410 4005 4007 1 0 0}")
mygump.addRawLayout("{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}")
mygump.addRawLayout("{gumppic 10 10 100}")
mygump.addRawLayout("{text 62 43 0 0}")
mygump.addRawLayout("{text 74 57 0 1}")
# remove button cause change of callback
# ~ mygump.addRawLayout( "{button 10 390 4005 4007 1 0 31}" )
mygump.addRawLayout("{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}")
# ~ mygump.addRawLayout( "{button 10 410 4005 4007 1 0 46}" )
mygump.addRawLayout("{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}")
# ~ mygump.addRawLayout( "{button 150 10 4005 4007 1 0 2}" )
mygump.addRawLayout("{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 32767}")
# ~ mygump.addRawLayout( "{button 150 30 4006 4007 1 0 17}" )
mygump.addRawLayout("{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 16927}")
# ~ mygump.addRawLayout( "{button 150 50 4005 4007 1 0 32}" )
mygump.addRawLayout("{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 32767}")
# ~ mygump.addRawLayout( "{button 150 70 4005 4007 1 0 47}" )
mygump.addRawLayout("{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 32767}")
# ~ mygump.addRawLayout( "{button 150 90 4005 4007 1 0 62}" )
mygump.addRawLayout("{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}") # end of common part with gump0
# mygump.addRawLayout( "{button 10 130 4005 4007 1 0 4}" ) # button see title next line
mygump.addRawLayout("{xmfhtmlgumpcolor 45 130 240 20 1011274 0 0 32767}") # View Remove a co-owner from the house
# ~ mygump.addRawLayout( "{text 45 170 1152 2}" )#~ mygump.addRawLayout( "{text 45 150 1152 2}" ) #ecrit le parametre 2 en blanc
offsetx = 0
offsety = 0
members = getCoOwners(item.multi)
# ~ char.socket.sysmessage('liste %s'%members)
for memberserial in members:
try:
member = wolfpack.findchar(int(memberserial))
mygump.addButton(15 + offsety, 150 + offsetx, 0xFA5, 0xFA7, member.serial)
# ~ mygump.addText( 15 +offsety, 150+offsetx, unicode(' *'), 1152)
mygump.addText(49 + offsety, 150 + offsetx, unicode(member.name), 1152)
if offsetx == 192:
offsetx = 0
offsety += 200
else:
offsetx += 24
except:
pass
mygump.setCallback(callbackremovecoowner)
mygump.setArgs([item])
# Add params
for line in gump_params:
mygump.addRawText(line)
mygump.send(char)
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:60,代码来源:signpost.py
示例7: TrackWhatGump
def TrackWhatGump( char ):
gump = cGump( x=20, y=30, callback=trackWhatResponse, type=0x87651592 )
gump.startPage( 0 )
gump.addBackground( 5054, 440, 135 )
gump.addResizeGump( 10, 10, 2620, 420, 75 )
gump.addResizeGump( 10, 85, 3000, 420, 25 )
gump.addTilePic( 20, 20, 9682 )
gump.addButton( 20, 110, 4005, 4007, 1 )
gump.addXmfHtmlGump( 20, 90, 100, 20, 1018087 ) # Animals
gump.addTilePic( 120, 20, 9607 )
gump.addButton( 120, 110, 4005, 4007, 2 )
gump.addXmfHtmlGump( 120, 90, 100, 20, 1018088 ) # Monsters
gump.addTilePic( 220, 20, 8454 )
gump.addButton( 220, 110, 4005, 4007, 3 )
gump.addXmfHtmlGump( 220, 90, 100, 20, 1018089 ) # Human NPCs
gump.addTilePic( 320, 20, 8455 )
gump.addButton( 320, 110, 4005, 4007, 4 )
gump.addXmfHtmlGump( 320, 90, 100, 20, 1018090 ) # Players
gump.send( char )
char.socket.settag( 'skill_delay', int( wolfpack.time.currenttime() + TRACKING_DELAY ) )
if skills.skilltable[ TRACKING ][ skills.UNHIDE ] and char.hidden:
char.reveal()
return True
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:31,代码来源:tracking.py
示例8: gump0
def gump0( char, callback, item ):
gump_params = [
"a house",
"sign",
"admin",
"2003-05-22 17:57:40",
"",
"30500",
"0"]
mygump = cGump()
mygump.addRawLayout( "{page 0}" )
mygump.addRawLayout( "{resizepic 0 0 5054 420 440}" )
mygump.addRawLayout( "{gumppictiled 10 10 400 100 2624}" )
mygump.addRawLayout( "{checkertrans 10 10 400 100}" )
mygump.addRawLayout( "{gumppictiled 10 120 400 260 2624}" )
mygump.addRawLayout( "{checkertrans 10 120 400 260}" )
mygump.addRawLayout( "{gumppictiled 10 390 400 40 2624}" )
mygump.addRawLayout( "{checkertrans 10 390 400 40}" )
mygump.addRawLayout( "{button 250 410 4005 4007 1 0 0}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}" )
mygump.addRawLayout( "{gumppic 10 10 100}" )
mygump.addRawLayout( "{text 62 43 0 0}" )
mygump.addRawLayout( "{text 74 57 0 1}" )
mygump.addRawLayout( "{button 10 390 4005 4007 1 0 31}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}" )
mygump.addRawLayout( "{button 10 410 4005 4007 1 0 46}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}" )
mygump.addRawLayout( "{button 150 10 4006 4007 1 0 2}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 16927}" )
mygump.addRawLayout( "{button 150 30 4005 4007 1 0 17}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 32767}" )
mygump.addRawLayout( "{button 150 50 4005 4007 1 0 32}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 32767}" )
mygump.addRawLayout( "{button 150 70 4005 4007 1 0 47}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 32767}" )
mygump.addRawLayout( "{button 150 90 4005 4007 1 0 62}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 20 130 200 20 1011242 0 0 32767}" )
mygump.addRawLayout( "{text 210 130 1152 2}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 20 170 380 20 1018032 0 0 16927}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 20 190 380 20 1018035 0 0 16927}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 20 210 380 20 1060681 0 0 16927}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 20 230 380 20 1060679 0 0 16927}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 20 250 380 20 1062209 0 0 16927}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 20 290 200 20 1060692 0 0 16927}" )
mygump.addRawLayout( "{text 250 290 1152 3}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 20 310 200 20 1060693 0 0 16927}" )
mygump.addRawLayout( "{text 250 310 1152 4}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 20 330 200 20 1061793 0 0 16927}" )
mygump.addRawLayout( "{text 250 330 1152 5}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 20 360 300 20 1011241 0 0 16927}" )
mygump.addRawLayout( "{text 350 360 1152 6}" )
mygump.setCallback( callback )
mygump.setArgs( [item] )
#Add params
for line in gump_params:
mygump.addRawText( line )
mygump.send( char )
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:59,代码来源:signpost.py
示例9: gump12
def gump12(char, callback, item):
# security view friends list
gump_params = ["a house", "sign"]
mygump = cGump()
mygump.addRawLayout("{page 0}")
mygump.addRawLayout("{resizepic 0 0 5054 420 440}")
mygump.addRawLayout("{gumppictiled 10 10 400 100 2624}")
mygump.addRawLayout("{checkertrans 10 10 400 100}")
mygump.addRawLayout("{gumppictiled 10 120 400 260 2624}")
mygump.addRawLayout("{checkertrans 10 120 400 260}")
mygump.addRawLayout("{gumppictiled 10 390 400 40 2624}")
mygump.addRawLayout("{checkertrans 10 390 400 40}")
mygump.addRawLayout("{button 250 410 4005 4007 1 0 0}")
mygump.addRawLayout("{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}")
mygump.addRawLayout("{gumppic 10 10 100}")
mygump.addRawLayout("{text 62 43 0 0}")
mygump.addRawLayout("{text 74 57 0 1}")
mygump.addRawLayout("{button 10 390 4005 4007 1 0 31}")
mygump.addRawLayout("{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}")
mygump.addRawLayout("{button 10 410 4005 4007 1 0 46}")
mygump.addRawLayout("{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}")
mygump.addRawLayout("{button 150 10 4005 4007 1 0 2}")
mygump.addRawLayout("{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 32767}")
mygump.addRawLayout("{button 150 30 4006 4007 1 0 17}")
mygump.addRawLayout("{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 16927}")
mygump.addRawLayout("{button 150 50 4005 4007 1 0 32}")
mygump.addRawLayout("{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 32767}")
mygump.addRawLayout("{button 150 70 4005 4007 1 0 47}")
mygump.addRawLayout("{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 32767}")
mygump.addRawLayout("{button 150 90 4005 4007 1 0 62}")
mygump.addRawLayout("{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}") # end of common part with gump0
# mygump.addRawLayout( "{button 10 130 4005 4007 1 0 4}" ) # button see title next line
mygump.addRawLayout("{xmfhtmlgumpcolor 45 130 240 20 1011243 0 0 32767}") # View friend List
offsetx = 0
offsety = 0
members = getFriends(item.multi)
for memberserial in members:
try:
member = wolfpack.findchar(int(memberserial))
# ~ mygump.addButton( 15 +offsety, 150+offsetx, 0xFA5, 0xFA7, member.serial )
mygump.addText(15 + offsety, 150 + offsetx, unicode(" *"), 1152)
mygump.addText(49 + offsety, 150 + offsetx, unicode(member.name), 1152)
if offsetx == 192:
offsetx = 0
offsety += 200
else:
offsetx += 24
except:
pass
mygump.setCallback(callback)
mygump.setArgs([item])
# Add params
for line in gump_params:
mygump.addRawText(line)
mygump.send(char)
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:57,代码来源:signpost.py
示例10: details
def details(char, player):
if not player.socket:
char.socket.sysmessage('The player is currently offline.')
return
pos = player.pos
account = player.account
# Socket Information
gump = cGump( 0, 0, 0, 50, 50 )
gump.addBackground( 0xE10, 440, 340 )
gump.addResizeGump( 195, 260, 0xBB8, 205, 20 )
gump.addCheckerTrans( 15, 15, 410, 310 )
gump.addGump( 160, 18, 0xFA2 )
gump.addText( 195, 20, unicode( "Socket Menu" ), 0x530 )
gump.addText( 70, 300, unicode("Close"), 0x834 )
gump.addButton( 30, 300, 0xFB1, 0xFB3, 0 )
gump.startPage( 1 )
gump.addText( 50, 60, unicode( "Char name:" ), 0x834 )
gump.addText( 250, 60, unicode( "%s" % player.name ), 0x834 )
gump.addText( 50, 80, unicode( "IP:" ), 0x834 )
gump.addText( 250, 80, unicode( "%s" % player.socket.address ), 0x834 )
gump.addText( 50, 100, unicode( "Position:" ), 0x834 )
gump.addText( 250, 100, unicode( "%i,%i,%i,%i" % ( pos.x, pos.y, pos.z, pos.map ) ), 0x834 )
gump.addText( 50, 120, unicode( "Region:" ), 0x834 )
if player.region:
gump.addText( 250, 120, unicode( "%s" % unicode(player.region.name) ), 0x834 )
else:
gump.addText( 250, 120, "Unknown", 0x834 )
gump.addText( 50, 140, unicode( "Account / ACL:" ), 0x834 )
gump.addText( 250, 140, unicode( "%s / %s" % ( account.name, account.acl) ), 0x834 )
# Actions
# Go To Char
gump.addButton( 20, 180, 0xFA5, 0xFA7, 1 )
gump.addText( 50, 180, unicode( "Go to position" ), 0x834 )
# Bring Char
gump.addButton( 20, 200, 0xFA5, 0xFA7, 2 )
gump.addText( 50, 200, unicode( "Bring char" ), 0x834 )
# Jail Char
gump.addButton( 20, 220, 0xFA5, 0xFA7, 3 )
gump.addText( 50, 220, unicode( "Jail char" ), 0x834 )
# Forgive Char
gump.addButton( 220, 220, 0xFA5, 0xFA7, 4 )
gump.addText( 250, 220, unicode( "Forgive char" ), 0x834 )
# Show Char Info Gump
gump.addButton( 220, 180, 0xFAB, 0xFAD, 5 )
gump.addText( 250, 180, unicode( "Show char info gump" ), 0x834 )
# Send Message
gump.addButton( 20, 260, 0xFBD, 0xFBF, 6 )
gump.addText( 50, 260, unicode( "Send message:" ), 0x834 )
gump.addInputField( 200, 260, 190, 16, 0x834, 1, unicode( "<msg>" ) )
# Disconnect
gump.addButton( 220, 200, 0xFA5, 0xFA7, 7 )
gump.addText( 250, 200, unicode( "Disconnect" ), 0x834 )
# Stuff and Send
gump.setCallback( "commands.who.callbackSocket" )
gump.setArgs( [ player.serial ] )
gump.send( char.socket )
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:57,代码来源:who.py
示例11: gump
def gump( listener, speaker ):
gump = cGump( 0, 0, 0, 50, 50 )
gump.addBackground( 0x24a4, 425, 400 )
gump.startPage( 0 )
gump.addHtmlGump( 10, 30, 450, 20, '<basefont size="7" color="#336699"><center>Barber shop</center></basefont>' )
gump.addTilePic( 155, 31, 0xDFD )
gump.addPageButton( 40, 61, 0x4B9, 0x4BA, 0x11 )
gump.addHtmlGump( 60, 60, 100, 20, '<basefont color="#333333"><u>Hair</u></basefont>' )
gump.addPageButton( 40, 81, 0x4B9, 0x4BA, 0x31 )
gump.addHtmlGump( 60, 80, 100, 20, u'<basefont color="#333333"><u>Hair dye</u></basefont>' )
# Page Switches (only for men)
if speaker.id == 0x190:
gump.addPageButton( 190, 61, 0x4B9, 0x4BA, 0x21 )
gump.addHtmlGump( 210, 60, 100, 20, '<basefont color="#333333"><u>Beard</u></basefont>' )
# Hair
addHairfarbePage( speaker, gump, 0x31, 0x0E27 ) # hair dye
# Hair
addHairPage( speaker, gump, 0x11, 0x203B ) # Short Hair
addHairPage( speaker, gump, 0x12, 0x203C ) # Long Hair
addHairPage( speaker, gump, 0x13, 0x203D ) # Ponytail
addHairPage( speaker, gump, 0x14, 0x2044 ) # Mohawk
addHairPage( speaker, gump, 0x15, 0x2045 ) # Pageboy
addHairPage( speaker, gump, 0x16, 0x2046 ) # Buns hair
addHairPage( speaker, gump, 0x17, 0x2047 ) # Afro
addHairPage( speaker, gump, 0x18, 0x2048 ) # Receding hair
addHairPage( speaker, gump, 0x19, 0x2049 ) # 2 pig-tails
addHairPage( speaker, gump, 0x1A, 0x204a ) # Krisna Hair
addHairPage( speaker, gump, 0x1B, 0x0000 ) # None
if speaker.id == 0x190:
# Beard
gump.startPage( 0x21 )
# BEARDS
addBeardPage( speaker, gump, 0x21, 0x203E ) # Long Beard
addBeardPage( speaker, gump, 0x22, 0x203F ) # Short Beard
addBeardPage( speaker, gump, 0x23, 0x2040 ) # Goatee
addBeardPage( speaker, gump, 0x24, 0x2041 ) # Mustache
addBeardPage( speaker, gump, 0x25, 0x204B ) # Med Short Beard
addBeardPage( speaker, gump, 0x26, 0x204C ) # Med Long Beard
addBeardPage( speaker, gump, 0x27, 0x204D ) # Vandyke
addBeardPage( speaker, gump, 0x28, 0x0000 ) # None
gump.startPage( 0 )
gump.addButton( 350, 335, 2119, 2120, 0 ) # Cancel
gump.setCallback( "speech.barber.gump_callback" )
gump.setArgs( [ listener.serial ] )
gump.send( speaker )
return 1
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:56,代码来源:barber.py
示例12: onUse
def onUse(player, item):
if player.gm:
if not item.hastag( 'target' ):
item.settag( 'target', "0,0,0,0" )
if item.hastag( 'target' ):
target = item.gettag('target').split(',')
pos = player.pos
x = target[0]
y = target[1]
z = target[2]
map = target[3]
# create gump
gump = cGump( 0, 0, 0, 50, 50 )
# Header
gump.addBackground( 0x24a4, 300, 280 )
gump.addHtmlGump( 10, 30, 300, 20, tr('<basefont size="7" color="#336699"><center>Set target for teleportaion</center></basefont>') )
# Input Fields
gump.addHtmlGump( 40, 60, 300, 20, 'x-Pos:' )
gump.addResizeGump( 90, 60, 0x2486, 156, 26 )
gump.addInputField( 93, 63, 150, 20, 0x539, 1, x )
gump.addHtmlGump( 40, 80, 300, 20, 'y-Pos:' )
gump.addResizeGump( 90, 80, 0x2486, 156, 26 )
gump.addInputField( 93, 83, 150, 20, 0x539, 2, y )
gump.addHtmlGump( 40, 100, 300, 20, 'z-Pos:' )
gump.addResizeGump( 90, 100, 0x2486, 156, 26 )
gump.addInputField( 93, 103, 150, 20, 0x539, 3, z )
gump.addHtmlGump( 40, 120, 300, 20, 'Map:' )
gump.addResizeGump( 90, 120, 0x2486, 156, 26 )
gump.addInputField( 93, 123, 150, 20, 0x539, 4, map )
playersonly = item.hastag('playersonly')
gump.addCheckbox(40, 160, 0xd2, 0xd3, 1, playersonly )
gump.addHtmlGump( 70, 160, 300, 20, 'Players only' )
silent = item.hastag('silent')
gump.addCheckbox(40, 190, 0xd2, 0xd3, 2, silent )
gump.addHtmlGump( 70, 190, 300, 20, 'Silent' )
gump.addButton( 83, 225, 2128, 2129, 1000 ) # Ok
gump.addButton( 150, 225, 2119, 2120, 0 ) # Cancel
gump.setCallback( gate_callback )
gump.setArgs( [ item ] )
gump.send( player )
return True
else:
return True
开发者ID:Mutilador,项目名称:Wolfpack,代码行数:55,代码来源:gate.py
示例13: gump3
def gump3(char, callback, item):
gump_params = [str(item.multi.name), "sign"]
mygump = cGump()
mygump.addRawLayout("{page 0}")
mygump.addRawLayout("{resizepic 0 0 5054 420 440}")
mygump.addRawLayout("{gumppictiled 10 10 400 100 2624}")
mygump.addRawLayout("{checkertrans 10 10 400 100}")
mygump.addRawLayout("{gumppictiled 10 120 400 260 2624}")
mygump.addRawLayout("{checkertrans 10 120 400 260}")
mygump.addRawLayout("{gumppictiled 10 390 400 40 2624}")
mygump.addRawLayout("{checkertrans 10 390 400 40}")
mygump.addRawLayout("{button 250 410 4005 4007 1 0 0}")
mygump.addRawLayout("{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}")
mygump.addRawLayout("{gumppic 10 10 100}")
mygump.addRawLayout("{text 62 43 0 0}")
mygump.addRawLayout("{text 74 57 0 1}")
mygump.addRawLayout("{button 10 390 4005 4007 1 0 31}")
mygump.addRawLayout("{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}")
mygump.addRawLayout("{button 10 410 4005 4007 1 0 46}")
mygump.addRawLayout("{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}")
mygump.addRawLayout("{button 150 10 4005 4007 1 0 2}")
mygump.addRawLayout("{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 32767}")
mygump.addRawLayout("{button 150 30 4005 4007 1 0 17}")
mygump.addRawLayout("{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 32767}")
mygump.addRawLayout("{button 150 50 4005 4007 1 0 32}")
mygump.addRawLayout("{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 32767}")
mygump.addRawLayout("{button 150 70 4006 4007 1 0 47}")
mygump.addRawLayout("{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 16927}")
mygump.addRawLayout("{button 150 90 4005 4007 1 0 62}")
mygump.addRawLayout("{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}")
mygump.addRawLayout("{xmfhtmlgumpcolor 45 120 240 20 1060759 0 0 16912}")
# Customize this House - Just to Custom Houses (Checked by wich script sign has)
if item.hasscript("signpost"):
mygump.addRawLayout("{button 10 160 4005 4007 1 0 21}")
mygump.addRawLayout("{xmfhtmlgumpcolor 45 160 240 20 1060765 0 0 32767}")
else:
mygump.addRawLayout("{xmfhtmlgumpcolor 45 160 240 20 1060765 0 0 16912}")
mygump.addRawLayout("{xmfhtmlgumpcolor 45 180 240 20 1060760 0 0 16912}")
mygump.addRawLayout("{xmfhtmlgumpcolor 45 210 240 20 1060761 0 0 16912}")
mygump.addRawLayout("{button 10 230 4005 4007 1 0 66}")
mygump.addRawLayout("{xmfhtmlgumpcolor 45 230 240 20 1060762 0 0 32767}")
mygump.addRawLayout("{button 10 250 4005 4007 1 0 81}")
mygump.addRawLayout("{xmfhtmlgumpcolor 45 250 240 20 1060763 0 0 32767}")
mygump.addRawLayout("{button 10 280 4005 4007 1 0 96}")
mygump.addRawLayout("{xmfhtmlgumpcolor 45 280 240 20 1062004 0 0 32767}")
mygump.addRawLayout("{button 10 310 4005 4007 1 0 111}") # rename house
mygump.addRawLayout("{xmfhtmlgumpcolor 45 310 240 20 1060764 0 0 32767}")
mygump.setCallback(callback)
mygump.setArgs([item])
# Add params
for line in gump_params:
mygump.addRawText(line)
mygump.send(char)
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:55,代码来源:signpost.py
示例14: npcquestmenu
def npcquestmenu(npc, player, questamount):
if player.socket:
player.socket.closegump( TYPE_QUEST_GUMP )
dialog = cGump( x=100, y=30, type=TYPE_QUEST_GUMP )
dialog.addResizeGump(37, 14, 9260, 445, 422)
dialog.addTiledGump(81, 35, 358, 386, 5124, 0)
dialog.addTiledGump(55, 32, 30, 391, 10460, 0)
dialog.addTiledGump(439, 32, 30, 391, 10460, 0)
dialog.addGump(-12, 290, 10402, 0)
dialog.addGump(53, 137, 10411, 0)
dialog.addGump(95, 39, 9005, 0)
dialog.addTiledGump(40, 421, 440, 17, 10100, 0)
dialog.addTiledGump(39, 15, 440, 17, 10100, 0)
dialog.addGump(4, 16, 10421, 0)
dialog.addGump(21, 4, 10420, 0)
dialog.addGump(449, 162, 10411, 0)
dialog.addGump(449, 323, 10412, 0)
dialog.addGump(394, 52, 1417, 0)
dialog.addGump(449, 3, 10410, 0)
dialog.addGump(402, 61, 9012, 0)
dialog.addText(135, 49, "Quest List", 1149)
if npc.region:
dialog.addText(136, 79, npc.name + ", from: " + npc.region.name, 1149)
else:
dialog.addText(136, 79, npc.name, 1149)
dialog.addTiledGump(139, 69, 161, 2, 2432, 0)
dialog.addButton(338, 394, 12012, 12013, 0)
# Temporary storage
tempy = 142
# Loop for Quests
quests = returnquestlist(npc)
for i in range( 0, questamount ):
id = str( quests[i] )
if checkquestrequirements(player, id):
if not checkifquestcompleted(player, id):
dialog.addText(106, int(tempy), givequestname( id ), 1149)
dialog.addButton(391, int(tempy), 9904, 9905, i + 1)
else:
dialog.addText(106, int(tempy), givequestname( id ), 908)
dialog.addGump(391, int(tempy), 9903, 0)
tempy += 21
dialog.setArgs( [quests, npc] )
dialog.setCallback( questlistresponse )
dialog.send( player )
开发者ID:Mutilador,项目名称:Wolfpack,代码行数:55,代码来源:npcs.py
示例15: callback
def callback(char, args, target):
socket = char.socket
# Upper left Corner
if len(args) == 0:
if target.item and target.item.container:
socket.sysmessage("This is an invalid target.")
return
socket.sysmessage("Target the lower right corner of the area you want to export.")
socket.attachtarget("commands.export.callback", [target.pos.x, target.pos.y])
# Lower Right Corner
elif len(args) == 2:
if target.item and target.item.container:
socket.sysmessage("This is an invalid target.")
return
# Create a gump to enter the output filename
x1 = min(args[0], target.pos.x)
x2 = max(args[0], target.pos.x)
y1 = min(args[1], target.pos.y)
y2 = max(args[1], target.pos.y)
gump = cGump(x=100, y=100, callback="commands.export.export", args=[x1, y1, x2, y2])
gump.addBackground(id=0x2436, width=350, height=300)
# gump.addCheckerTrans( 15, 15, 320, 270 )
text = (
'<basefont color="#FEFEFE"><h3>Export</h3><br><basefont color="#FEFEFE"><u>X1</u>,<u>Y1</u>: %u,%u<br><u>X2</u>,<u>Y2</u>: %u,%u<br><br>Enter the filename for your exported items below. Use the radio buttons to choose the export format.'
% (x1, y1, x2, y2)
)
gump.addHtmlGump(x=20, y=20, width=310, height=200, html=text)
# Radiobuttons
gump.startGroup(0)
gump.addRadioButton(x=20, y=160, off=0x25F8, on=0x25FB, id=1)
gump.addText(x=55, y=165, text="Sphere 51a", hue=0x835)
gump.addRadioButton(x=150, y=160, off=0x25F8, on=0x25FB, id=2, selected=1)
gump.addText(x=185, y=165, text="WSC", hue=0x835)
gump.addRadioButton(x=250, y=160, off=0x25F8, on=0x25FB, id=3)
gump.addText(x=285, y=165, text="Text", hue=0x835)
# InputField
gump.addResizeGump(x=20, y=210, id=0xBB8, width=310, height=25)
gump.addInputField(x=25, y=212, width=295, height=20, hue=0x834, id=1, starttext="export.wsc")
gump.addText(x=265, y=250, text="Export", hue=0x835)
gump.addButton(x=310, y=250, up=0x26AF, down=0x26B1, returncode=1)
gump.send(char)
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:54,代码来源:export.py
示例16: gump3
def gump3( char, callback, item ):
gump_params = [
"a house",
"sign"]
mygump = cGump()
mygump.addRawLayout( "{page 0}" )
mygump.addRawLayout( "{resizepic 0 0 5054 420 440}" )
mygump.addRawLayout( "{gumppictiled 10 10 400 100 2624}" )
mygump.addRawLayout( "{checkertrans 10 10 400 100}" )
mygump.addRawLayout( "{gumppictiled 10 120 400 260 2624}" )
mygump.addRawLayout( "{checkertrans 10 120 400 260}" )
mygump.addRawLayout( "{gumppictiled 10 390 400 40 2624}" )
mygump.addRawLayout( "{checkertrans 10 390 400 40}" )
mygump.addRawLayout( "{button 250 410 4005 4007 1 0 0}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}" )
mygump.addRawLayout( "{gumppic 10 10 100}" )
mygump.addRawLayout( "{text 62 43 0 0}" )
mygump.addRawLayout( "{text 74 57 0 1}" )
mygump.addRawLayout( "{button 10 390 4005 4007 1 0 31}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}" )
mygump.addRawLayout( "{button 10 410 4005 4007 1 0 46}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}" )
mygump.addRawLayout( "{button 150 10 4005 4007 1 0 2}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 32767}" )
mygump.addRawLayout( "{button 150 30 4005 4007 1 0 17}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 32767}" )
mygump.addRawLayout( "{button 150 50 4005 4007 1 0 32}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 32767}" )
mygump.addRawLayout( "{button 150 70 4006 4007 1 0 47}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 16927}" )
mygump.addRawLayout( "{button 150 90 4005 4007 1 0 62}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 45 120 240 20 1060759 0 0 16912}" )
mygump.addRawLayout( "{button 10 160 4005 4007 1 0 21}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 45 160 240 20 1060765 0 0 32767}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 45 180 240 20 1060760 0 0 16912}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 45 210 240 20 1060761 0 0 16912}" )
mygump.addRawLayout( "{button 10 230 4005 4007 1 0 66}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 45 230 240 20 1060762 0 0 32767}" )
mygump.addRawLayout( "{button 10 250 4005 4007 1 0 81}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 45 250 240 20 1060763 0 0 32767}" )
mygump.addRawLayout( "{button 10 280 4005 4007 1 0 96}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 45 280 240 20 1062004 0 0 32767}" )
mygump.addRawLayout( "{button 10 310 4005 4007 1 0 111}" )
mygump.addRawLayout( "{xmfhtmlgumpcolor 45 310 240 20 1060764 0 0 32767}" )
mygump.setCallback( callback )
mygump.setArgs( [item] )
#Add params
for line in gump_params:
mygump.addRawText( line )
mygump.send( char )
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:53,代码来源:signpost.py
示例17: npcreportlist
def npcreportlist(npc, player):
if player.socket:
player.socket.closegump( TYPE_QUEST_GUMP )
dialog = cGump( x=100, y=30, type=TYPE_QUEST_GUMP )
dialog.addResizeGump(37, 14, 9260, 445, 422)
dialog.addTiledGump(81, 35, 358, 386, 5124, 0)
dialog.addTiledGump(55, 32, 30, 391, 10460, 0)
dialog.addTiledGump(439, 32, 30, 391, 10460, 0)
dialog.addGump(-12, 290, 10402, 0)
dialog.addGump(53, 137, 10411, 0)
dialog.addGump(95, 39, 9005, 0)
dialog.addTiledGump(40, 421, 440, 17, 10100, 0)
dialog.addTiledGump(39, 15, 440, 17, 10100, 0)
dialog.addGump(4, 16, 10421, 0)
dialog.addGump(21, 4, 10420, 0)
dialog.addGump(449, 162, 10411, 0)
dialog.addGump(449, 323, 10412, 0)
dialog.addGump(394, 52, 1417, 0)
dialog.addGump(449, 3, 10410, 0)
dialog.addGump(402, 61, 9012, 0)
dialog.addText(135, 49, "Quest Report", 1149)
if npc.region:
dialog.addText(136, 79, npc.name + ", from: " + npc.region.name, 1149)
else:
dialog.addText(136, 79, npc.name, 1149)
dialog.addTiledGump(139, 69, 161, 2, 2432, 0)
dialog.addButton(338, 394, 12012, 12013, 0)
# Temporary storage
tempy = 142
# Loop for Quests
for i in range(1, 11):
if player.hastag('Quest.'+ str(i) +'.NPCDest'):
serialdest = player.gettag('Quest.'+ str(i) +'.NPCDest')
if str(npc.serial) == str(serialdest):
id = player.gettag('Quest.'+ str(i) +'.ID')
dialog.addButton(391, int(tempy), 9904, 9905, i)
dialog.addText(106, int(tempy), givequestname( id ), 1149)
tempy += 21
dialog.setArgs( [npc] )
dialog.setCallback( npcreportresponse )
dialog.send( player )
开发者ID:Mutilador,项目名称:Wolfpack,代码行数:52,代码来源:npcs.py
示例18: cmdWho
def cmdWho( socket, command, argstring ):
wholist = []
worldsocketcount = wolfpack.sockets.count()
worldsocket = wolfpack.sockets.first()
while worldsocket:
wholist += [ worldsocket.player.serial ]
worldsocket = wolfpack.sockets.next()
if len(wholist) == 0:
return False
gump = cGump( 0, 0, 0, 50, 50 )
gump.addBackground( 0xE10, 380, 360 )
gump.addCheckerTrans( 15, 15, 350, 330 );
gump.addGump( 130, 18, 0xFA8 )
gump.addText( 165, 20, unicode("Who Menu"), 0x530 )
# Close Button
gump.addButton( 30, 320, 0xFB1, 0xFB3, 0 )
gump.addText( 70, 320, unicode("Close"), 0x834 )
# Start The First Page
# Notes, 10 per page
# Pages to create, (( socketcount / 10) + 1 )
# Player list increases by 22 pixels
maxpages = ((worldsocketcount / 10) + 1)
page = 0
serialcount = 0
while page <= maxpages:
page += 1
gump.startPage( page )
gump.addText( 280, 320, unicode( "Page %i of %i" % ( page, maxpages ) ), 0x834 )
if page < maxpages:
gump.addPageButton( 260, 320, 0x0FA, 0x0FA, page + 1 )
if page > 1:
gump.addPageButton( 240, 320, 0x0FC, 0x0FC, page - 1 )
upby = 22
for serial in wholist:
if not serial:
break
player = wolfpack.findchar( serial )
# serialcount + 10 for callback, we will -10 there and look at wholist.
gump.addButton( 20, 40 + upby, 0xFA5, 0xFA7, ( serialcount + 10 ) )
gump.addText( 50, 40 + upby, unicode( "%s [%s]" % ( player.name, player.account.name ) ), 0x834 )
gump.addText( 240, 40 + upby, unicode( "%s" % player.socket.address ), 0x834 )
upby += 22
serialcount += 1
if serialcount == ((page * 10) - 1):
break
gump.setArgs( [ wholist ] )
gump.setCallback( "commands.who.callbackWho" )
gump.send( socket )
return
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:52,代码来源:who.py
-
Python入门教程 Python 是一种解释型、面向对象、动态数据类型的高级程序设计语言。 P
阅读:13776|2022-01-22
-
Python wikiutil.getFrontPage函数代码示例
阅读:9602|2022-05-24
-
Python 简介 Python 是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本
阅读:4068|2022-01-22
-
Python tests.group函数代码示例
阅读:4039|2022-05-27
-
Python util.check_if_user_has_permission函数代码示例
阅读:3819|2022-05-27
-
Python 练习实例98 Python 100例题目:从键盘输入一个字符串,将小写字母全部转换成大
阅读:3501|2022-01-22
-
Python 环境搭建 本章节我们将向大家介绍如何在本地搭建 Python 开发环境。 Py
阅读:3024|2022-01-22
-
Python output.darkgreen函数代码示例
阅读:2639|2022-05-25
-
Python 基础语法 Python 语言与 Perl,C 和 Java 等语言有许多相似之处。但是,也
阅读:2627|2022-01-22
-
Python 中文编码前面章节中我们已经学会了如何用 Python 输出 Hello, World!,英文没
阅读:2290|2022-01-22
|
请发表评论