You last visited: Today at 07:15
Advertisement
[HILFE]Farbiger Shop mit Gui
Discussion on [HILFE]Farbiger Shop mit Gui within the Metin2 Private Server forum part of the Metin2 category.
02/10/2015, 21:53
#1
elite*gold: 0
Join Date: Apr 2014
Posts: 168
Received Thanks: 8
[HILFE]Farbiger Shop mit Gui
Guten abend ePvP user!
Ich war mal etwas aktiver auf Türkischen und anderen ausländischen Metin2 Foren und hab folgendes gesehen:
Wenn man ein shop eröffnen möchte war da ein kleines gui, wo man die farbe des shops einstellen konnte. nun hab ich versucht dies einzufügen, doch leider erfolgslos. ich hab mal eine kleine fotocollage erstellt:
hier meine uiprivateshopbuilder.py
PHP Code:
import ui
import snd
import shop
import mouseModule
import player
import chr
import net
import uiCommon
import locale
import chat
import item
import grp
g_isBuildingPrivateShop = FALSE
g_itemPriceDict ={}
def Clear ():
global g_itemPriceDict
global g_isBuildingPrivateShop
g_itemPriceDict ={}
g_isBuildingPrivateShop = FALSE
def IsPrivateShopItemPriceList ():
global g_itemPriceDict
if g_itemPriceDict :
return TRUE
else:
return FALSE
def IsBuildingPrivateShop ():
global g_isBuildingPrivateShop
if player . IsOpenPrivateShop () or g_isBuildingPrivateShop :
return TRUE
else:
return FALSE
def SetPrivateShopItemPrice ( itemVNum , itemPrice ):
global g_itemPriceDict
g_itemPriceDict [ int ( itemVNum )]= itemPrice
def GetPrivateShopItemPrice ( itemVNum ):
try:
global g_itemPriceDict
return g_itemPriceDict [ itemVNum ]
except KeyError :
return 0
class PrivateShopAdvertisementBoard ( ui . ThinBoard ):
def __init__ ( self ):
ui . ThinBoard . __init__ ( self , "UI_BOTTOM" )
self . vid = None
self . __MakeTextLine ()
def __del__ ( self ):
ui . ThinBoard . __del__ ( self )
def __MakeTextLine ( self ):
self . textLine = ui . TextLine ()
self . textLine . SetParent ( self )
self . textLine . SetWindowHorizontalAlignCenter ()
self . textLine . SetWindowVerticalAlignCenter ()
self . textLine . SetHorizontalAlignCenter ()
self . textLine . SetVerticalAlignCenter ()
self . textLine . Show ()
def Open ( self , vid , text ):
elf . vid = vid
splits = text . split ( '|' )
text2 = str ( splits [ 3 ])
kolor_r = int ( splits [ 0 ])
kolor_g = int ( splits [ 1 ])
kolor_b = int ( splits [ 2 ])
self . textLine . SetPackedFontColor ( grp . GenerateColor ( kolor_r * 0.00392156862745 , kolor_g * 0.00392156862745 , kolor_b * 0.00392156862745 , 1.0 ))
self . textLine . SetText ( text2 )
self . textLine . UpdateRect ()
self . SetSize ( len ( text2 )* 6 + 10 * 2 , 20 )
self . Show ()
g_privateShopAdvertisementBoardDict [ vid ] = self
def OnMouseLeftButtonUp ( self ):
if not self . vid :
return
net . SendOnClickPacket ( self . vid )
return TRUE
def OnUpdate ( self ):
if not self . vid :
return
x , y = chr . GetProjectPosition ( self . vid , 220 )
self . SetPosition ( x - self . GetWidth ()/ 2 , y - self . GetHeight ()/ 2 )
class PrivateShopBuilder ( ui . ScriptWindow ):
def __init__ ( self ):
#print "NEW MAKE_PRIVATE_SHOP_WINDOW ----------------------------------------------------------------"
ui . ScriptWindow . __init__ ( self )
self . __LoadWindow ()
self . itemStock = {}
self . tooltipItem = None
self . priceInputBoard = None
self . title = ""
def __del__ ( self ):
#print "------------------------------------------------------------- DELETE MAKE_PRIVATE_SHOP_WINDOW"
ui . ScriptWindow . __del__ ( self )
def __LoadWindow ( self ):
try:
pyScrLoader = ui . PythonScriptLoader ()
pyScrLoader . LoadScriptFile ( self , "UIScript/PrivateShopBuilder.py" )
except :
import exception
exception . Abort ( "PrivateShopBuilderWindow.LoadWindow.LoadObject" )
try:
GetObject = self . GetChild
self . nameLine = GetObject ( "NameLine" )
self . itemSlot = GetObject ( "ItemSlot" )
self . btnOk = GetObject ( "OkButton" )
self . btnClose = GetObject ( "CloseButton" )
self . titleBar = GetObject ( "TitleBar" )
except :
import exception
exception . Abort ( "PrivateShopBuilderWindow.LoadWindow.BindObject" )
self . btnOk . SetEvent ( ui . __mem_func__ ( self . OnOk ))
self . btnClose . SetEvent ( ui . __mem_func__ ( self . OnClose ))
self . titleBar . SetCloseEvent ( ui . __mem_func__ ( self . OnClose ))
self . itemSlot . SetSelectEmptySlotEvent ( ui . __mem_func__ ( self . OnSelectEmptySlot ))
self . itemSlot . SetSelectItemSlotEvent ( ui . __mem_func__ ( self . OnSelectItemSlot ))
self . itemSlot . SetOverInItemEvent ( ui . __mem_func__ ( self . OnOverInItem ))
self . itemSlot . SetOverOutItemEvent ( ui . __mem_func__ ( self . OnOverOutItem ))
def Destroy ( self ):
self . ClearDictionary ()
self . nameLine = None
self . itemSlot = None
self . btnOk = None
self . btnClose = None
self . titleBar = None
self . priceInputBoard = None
def Open ( self , title ):
self . title = title
if len ( title ) > 25 :
title = title [: 22 ] + "..."
self . itemStock = {}
shop . ClearPrivateShopStock ()
self . nameLine . SetText ( title )
self . SetCenterPosition ()
self . Refresh ()
self . Show ()
global g_isBuildingPrivateShop
g_isBuildingPrivateShop = TRUE
def Close ( self ):
global g_isBuildingPrivateShop
g_isBuildingPrivateShop = FALSE
self . title = ""
self . itemStock = {}
shop . ClearPrivateShopStock ()
self . Hide ()
def SetItemToolTip ( self , tooltipItem ):
self . tooltipItem = tooltipItem
def Refresh ( self ):
getitemVNum = player . GetItemIndex
getItemCount = player . GetItemCount
setitemVNum = self . itemSlot . SetItemSlot
delItem = self . itemSlot . ClearSlot
for i in xrange ( shop . SHOP_SLOT_COUNT ):
if not self . itemStock . has_key ( i ):
delItem ( i )
continue
pos = self . itemStock [ i ]
itemCount = getItemCount ( pos )
if itemCount <= 1 :
itemCount = 0
setitemVNum ( i , getitemVNum ( pos ), itemCount )
self . itemSlot . RefreshSlot ()
def OnSelectEmptySlot ( self , selectedSlotPos ):
isAttached = mouseModule . mouseController . isAttached ()
if isAttached :
attachedSlotType = mouseModule . mouseController . GetAttachedType ()
attachedSlotPos = mouseModule . mouseController . GetAttachedSlotNumber ()
mouseModule . mouseController . DeattachObject ()
if player . SLOT_TYPE_INVENTORY != attachedSlotType :
return
itemVNum = player . GetItemIndex ( attachedSlotPos )
item . SelectItem ( itemVNum )
if item . IsAntiFlag ( item . ITEM_ANTIFLAG_GIVE ) or item . IsAntiFlag ( item . ITEM_ANTIFLAG_MYSHOP ):
chat . AppendChat ( chat . CHAT_TYPE_INFO , locale . PRIVATE_SHOP_CANNOT_SELL_ITEM )
return
priceInputBoard = uiCommon . MoneyInputDialog ()
priceInputBoard . SetTitle ( locale . PRIVATE_SHOP_INPUT_PRICE_DIALOG_TITLE )
priceInputBoard . SetAcceptEvent ( ui . __mem_func__ ( self . AcceptInputPrice ))
priceInputBoard . SetCancelEvent ( ui . __mem_func__ ( self . CancelInputPrice ))
priceInputBoard . Open ()
itemPrice = GetPrivateShopItemPrice ( itemVNum )
if itemPrice > 0 :
priceInputBoard . SetValue ( itemPrice )
self . priceInputBoard = priceInputBoard
self . priceInputBoard . itemVNum = itemVNum
self . priceInputBoard . sourceSlotPos = attachedSlotPos
self . priceInputBoard . targetSlotPos = selectedSlotPos
def OnSelectItemSlot ( self , selectedSlotPos ):
isAttached = mouseModule . mouseController . isAttached ()
if isAttached :
snd . PlaySound ( "sound/ui/loginfail.wav" )
mouseModule . mouseController . DeattachObject ()
else:
if not selectedSlotPos in self . itemStock :
return
inventoryPos = self . itemStock [ selectedSlotPos ]
shop . DelPrivateShopItemStock ( inventoryPos )
snd . PlaySound ( "sound/ui/drop.wav" )
del self . itemStock [ selectedSlotPos ]
self . Refresh ()
def AcceptInputPrice ( self ):
if not self . priceInputBoard :
return TRUE
text = self . priceInputBoard . GetText ()
if not text :
return TRUE
if not text . isdigit ():
return TRUE
if int ( text ) <= 0 :
return TRUE
sourceSlotPos = self . priceInputBoard . sourceSlotPos
targetSlotPos = self . priceInputBoard . targetSlotPos
for privatePos , inventorySlotPos in self . itemStock . items ():
if inventorySlotPos == sourceSlotPos :
shop . DelPrivateShopItemStock ( targetSlotPos )
del self . itemStock [ privatePos ]
price = int ( self . priceInputBoard . GetText ())
if IsPrivateShopItemPriceList ():
SetPrivateShopItemPrice ( self . priceInputBoard . itemVNum , price )
shop . AddPrivateShopItemStock ( sourceSlotPos , targetSlotPos , price )
self . itemStock [ targetSlotPos ] = sourceSlotPos
snd . PlaySound ( "sound/ui/drop.wav" )
self . Refresh ()
#####
self . priceInputBoard = None
return TRUE
def CancelInputPrice ( self ):
self . priceInputBoard = None
return TRUE
def OnOk ( self ):
if not self . title :
return
if 0 == len ( self . itemStock ):
return
shop . BuildPrivateShop ( self . title )
self . Close ()
def OnClose ( self ):
self . Close ()
def OnPressEscapeKey ( self ):
self . Close ()
return TRUE
def OnOverInItem ( self , slotIndex ):
if self . tooltipItem :
if self . itemStock . has_key ( slotIndex ):
self . tooltipItem . SetPrivateShopBuilderItem ( self . itemStock [ slotIndex ], slotIndex )
def OnOverOutItem ( self ):
if self . tooltipItem :
self . tooltipItem . HideToolTip ()
und meine uicommon.py
PHP Code:
import ui
import locale
import app
import ime
import uiScriptLocale
class PopupDialog ( ui . ScriptWindow ):
def __init__ ( self ):
ui . ScriptWindow . __init__ ( self )
self . __LoadDialog ()
self . acceptEvent = lambda * arg : None
def __del__ ( self ):
ui . ScriptWindow . __del__ ( self )
def __LoadDialog ( self ):
try:
PythonScriptLoader = ui . PythonScriptLoader ()
PythonScriptLoader . LoadScriptFile ( self , "UIScript/PopupDialog.py" )
self . board = self . GetChild ( "board" )
self . message = self . GetChild ( "message" )
self . accceptButton = self . GetChild ( "accept" )
self . accceptButton . SetEvent ( ui . __mem_func__ ( self . Close ))
except :
import exception
exception . Abort ( "PopupDialog.LoadDialog.BindObject" )
def Open ( self ):
self . SetCenterPosition ()
self . SetTop ()
self . Show ()
def Close ( self ):
self . Hide ()
self . acceptEvent ()
def Destroy ( self ):
self . Close ()
self . ClearDictionary ()
def SetWidth ( self , width ):
height = self . GetHeight ()
self . SetSize ( width , height )
self . board . SetSize ( width , height )
self . SetCenterPosition ()
self . UpdateRect ()
def SetText ( self , text ):
self . message . SetText ( text )
def SetAcceptEvent ( self , event ):
self . acceptEvent = event
def SetButtonName ( self , name ):
self . accceptButton . SetText ( ButtonName )
def OnPressEscapeKey ( self ):
self . Close ()
return TRUE
def OnIMEReturn ( self ):
self . Close ()
return TRUE
class InputDialog ( ui . ScriptWindow ):
def __init__ ( self ):
ui . ScriptWindow . __init__ ( self )
self . __CreateDialog ()
def __del__ ( self ):
ui . ScriptWindow . __del__ ( self )
def __CreateDialog ( self ):
pyScrLoader = ui . PythonScriptLoader ()
pyScrLoader . LoadScriptFile ( self , "uiscript/inputdialog.py" )
getObject = self . GetChild
self . board = getObject ( "Board" )
self . acceptButton = getObject ( "AcceptButton" )
self . cancelButton = getObject ( "CancelButton" )
self . inputSlot = getObject ( "InputSlot" )
self . inputValue = getObject ( "InputValue" )
#test
self . tytul_text = ui . TextLine ()
self . tytul_text . SetParent ( self )
self . tytul_text . SetPosition ( 150 , 80 )
self . tytul_text . SetHorizontalAlignCenter ()
self . tytul_text . SetText ( "Alege-ti culoarea cu care vrei sa scrii." )
self . tytul_text . Show ()
#R_text2
self . R_text2 = ui . TextLine ()
self . R_text2 . SetParent ( self )
self . R_text2 . SetPosition ( 60 + 215 - 3 , 100 - 3 )
self . R_text2 . SetHorizontalAlignCenter ()
self . R_text2 . Show ()
#G_text2
self . G_text2 = ui . TextLine ()
self . G_text2 . SetParent ( self )
self . G_text2 . SetPosition ( 60 + 215 - 3 , 120 - 3 )
self . G_text2 . SetHorizontalAlignCenter ()
self . G_text2 . Show ()
#B_text2
self . B_text2 = ui . TextLine ()
self . B_text2 . SetParent ( self )
self . B_text2 . SetPosition ( 60 + 215 - 3 , 140 - 3 )
self . B_text2 . SetHorizontalAlignCenter ()
self . B_text2 . Show ()
#_____________________________#
#R_text
self . R_text = ui . TextLine ()
self . R_text . SetParent ( self )
self . R_text . SetPosition ( 60 + 4 , 100 - 3 )
self . R_text . SetHorizontalAlignCenter ()
self . R_text . SetText ( "Rosu:" )
self . R_text . Show ()
#G_text
self . G_text = ui . TextLine ()
self . G_text . SetParent ( self )
self . G_text . SetPosition ( 60 , 120 - 3 )
self . G_text . SetHorizontalAlignCenter ()
self . G_text . SetText ( "Verde:" )
self . G_text . Show ()
#B_text
self . B_text = ui . TextLine ()
self . B_text . SetParent ( self )
self . B_text . SetPosition ( 60 + 3 , 140 - 3 )
self . B_text . SetHorizontalAlignCenter ()
self . B_text . SetText ( "Albastru:" )
self . B_text . Show ()
#R
self . R = ui . SliderBar ()
self . R . SetParent ( self )
self . R . SetPosition ( 267 / 2 - 50 , 100 )
self . R . SetSliderPos ( 0.5 )
self . R . Show ()
#G
self . G = ui . SliderBar ()
self . G . SetParent ( self )
self . G . SetPosition ( 267 / 2 - 50 , 120 )
self . G . SetSliderPos ( 0.5 )
self . G . Show ()
#B
self . B = ui . SliderBar ()
self . B . SetParent ( self )
self . B . SetPosition ( 267 / 2 - 50 , 140 )
self . B . SetSliderPos ( 0.5 )
self . B . Show ()
def Open ( self ):
self . inputValue . SetFocus ()
self . SetCenterPosition ()
self . SetTop ()
self . Show ()
def Close ( self ):
self . ClearDictionary ()
self . board = None
self . acceptButton = None
self . cancelButton = None
self . inputSlot = None
self . inputValue = None
self . Hide ()
def SetTitle ( self , name ):
self . board . SetTitleName ( name )
def SetNumberMode ( self ):
self . inputValue . SetNumberMode ()
def SetKolory2 ( self ):
kolor_r = self . R . GetSliderPos ()
kolor_g = self . G . GetSliderPos ()
kolor_b = self . B . GetSliderPos ()
self . inputValue . SetFontColor ( kolor_r , kolor_g , kolor_b )
self . R_text2 . SetText ( "[" + str ( int ( kolor_r * 255 ))+ "]" )
self . G_text2 . SetText ( "[" + str ( int ( kolor_g * 255 ))+ "]" )
self . B_text2 . SetText ( "[" + str ( int ( kolor_b * 255 ))+ "]" )
self . kolorek = str ( int ( kolor_r * 255 ))+ "|" + str ( int ( kolor_g * 255 ))+ "|" + str ( int ( kolor_b * 255 ))+ "|"
def SetSecretMode ( self ):
self . inputValue . SetSecret ()
def SetFocus ( self ):
self . inputValue . SetFocus ()
def SetMaxLength ( self , length ):
width = length * 6 + 10
self . SetBoardWidth ( max ( width + 50 , 160 ))
self . SetSlotWidth ( width )
self . inputValue . SetMax ( length )
def SetSlotWidth ( self , width ):
self . inputSlot . SetSize ( width , self . inputSlot . GetHeight ())
self . inputValue . SetSize ( width , self . inputValue . GetHeight ())
if self . IsRTL ():
self . inputValue . SetPosition ( self . inputValue . GetWidth (), 0 )
def SetBoardWidth ( self , width ):
self . SetSize ( max ( width + 50 , 160 ), self . GetHeight ())
self . board . SetSize ( max ( width + 50 , 160 ), self . GetHeight ())
if self . IsRTL ():
self . board . SetPosition ( self . board . GetWidth (), 0 )
self . UpdateRect ()
def SetAcceptEvent ( self , event ):
self . acceptButton . SetEvent ( event )
self . inputValue . OnIMEReturn = event
def SetCancelEvent ( self , event ):
self . board . SetCloseEvent ( event )
self . cancelButton . SetEvent ( event )
self . inputValue . OnPressEscapeKey = event
def GetText ( self ):
if self . R_text2 . IsShow ():
return self . kolorek + self . inputValue . GetText ()
else:
return self . inputValue . GetText ()
def OnUpdate ( self ):
self . SetKolory2 ()
def __init__ ( self ):
ui . ScriptWindow . __init__ ( self )
self . __CreateDialog ()
def __del__ ( self ):
ui . ScriptWindow . __del__ ( self )
def __CreateDialog ( self ):
pyScrLoader = ui . PythonScriptLoader ()
pyScrLoader . LoadScriptFile ( self , "uiscript/inputdialog.py" )
getObject = self . GetChild
self . board = getObject ( "Board" )
self . acceptButton = getObject ( "AcceptButton" )
self . cancelButton = getObject ( "CancelButton" )
self . inputSlot = getObject ( "InputSlot" )
self . inputValue = getObject ( "InputValue" )
def Open ( self ):
self . inputValue . SetFocus ()
self . SetCenterPosition ()
self . SetTop ()
self . Show ()
def Close ( self ):
self . ClearDictionary ()
self . board = None
self . acceptButton = None
self . cancelButton = None
self . inputSlot = None
self . inputValue = None
self . Hide ()
def SetTitle ( self , name ):
self . board . SetTitleName ( name )
def SetNumberMode ( self ):
self . inputValue . SetNumberMode ()
def SetSecretMode ( self ):
self . inputValue . SetSecret ()
def SetFocus ( self ):
self . inputValue . SetFocus ()
def SetMaxLength ( self , length ):
width = length * 6 + 10
self . SetBoardWidth ( max ( width + 50 , 160 ))
self . SetSlotWidth ( width )
self . inputValue . SetMax ( length )
def SetSlotWidth ( self , width ):
self . inputSlot . SetSize ( width , self . inputSlot . GetHeight ())
self . inputValue . SetSize ( width , self . inputValue . GetHeight ())
if self . IsRTL ():
self . inputValue . SetPosition ( self . inputValue . GetWidth (), 0 )
def SetBoardWidth ( self , width ):
self . SetSize ( max ( width + 50 , 160 ), self . GetHeight ())
self . board . SetSize ( max ( width + 50 , 160 ), self . GetHeight ())
if self . IsRTL ():
self . board . SetPosition ( self . board . GetWidth (), 0 )
self . UpdateRect ()
def SetAcceptEvent ( self , event ):
self . acceptButton . SetEvent ( event )
self . inputValue . OnIMEReturn = event
def SetCancelEvent ( self , event ):
self . board . SetCloseEvent ( event )
self . cancelButton . SetEvent ( event )
self . inputValue . OnPressEscapeKey = event
def GetText ( self ):
return self . inputValue . GetText ()
class InputDialogWithDescription ( InputDialog ):
def __init__ ( self ):
ui . ScriptWindow . __init__ ( self )
self . __CreateDialog ()
def __del__ ( self ):
InputDialog . __del__ ( self )
def __CreateDialog ( self ):
pyScrLoader = ui . PythonScriptLoader ()
if locale . IsARABIC () :
pyScrLoader . LoadScriptFile ( self , uiScriptLocale . LOCALE_UISCRIPT_PATH + "inputdialogwithdescription.py" )
else:
pyScrLoader . LoadScriptFile ( self , "uiscript/inputdialogwithdescription.py" )
try:
getObject = self . GetChild
self . board = getObject ( "Board" )
self . acceptButton = getObject ( "AcceptButton" )
self . cancelButton = getObject ( "CancelButton" )
self . inputSlot = getObject ( "InputSlot" )
self . inputValue = getObject ( "InputValue" )
self . description = getObject ( "Description" )
except :
import exception
exception . Abort ( "InputDialogWithDescription.LoadBoardDialog.BindObject" )
def SetDescription ( self , text ):
self . description . SetText ( text )
class InputDialogWithDescription2 ( InputDialog ):
def __init__ ( self ):
ui . ScriptWindow . __init__ ( self )
self . __CreateDialog ()
def __del__ ( self ):
InputDialog . __del__ ( self )
def __CreateDialog ( self ):
pyScrLoader = ui . PythonScriptLoader ()
pyScrLoader . LoadScriptFile ( self , "uiscript/inputdialogwithdescription2.py" )
try:
getObject = self . GetChild
self . board = getObject ( "Board" )
self . acceptButton = getObject ( "AcceptButton" )
self . cancelButton = getObject ( "CancelButton" )
self . inputSlot = getObject ( "InputSlot" )
self . inputValue = getObject ( "InputValue" )
self . description1 = getObject ( "Description1" )
self . description2 = getObject ( "Description2" )
except :
import exception
exception . Abort ( "InputDialogWithDescription.LoadBoardDialog.BindObject" )
def SetDescription1 ( self , text ):
self . description1 . SetText ( text )
def SetDescription2 ( self , text ):
self . description2 . SetText ( text )
class QuestionDialog ( ui . ScriptWindow ):
def __init__ ( self ):
ui . ScriptWindow . __init__ ( self )
self . __CreateDialog ()
def __del__ ( self ):
ui . ScriptWindow . __del__ ( self )
def __CreateDialog ( self ):
pyScrLoader = ui . PythonScriptLoader ()
pyScrLoader . LoadScriptFile ( self , "uiscript/questiondialog.py" )
self . board = self . GetChild ( "board" )
self . textLine = self . GetChild ( "message" )
self . acceptButton = self . GetChild ( "accept" )
self . cancelButton = self . GetChild ( "cancel" )
def Open ( self ):
self . SetCenterPosition ()
self . SetTop ()
self . Show ()
def Close ( self ):
self . Hide ()
def SetWidth ( self , width ):
height = self . GetHeight ()
self . SetSize ( width , height )
self . board . SetSize ( width , height )
self . SetCenterPosition ()
self . UpdateRect ()
def SAFE_SetAcceptEvent ( self , event ):
self . acceptButton . SAFE_SetEvent ( event )
def SAFE_SetCancelEvent ( self , event ):
self . cancelButton . SAFE_SetEvent ( event )
def SetAcceptEvent ( self , event ):
self . acceptButton . SetEvent ( event )
def SetCancelEvent ( self , event ):
self . cancelButton . SetEvent ( event )
def SetText ( self , text ):
self . textLine . SetText ( text )
def SetAcceptText ( self , text ):
self . acceptButton . SetText ( text )
def SetCancelText ( self , text ):
self . cancelButton . SetText ( text )
def OnPressEscapeKey ( self ):
self . Close ()
return TRUE
class QuestionDialog2 ( QuestionDialog ):
def __init__ ( self ):
QuestionDialog . __init__ ( self )
self . __CreateDialog ()
def __del__ ( self ):
QuestionDialog . __del__ ( self )
def __CreateDialog ( self ):
pyScrLoader = ui . PythonScriptLoader ()
pyScrLoader . LoadScriptFile ( self , "uiscript/questiondialog2.py" )
self . board = self . GetChild ( "board" )
self . textLine1 = self . GetChild ( "message1" )
self . textLine2 = self . GetChild ( "message2" )
self . acceptButton = self . GetChild ( "accept" )
self . cancelButton = self . GetChild ( "cancel" )
def SetText1 ( self , text ):
self . textLine1 . SetText ( text )
def SetText2 ( self , text ):
self . textLine2 . SetText ( text )
class QuestionDialogWithTimeLimit ( QuestionDialog2 ):
def __init__ ( self ):
ui . ScriptWindow . __init__ ( self )
self . __CreateDialog ()
self . endTime = 0
def __del__ ( self ):
QuestionDialog2 . __del__ ( self )
def __CreateDialog ( self ):
pyScrLoader = ui . PythonScriptLoader ()
pyScrLoader . LoadScriptFile ( self , "uiscript/questiondialog2.py" )
self . board = self . GetChild ( "board" )
self . textLine1 = self . GetChild ( "message1" )
self . textLine2 = self . GetChild ( "message2" )
self . acceptButton = self . GetChild ( "accept" )
self . cancelButton = self . GetChild ( "cancel" )
def Open ( self , msg , timeout ):
self . SetCenterPosition ()
self . SetTop ()
self . Show ()
self . SetText1 ( msg )
self . endTime = app . GetTime () + timeout
def OnUpdate ( self ):
leftTime = max ( 0 , self . endTime - app . GetTime ())
self . SetText2 ( locale . UI_LEFT_TIME % ( leftTime ))
class MoneyInputDialog ( ui . ScriptWindow ):
def __init__ ( self ):
ui . ScriptWindow . __init__ ( self )
self . moneyHeaderText = locale . MONEY_INPUT_DIALOG_SELLPRICE
self . __CreateDialog ()
self . SetMaxLength ( 9 )
def __del__ ( self ):
ui . ScriptWindow . __del__ ( self )
def __CreateDialog ( self ):
pyScrLoader = ui . PythonScriptLoader ()
pyScrLoader . LoadScriptFile ( self , "uiscript/moneyinputdialog.py" )
getObject = self . GetChild
self . board = self . GetChild ( "board" )
self . acceptButton = getObject ( "AcceptButton" )
self . cancelButton = getObject ( "CancelButton" )
self . inputValue = getObject ( "InputValue" )
self . inputValue . SetNumberMode ()
self . inputValue . OnIMEUpdate = ui . __mem_func__ ( self . __OnValueUpdate )
self . moneyText = getObject ( "MoneyValue" )
def Open ( self ):
self . inputValue . SetText ( "" )
self . inputValue . SetFocus ()
self . __OnValueUpdate ()
self . SetCenterPosition ()
self . SetTop ()
self . Show ()
def Close ( self ):
self . ClearDictionary ()
self . board = None
self . acceptButton = None
self . cancelButton = None
self . inputValue = None
self . Hide ()
def SetTitle ( self , name ):
self . board . SetTitleName ( name )
def SetFocus ( self ):
self . inputValue . SetFocus ()
def SetMaxLength ( self , length ):
length = min ( 9 , length )
self . inputValue . SetMax ( length )
def SetMoneyHeaderText ( self , text ):
self . moneyHeaderText = text
def SetAcceptEvent ( self , event ):
self . acceptButton . SetEvent ( event )
self . inputValue . OnIMEReturn = event
def SetCancelEvent ( self , event ):
self . board . SetCloseEvent ( event )
self . cancelButton . SetEvent ( event )
self . inputValue . OnPressEscapeKey = event
def SetValue ( self , value ):
value = str ( value )
self . inputValue . SetText ( value )
self . __OnValueUpdate ()
ime . SetCursorPosition ( len ( value ))
def GetText ( self ):
return self . inputValue . GetText ()
def __OnValueUpdate ( self ):
ui . EditLine . OnIMEUpdate ( self . inputValue )
text = self . inputValue . GetText ()
money = 0
if text and text . isdigit ():
try:
money = int ( text )
except ValueError :
money = 199999999
self . moneyText . SetText ( self . moneyHeaderText + locale . NumberToMoneyString ( money ))
da ich 2008 files benutze musste ich noch in inputdialog.py folgendes machen:
PHP Code:
von
"width" : 170 ,
"height" : 90 ,
zu
"width" : 170 ,
"height" : 170 ,
Ich hoffe mir kann einer helfen und falls ja bednake ich mich sehr dafür.
02/10/2015, 22:23
#2
elite*gold: 75
Join Date: Mar 2012
Posts: 2,655
Received Thanks: 742
02/11/2015, 01:54
#3
elite*gold: 17
Join Date: May 2014
Posts: 2,103
Received Thanks: 1,292
Lass mir doch bitte per PN den Link zum Forum zu kommen wo du es her hast. Ich versuche es dann auch mal und wenn es mir gelingt kann ich dir die sachen geben oder dir sagen wo du etwas falsch gemacht hast.
02/11/2015, 11:33
#4
elite*gold: 75
Join Date: Mar 2012
Posts: 2,655
Received Thanks: 742
Das buggt mit Gildenerstell Fenster usw Code muss du so ändern das es nur für Eigene Laden funktioniert
02/11/2015, 19:57
#5
elite*gold: 0
Join Date: Apr 2014
Posts: 168
Received Thanks: 8
.Despero™ hat mir geholfen hat alles geklappt.
Similar Threads
HILFE SHOP
01/27/2015 - Off Topic - 12 Replies
Hallöchen
möchte gerne die Nike Schuhe hier: Designer Outlet Nike Shox -Turbo12 Herren Schwarz-Roten Schuhen bestellen. Habe aber angst, dass die Seite fake ist. Wo anderes habe die Schule leider nicht gefunden. Was würdet ihr machen?
MFG
[Hilfe] Shop geändert aber nichts in shop
08/28/2013 - Metin2 Private Server - 1 Replies
Brauche hilfe habe die sanii files habe die shop items geändert bei navi cat aber es zeigt nichts an die shops sind leer .. :S
WBB - Farbiger Name
05/18/2013 - Metin2 Private Server - 8 Replies
Ahoi,
wollte nur fragen, wie der "Befehl" heißt die Namen farbig zu machen und dass z.B. BA so leicht schräg oben ist.
Hoffe ihr wisst was ich meine :)
Lg
Team speak 3 farbiger name
05/29/2012 - Off Topic - 5 Replies
Ich bin schon eine weile auf der suche nach einer möglichkeit meinen namen und evtl auch noch den namen einer servergruppe farbig zu machen
• NEIN ich meine nicht mit bb codes die beschreibung bunt zu machen
• NEIN ich habe nicht vor an meinem client rum zu spielen und ihm ein neues scripting zu verschaffen
• JA es sollte in der akktuellen version sein!
• JA andere sollen diese farben auch sehen können
Wie ich mir das vorstelle ist in etwa so ...
Black Ops Wii -Farbiger Name?
04/21/2011 - Call of Duty - 1 Replies
Hey,
da ich jetzt noch nicht allzu lange Black ops spiele,und immer mehr leute mit einem farbigen name sehe wollte ich mal fragen wie man das macht??
Geht das erst ab einem bestimmten level??
Bin Prestige 1 lvl 39
Danke.
All times are GMT +2. The time now is 07:17 .