- Mesaj
- 29
- Beğeni
- 2
- Puan
- 40
- Ticaret Puanı
- 0
Merhaba
Ok işareti ile gösterdiğim yerde inputta yazılı olan fiyatın aynısının yazması gerekiyor her sunucuda olduğu gibi ancak bende o kısım yenilenmiyor
InputMoneyText olarak isimlendirilmiş orası ilgili pyleri aşağıya bırakıyorum.
Ok işareti ile gösterdiğim yerde inputta yazılı olan fiyatın aynısının yazması gerekiyor her sunucuda olduğu gibi ancak bende o kısım yenilenmiyor
InputMoneyText olarak isimlendirilmiş orası ilgili pyleri aşağıya bırakıyorum.
privateshoppriceinputdialog.py:
import uiScriptLocale
import localeInfo
import app
BOARD_WIDTH = 200
BOARD_HEIGHT = 190
PRICE_INPUT_X = 12
PRICE_INPUT_Y = 32
PRICE_INPUT_WIDTH = 200 - 12 * 2
PRICE_INPUT_HEIGHT = 63
MARKET_PRICE_X = 12
MARKET_PRICE_Y = PRICE_INPUT_Y + PRICE_INPUT_HEIGHT + 1
MARKET_PRICE_WIDTH = 200 - 12 * 2
MARKET_PRICE_HEIGHT = 60
window = {
"name" : "InputDialog",
"x" : 0,
"y" : 0,
"style" : ("movable", "float",),
"width" : BOARD_WIDTH,
"height" : BOARD_HEIGHT,
"children" :
(
{
"name" : "board",
"type" : "board_with_titlebar",
"x" : 0,
"y" : 0,
"width" : BOARD_WIDTH,
"height" : BOARD_HEIGHT,
"title" : localeInfo.PRIVATE_SHOP_INPUT_PRICE_DIALOG_TITLE,
"children" :
(
{
"name" : "PriceHintButton",
"type" : "button",
"x" : BOARD_WIDTH - 50,
"y" : 9,
"default_image" : "d:/ymir work/ui/pattern/q_mark_01.tga",
"over_image" : "d:/ymir work/ui/pattern/q_mark_02.tga",
"down_image" : "d:/ymir work/ui/pattern/q_mark_02.tga",
},
{
"name" : "PriceInputThinboard",
"type" : "thinboard_circle",
"x" : PRICE_INPUT_X,
"y" : PRICE_INPUT_Y,
"width" : PRICE_INPUT_WIDTH,
"height" : PRICE_INPUT_HEIGHT,
"children" : (
{
"name" : "PriceInputTitle",
"type" : "text",
"x" : 6,
"y" : 4,
"text_horizontal_align" : "center",
"horizontal_align" : "center",
"text" : uiScriptLocale.PREMIUM_PRIVATE_SHOP_PRICE_TITLE,
},
## Input Slot Money
{
"name" : "InputSlot",
"type" : "slotbar",
"x" : 35 - 12,
"y" : 20,
"width" : 110,
"height" : 18,
"children" :
(
{
"name":"Money_Icon",
"type":"image",
"x":-18,
"y":2,
"image":"d:/ymir work/ui/game/windows/money_icon.sub",
},
{
"name" : "InputValue",
"type" : "editline",
"x" : 3,
"y" : 3,
"width" : 90,
"height" : 18,
"input_limit" : 12,
"only_currency" : 1,
},
),
},
{
"name" : "InputMoneyText",
"type" : "text",
"x" : 81,
"y" : 45,
"text" : "30 Yang",
"text_horizontal_align" : "left",
},
),
},
{
"name" : "MarketPriceThinboard",
"type" : "thinboard_circle",
"x" : MARKET_PRICE_X,
"y" : MARKET_PRICE_Y,
"width" : MARKET_PRICE_WIDTH,
"height" : MARKET_PRICE_HEIGHT,
"children" : (
{
"name" : "MarketPriceTitle",
"type" : "text",
"x" : 0,
"y" : 4,
"text_horizontal_align" : "center",
"horizontal_align" : "center",
"text" : uiScriptLocale.PREMIUM_PRIVATE_SHOP_MARKET_PRICE_TITLE,
},
{
"name" : "MarketPriceButton",
"type" : "button",
"x" : 45,
"y" : 7,
"horizontal_align" : "center",
"default_image" : "d:/ymir work/ui/game/premium_private_shop/mini_empty_button_default.sub",
"over_image" : "d:/ymir work/ui/game/premium_private_shop/mini_empty_button_over.sub",
"down_image" : "d:/ymir work/ui/game/premium_private_shop/mini_empty_button_down.sub",
},
{
"name" : "MarketChequeValue",
"type" : "text",
"x" : 0,
"y" : 4 + 16,
"text" : localeInfo.PREMIUM_PRIVATE_SHOP_MARKET_PRICE_NOT_AVAILABLE,
"text_horizontal_align" : "center",
"horizontal_align" : "center",
},
{
"name" : "MarketMoneyValue",
"type" : "text",
"x" : 0,
"y" : 4 + 16 + 16,
"text" : localeInfo.PREMIUM_PRIVATE_SHOP_MARKET_PRICE_NOT_AVAILABLE,
"text_horizontal_align" : "center",
"horizontal_align" : "center",
},
),
},
## Button
{
"name" : "AcceptButton",
"type" : "button",
"x" : - 61 - 5 + 30,
"y" : BOARD_HEIGHT - 31,
"horizontal_align" : "center",
"default_image" : "d:/ymir work/ui/public/acceptbutton00.sub",
"over_image" : "d:/ymir work/ui/public/acceptbutton01.sub",
"down_image" : "d:/ymir work/ui/public/acceptbutton02.sub",
},
{
"name" : "CancelButton",
"type" : "button",
"x" : 5 + 30,
"y" : BOARD_HEIGHT - 31,
"horizontal_align" : "center",
"default_image" : "d:/ymir work/ui/public/canclebutton00.sub",
"over_image" : "d:/ymir work/ui/public/canclebutton01.sub",
"down_image" : "d:/ymir work/ui/public/canclebutton02.sub",
},
),
},
),
}
uicommon.py:
if app.ENABLE_PREMIUM_PRIVATE_SHOP:
class PrivateShopPriceInputDialog(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.toolTip = None
self.cancelEvent = None
self.itemVnum = -1
self.itemCount = 1
self.inputMarketPrice = False
self.marketGoldValue = 0
self.marketChequeValue = 0
self.__CreateDialog()
def __del__(self):
ui.ScriptWindow.__del__(self)
def __CreateDialog(self):
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "uiscript/privateshoppriceinputdialog.py")
self.board = self.GetChild("board")
self.acceptButton = self.GetChild("AcceptButton")
self.cancelButton = self.GetChild("CancelButton")
self.inputValue = self.GetChild("InputValue")
self.inputMoneyText = self.GetChild("InputMoneyText")
self.marketMoneyText = self.GetChild("MarketMoneyValue")
self.priceHintButton = self.GetChild("PriceHintButton")
self.marketPriceButton = self.GetChild("MarketPriceButton")
self.inputValue.OnIMEUpdate = ui.__mem_func__(self.__OnValueUpdate)
self.priceHintButton.SetShowToolTipEvent(ui.__mem_func__(self.__OnOverInButton), "PRICE_HINT")
self.priceHintButton.SetHideToolTipEvent(ui.__mem_func__(self.__OnOverOutButton))
self.marketPriceButton.SetEvent(ui.__mem_func__(self.__OnClickMarketPriceButton))
self.marketPriceButton.SetShowToolTipEvent(ui.__mem_func__(self.__OnOverInButton), "AUTO_MARKET_PRICE_INPUT")
self.marketPriceButton.SetHideToolTipEvent(ui.__mem_func__(self.__OnOverOutButton))
if app.ENABLE_PRIVATE_SHOP_CHEQUE:
self.inputChequeText = self.GetChild("InputChequeText")
self.marketChequeText = self.GetChild("MarketChequeValue")
self.inputChequeValue = self.GetChild("InputValue_Cheque")
self.inputChequeValue.OnIMEUpdate = ui.__mem_func__(self.__OnValueUpdate)
self.inputChequeValue.OnMouseLeftButtonDown = ui.__mem_func__(self.__ClickChequeEditLine)
self.inputChequeValue.SetTabEvent(self.inputValue.SetFocus)
self.inputValue.OnMouseLeftButtonDown = ui.__mem_func__(self.__ClickValueEditLine)
self.inputValue.SetTabEvent(self.inputChequeValue.SetFocus)
self.toolTip = uiToolTip.ToolTip()
self.toolTip.HideToolTip()
def Open(self):
self.inputValue.SetFocus()
self.__OnValueUpdate()
self.SetCenterPosition()
self.SetTop()
self.Show()
def Clear(self):
self.itemVnum = -1
self.itemCount = 1
self.marketGoldValue = 0
self.marketChequeValue = 0
self.inputValue.SetText("")
if app.ENABLE_PRIVATE_SHOP_CHEQUE:
self.inputChequeValue.SetText("")
def Close(self):
self.Clear()
self.cancelEvent()
self.Hide()
def SetItemVnum(self, vnum):
self.itemVnum = vnum
def GetItemVnum(self):
return self.itemVnum
def SetItemCount(self, count):
self.itemCount = count
def GetItemCount(self):
return self.itemCount
def SetTitle(self, name):
self.board.SetTitleName(name)
def SetFocus(self):
self.inputValue.SetFocus()
def KillFocus(self):
if self.inputValue.IsFocus():
self.inputValue.KillFocus()
elif app.ENABLE_PRIVATE_SHOP_CHEQUE and self.inputChequeValue.IsFocus():
self.inputChequeValue.KillFocus()
def SetAcceptEvent(self, event):
self.acceptButton.SetEvent(event)
self.inputValue.SetReturnEvent(event)
if app.ENABLE_PRIVATE_SHOP_CHEQUE:
self.inputChequeValue.SetReturnEvent(event)
def SetCancelEvent(self, event):
self.cancelEvent = event
self.board.SetCloseEvent(self.Close)
self.cancelButton.SetEvent(self.Close)
self.inputValue.SetEscapeEvent(self.Close)
if app.ENABLE_PRIVATE_SHOP_CHEQUE:
self.inputChequeValue.SetEscapeEvent(self.Close)
def SetValue(self, value):
value=str(value)
self.inputValue.SetText(value)
self.__OnValueUpdate()
ime.SetCursorPosition(len(value)+1)
def GetText(self):
if len(self.inputValue.GetText()) <= 0:
return "0"
return self.inputValue.GetText()
def SetMarketValue(self, gold, cheque):
self.marketGoldValue = gold * self.itemCount
self.marketChequeValue = cheque * self.itemCount
if gold:
self.marketMoneyText.SetText(localeInfo.NumberToMoneyString(gold))
if self.inputMarketPrice:
self.InputMarketPrice()
else:
self.marketMoneyText.SetText(localeInfo.PREMIUM_PRIVATE_SHOP_MARKET_PRICE_NOT_AVAILABLE)
if app.ENABLE_PRIVATE_SHOP_CHEQUE:
if not gold and not cheque:
self.marketChequeText.Hide()
else:
self.marketChequeText.SetText(localeInfo.NumberToMoneyStringNoUnit(cheque) + " " + localeInfo.CHEQUE_SYSTEM_UNIT_WON)
self.marketChequeText.Show()
if self.inputMarketPrice:
self.InputMarketPrice()
if app.ENABLE_PRIVATE_SHOP_CHEQUE:
def SetCheque(self, cheque):
cheque=str(cheque)
self.inputChequeValue.SetText(cheque)
self.__OnValueUpdate()
ime.SetCursorPosition(len(cheque)+1)
def __ClickChequeEditLine(self) :
self.inputChequeValue.SetFocus()
if len(self.inputChequeValue.GetText()) <= 0:
self.inputChequeValue.SetText("")
def __ClickValueEditLine(self) :
self.inputValue.SetFocus()
if len(self.inputValue.GetText()) <= 0:
self.inputValue.SetText("")
def GetCheque(self):
if len(self.inputChequeValue.GetText()) <= 0:
return "0"
return self.inputChequeValue.GetText()
def __OnValueUpdate(self):
if self.inputValue.IsFocus() :
ui.EditLine.OnIMEUpdate(self.inputValue)
money = self.inputValue.GetText()
if len(money) <= 0:
money = "0"
else:
k_pos = money.find('K')
if k_pos >= 0:
money = money[:k_pos] + '000' * money.count('K')
self.inputMoneyText.SetText(localeInfo.NumberToMoneyString(int(money)))
elif self.inputChequeValue.IsFocus() :
ui.EditLine.OnIMEUpdate(self.inputChequeValue)
cheque = self.inputChequeValue.GetText()
if len(cheque) <= 0:
cheque = "0"
self.inputChequeText.SetText(localeInfo.NumberToMoneyStringNoUnit(int(cheque)) + " " + localeInfo.CHEQUE_SYSTEM_UNIT_WON)
else:
pass
else:
def __OnValueUpdate(self):
ui.EditLine.OnIMEUpdate(self.inputValue)
def __OnClickMarketPriceButton(self):
if self.inputMarketPrice:
self.inputMarketPrice = False
self.marketPriceButton.SetUpVisual("d:/ymir work/ui/game/premium_private_shop/mini_empty_button_default.sub")
self.marketPriceButton.SetOverVisual("d:/ymir work/ui/game/premium_private_shop/mini_empty_button_over.sub")
self.marketPriceButton.SetDownVisual("d:/ymir work/ui/game/premium_private_shop/mini_empty_button_down.sub")
else:
self.inputMarketPrice = True
self.marketPriceButton.SetUpVisual("d:/ymir work/ui/game/premium_private_shop/mini_accept_button_default.sub")
self.marketPriceButton.SetOverVisual("d:/ymir work/ui/game/premium_private_shop/mini_accept_button_over.sub")
self.marketPriceButton.SetDownVisual("d:/ymir work/ui/game/premium_private_shop/mini_accept_button_down.sub")
self.InputMarketPrice()
def InputMarketPrice(self):
if self.marketGoldValue > 0:
self.SetValue(str(self.marketGoldValue))
if app.ENABLE_PRIVATE_SHOP_CHEQUE:
if self.marketChequeValue > 0:
self.SetCheque(str(self.marketChequeValue))
def __OnOverInButton(self, button):
self.toolTip.ClearToolTip()
if button == "PRICE_HINT":
self.toolTip.SetThinBoardSize(len(localeInfo.PREMIUM_PRIVATE_SHOP_MARKET_PRICE_HINT_MSG) * 4 + 50, 10)
self.toolTip.AppendTextLine(localeInfo.PREMIUM_PRIVATE_SHOP_MARKET_PRICE_HINT_MSG, self.toolTip.SPECIAL_TITLE_COLOR)
elif button == "AUTO_MARKET_PRICE_INPUT":
self.toolTip.SetThinBoardSize(len(localeInfo.PREMIUM_PRIVATE_SHOP_AUTO_MARKET_PRICE_INPUT_TOOLTIP) * 4 + 50, 10)
self.toolTip.AppendTextLine(localeInfo.PREMIUM_PRIVATE_SHOP_AUTO_MARKET_PRICE_INPUT_TOOLTIP, self.toolTip.SPECIAL_TITLE_COLOR)
self.toolTip.ShowToolTip()
def __OnOverOutButton(self):
if 0 != self.toolTip:
self.toolTip.HideToolTip()
def OnPressEscapeKey(self):
self.Close()
return True
Son düzenleme: