*  Dali Offshop Gui
BU KONUYU DEĞERLENDİR
  • Derecelendirme: 0/5 - 0 oy
  • 1
  • 2
  • 3
  • 4
  • 5
2
( Yorum )
587
( Okunma )
Görüntüleyenler: 1 Ziyaretçi

8
(Mesajlar)
8
(Konular)
24.08.2022
(Kayıt Tarihi)
91
(Rep Puanı)
#1
16.09.2022 Saat: 20:18 (Son Düzenleme: 04.11.2022 Saat: 06:44, Düzenleyen: B. Bulut.)


 
 
 
Market oluşturma bölümünü yeniden yazdım. Market gui ve yönetim panelini yeniden düzenledim ve 40 slotlu duruma getirdim.
Not: 40 slot için src de eski duruma getirilmesi gereken yerleri düzenleyin. Verdiğim kodların bir kısmında paylaştığım premium sistemi kodları var ben market oluşturma süresini ve gerekli parayı premium sistemine bağladım sizde yoksa kendinize göre düzenleyin. Beğenmeyi unutmayın.

Market oluşturma gui
[Resim: XbsWUhr.png]
 
Market gui / Yönetim paneli
[Resim: YxcaQsK.png]
 
Kod:
root/uicommon.py:

if app.ENABLE_OFFLINE_SHOP:
//Arat
class QuestionDialog(ui.ScriptWindow):

//Üstüne Ekle
    class TextBoard(ui.ThinBoard):
        def __init__(self):
            ui.ThinBoard.__init__(self)
            self.lineHeight = 12
            self.childrenList = []

        def __del__(self):
            ui.ThinBoard.__del__(self)

        def Clear(self):
            self.lineHeight = 12
            self.childrenList = []

        def AppendTextLine(self, text):
            textLine = ui.TextLine()
            textLine.SetParent(self)
            textLine.SetFontName(localeInfo.UI_DEF_FONT_LARGE)
            textLine.SetText(str(text))
            textLine.SetOutline()
            textLine.SetFeather(False)
            textLine.Show()
            textLine.SetPosition(10, self.lineHeight)
            self.childrenList.append(textLine)
            self.lineHeight += 17
            return textLine

    class InputDialogForZeRo(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/inputdialogforzero.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")
                self.description3 = getObject("Description3")
                self.textBoard = TextBoard()
                self.textBoard.SetParent(self.board)
                self.textBoard.SetPosition(10, 30)
                self.textBoard.SetSize(220, 172)
                self.textBoard.AddFlag('not_pick')
                self.textBoard.Show()
                self.RefreshText()

            except:
                import exception
                exception.Abort("InputDialogWithDescription.LoadBoardDialog.BindObject")

        def SetDescription1(self, text):
            self.description1.SetText(text)

        def SetDescription2(self, text):
            self.description2.SetText(text)

        def SetDescription3(self, text):
            self.description3.SetText(text)

        def SplitDescription(self, desc, limit):
            total_tokens = desc.split()
            line_tokens = []
            line_len = 0
            lines = []
            for token in total_tokens:
                if '|' in token:
                    sep_pos = token.find('|')
                    line_tokens.append(token[:sep_pos])
                    lines.append(' '.join(line_tokens))
                    line_len = len(token) - (sep_pos + 1)
                    line_tokens = [token[sep_pos + 1:]]
                else:
                    line_len += len(token)
                    if len(line_tokens) + line_len > limit:
                        lines.append(' '.join(line_tokens))
                        line_len = len(token)
                        line_tokens = [token]
                    else:
                        line_tokens.append(token)

            if line_tokens:
                lines.append(' '.join(line_tokens))
            return lines

        def RefreshText(self):
            self.textBoard.Clear()
            lines = self.SplitDescription(uiScriptLocale.OFFLINE_SHOP_INFO, 35)
            if not lines:
                return
            for line in lines:
                self.textBoard.AppendTextLine(line)
 
Kod:
locale/locale_interface.txt:

OFFLINE_SHOP_NAME    Market İsmi
OFFLINE_SHOP_CREATE    Market Oluştur
OFFLINE_SHOP_INFO    Market Tezgâh sistemi sen oyunda olmasan da senin belirlediğin süre boyunca nesnelerinin ticaretinin yapılmasını sağlar. Bu sistem sadece birinci köyünde kullanılabilir. Oyundan Çıkman tezgâhını kapatmaz. Tezgâhını yönetmek için envanterinden bulunan Market Oluştur'u kullanabilirsin.
 
Kod:
root/uishop.py:

//Arat
self.lockButton.SetText

//Değiştir
self.lockButton.SetToolTipText
 
Kod:
root/interfacemodule.py:

//Arat
    def OpenPrivateShopInputNameDialog(self):
        #if player.IsInSafeArea():
        #    chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CANNOT_OPEN_PRIVATE_SHOP_IN_SAFE_AREA)
        #    return

        inputDialog = uiCommon.InputDialog()
        inputDialog.SetTitle(localeInfo.PRIVATE_SHOP_INPUT_NAME_DIALOG_TITLE)
        inputDialog.SetMaxLength(32)
        inputDialog.SetAcceptEvent(ui.__mem_func__(self.OpenPrivateShopBuilder))
        inputDialog.SetCancelEvent(ui.__mem_func__(self.ClosePrivateShopInputNameDialog))
        inputDialog.Open()
        self.inputDialog = inputDialog

  
//Arat değiştir
    def OpenPrivateShopInputNameDialog(self):
        #if player.IsInSafeArea():
        #    chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CANNOT_OPEN_PRIVATE_SHOP_IN_SAFE_AREA)
        #    return

        if app.ENABLE_OFFLINE_SHOP:
            inputDialog = uiCommon.InputDialogForZeRo()
            inputDialog.SetTitle(localeInfo.PRIVATE_SHOP_INPUT_NAME_DIALOG_TITLE)
            inputDialog.SetMaxLength(24)
            inputDialog.SetAcceptEvent(ui.__mem_func__(self.OpenPrivateShopBuilder))
            inputDialog.SetCancelEvent(ui.__mem_func__(self.ClosePrivateShopInputNameDialog))
            inputDialog.SetDescription1(uiScriptLocale.OFFLINE_SHOP_NAME)
            if app.ENABLE_PREMIUM_MEMBERS:
                if self.__GetPlayerPremium():
                    inputDialog.SetDescription2("Market Ücreti = 1.000.000 Yang")
                    inputDialog.SetDescription3("Market Süresi = 7 Gün")
                else:
                    inputDialog.SetDescription2("Market Ücreti = 1.000.000 Yang")
                    inputDialog.SetDescription3("Market Süresi = 2 Gün")
            else:
                inputDialog.SetDescription2("Market Ücreti = 1.000.000 Yang")
                inputDialog.SetDescription3("Market Süresi = 2 Gün")
            inputDialog.SetBoardWidth(190)
            inputDialog.Open()
            self.inputDialog = inputDialog
        else:
            inputDialog = uiCommon.InputDialog()
            inputDialog.SetTitle(localeInfo.PRIVATE_SHOP_INPUT_NAME_DIALOG_TITLE)
            inputDialog.SetMaxLength(32)
            inputDialog.SetAcceptEvent(ui.__mem_func__(self.OpenPrivateShopBuilder))
            inputDialog.SetCancelEvent(ui.__mem_func__(self.ClosePrivateShopInputNameDialog))
            inputDialog.Open()
            self.inputDialog = inputDialog
 
 
 
uiscript e at
inputdialogforzero.py ve offlineshop.py
Gizli İçerik


Bu içeriği görüntülemek için lütfen Oturum Açın veya Kaydolun.
 

[Resim: imzaol2.gif]
[Resim: unknown.png]

Admin
569
(Mesajlar)
500
(Konular)
24.08.2022
(Kayıt Tarihi)
247
(Rep Puanı)
#2
16.09.2022 Saat: 20:37
Paylaşım için teşekkürler

Admin
74
(Mesajlar)
7
(Konular)
24.08.2022
(Kayıt Tarihi)
50
(Rep Puanı)
#3
16.09.2022 Saat: 21:14
Konu İçeriği Düzeltildi Paylaşım için Teşekkürler


Hızlı Menü: