Skocz do zawartości
Masz już aplikację Sharegon?

Odkryj wszystkie możliwości. Dowiedz się więcej

Sharegon.pl

Zainstaluj aplikację Sharegon i korzystaj z powiadomień push oraz licznika nowych aktywności bezpośrednio z ekranu głównego.

Aby zainstalować tę aplikację na iOS i iPadOS.
  1. Tap the Share icon in Safari
  2. Przewiń menu i stuknij Dodaj do ekranu początkowego.
  3. Stuknij Dodaj w prawym górnym rogu.
Zainstaluj aplikację Sharegon na Androidzie
  1. Otwórz Sklep Google Play na swoim smarfonie.
  2. Wyszukaj „Sharegon” w pasku wyszukiwania.
  3. Stuknij „Zainstaluj”, aby pobrać aplikację.

Problem z wyświetlaniem dodatkowych pozycji w oknie wyboru - sklep z marmurami

Featured Replies

Opublikowano

Siema mam taki problemik mały problem przerobiłem sobie sklep marmurków na sklep przywołań lecz mam problem z wyświetlaniem ilości przywołań

Wyświetla mi tylko 10 pozycji gdzie mam 12 .

Wygląda tak :

spacer.png

a w kodzie mam jeszcze 2 przywołania , tutaj kod :

PythonKod został skopiowany
######################################### Title:		Marble Shop Window# Author: 		TreeN# Started:		22.09.2017/29.10.2017# Version:		1.0.0 import uiimport appimport netimport chatimport localeInfoimport playerimport uiCommon class MarbleShopWindow(ui.ScriptWindow):	MARBLES_LIST = (			("Wodz Orkow", 71177, 1000000),			("Ezot Przyz.", 71178, 1500000),			("Krolowa Pajkow", 71179, 2000000),			("Pustynny Zolw", 71180, 2000000),			("Ognisty Krol", 71181, 2000000),			("9 Ogonow", 71182, 2500000),			("Krol Demonow", 71183, 2500000),			("Zjawa Tygrysa", 71184, 2500000),			("Umarly Rozpruwacz", 71173, 4000000),			("Nemere", 71174, 5000000),			("Razador", 71175, 6000000),			("Beran-Setaou", 71176, 10000000),		) 	def __init__(self):		ui.ScriptWindow.__init__(self)		self.isLoaded = 0		self.price = 0		self.alertDialog = None		self.__LoadWindow() 	def __del__(self):		ui.ScriptWindow.__del__(self)			def Show(self):		self.__LoadWindow()		ui.ScriptWindow.Show(self)			def __LoadWindow(self):		if self.isLoaded == 1:			return					self.isLoaded = 1		try:			pyScrLoader = ui.PythonScriptLoader()						pyScrLoader.LoadScriptFile(self, "UIScript/MarbleShop.py")				except:			import exception			exception.Abort("MarbleShopWindow.LoadWindow.LoadObject")					try:			getObject = self.GetChild						self.titleBar = getObject("TitleBar")			self.marblesList = getObject("MarblesListBox")			self.buyButton = getObject("BuyButton")			self.marbleCount = getObject("MarbleCount")			self.resumeMarbleName = getObject("ResumeMarbleName")			self.resumeMarbleCount = getObject("ResumeMarbleCount")			self.CNT_Minus = getObject("CNT_Minus")			self.CNT_Plus = getObject("CNT_Plus")			self.resumeMarbleGold = getObject("ResumeMarbleGold")					except:			import exception			exception.Abort("MarbleShopWindow.LoadWindow.BindObject")					self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))		self.buyButton.SetEvent(ui.__mem_func__(self.OnPressBuyButton))		self.CNT_Minus.SetEvent(ui.__mem_func__(self.OnPressMinusButton))		self.CNT_Plus.SetEvent(ui.__mem_func__(self.OnPressPlusButton))				for marble in self.MARBLES_LIST:			self.marblesList.AppendItem(Item(marble[0]))					self.marblesList.SelectIndex(0)			def OnUpdate(self):		marbleName = self.marblesList.GetSelectedItem().GetText()		marbleCount = self.marbleCount.GetText()		if marbleName != "":			self.resumeMarbleName.SetText(str(marbleName))		if int(marbleCount) > 0:			self.resumeMarbleCount.SetText(str(marbleCount))					for marble in xrange(len(self.MARBLES_LIST)):			if self.marblesList.GetSelectedItem().GetText() == self.MARBLES_LIST[marble][0]:				self.resumeMarbleGold.SetText(str(localeInfo.NumberToMoneyString(self.MARBLES_LIST[marble][2]*int(marbleCount))))				self.price = self.MARBLES_LIST[marble][2]*int(marbleCount)			def OnPressPlusButton(self):		marbleCount = int(self.marbleCount.GetText())		if marbleCount == 13:			chat.AppendChat(chat.CHAT_TYPE_INFO, "Maksymalna ilosc to 10.")			return		self.marbleCount.SetText(str(marbleCount+1))			def OnPressMinusButton(self):		marbleCount = int(self.marbleCount.GetText())		if marbleCount == 1:			chat.AppendChat(chat.CHAT_TYPE_INFO, "Minimalna ilosc to 1.")			return		self.marbleCount.SetText(str(marbleCount-1))			def OnPressBuyButton(self):		itemCount = self.marbleCount.GetText()		marbleIndex = self.marblesList.GetSelectedItem().GetText()				alertDialog = uiCommon.QuestionDialog()		alertDialog.SetWidth(385)		alertDialog.SetText("Chcesz kupic %s %dx za %s?" % (str(marbleIndex), int(itemCount), localeInfo.NumberToMoneyString(self.price))) 		alertDialog.SetAcceptEvent(lambda arg1=str(marbleIndex), arg2=int(itemCount): self.OnBuyMarble(arg1, arg2))		alertDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseAlertDialog))		alertDialog.Open()		self.alertDialog = alertDialog			def OnCloseAlertDialog(self):		if not self.alertDialog:			return		self.alertDialog.Close()		self.alertDialog = None		def OnBuyMarble(self, marbleIndex, itemCount):		self.OnCloseAlertDialog()		if marbleIndex == "":			return					for marble in xrange(len(self.MARBLES_LIST)):			if marbleIndex == self.MARBLES_LIST[marble][0]:				itemVnum = self.MARBLES_LIST[marble][1]				if itemCount > 0:					net.SendChatPacket("/buy_marble_item %d %d" % (int(itemVnum), itemCount))					break				else:					chat.AppendChat(chat.CHAT_TYPE_INFO, "Musisz wybrac jakies przywolanie.")					break 	def Destroy(self):		self.alertDialog = None		self.ClearDictionary()			def Close(self):		if self.alertDialog:			self.OnCloseAlertDialog() 		self.Hide() 		def OnPressEscapeKey(self):		self.Close()		return TRUE		class Item(ui.ListBoxEx.Item):	def __init__(self, text):		ui.ListBoxEx.Item.__init__(self)		self.canLoad=0		self.text=text		self.textLine=self.__CreateTextLine(text[:22])	def __del__(self):		ui.ListBoxEx.Item.__del__(self)	def GetText(self):		return self.text	def SetSize(self, width, height):		ui.ListBoxEx.Item.SetSize(self, 6*len(self.textLine.GetText()) + 4, height)	def __CreateTextLine(self, text):		textLine=ui.TextLine()		textLine.SetParent(self)		textLine.SetPosition(0, 0)		textLine.SetText(text)		textLine.Show()		return textLine

ustawiałem wieksze okno itp itd dalej nic nie zmienia sie nawet jak okno dam na cały ekran 😄

Rozwiązane przez Marchewa

Opublikowano

Spróbuj funkcje zamienić chociaż najpewniej to nie z tym problem, ale zawsze można spróbować. Z xrange na range.

 

o tak:

Spoiler

 

Opublikowano
  • Rozwiązanie

ui.py

PythonKod został skopiowany
class ListBoxEx(Window): self.viewItemCount=10

 

Tylko ciekawe czy nie popsujesz tym czegoś znowu innego bo nie wiadomo ile rzeczy z tego korzysta

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.

Konto

Nawigacja

Skonfiguruj powiadomienia push w przeglądarce.

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Wybierz Uprawnienia → Powiadomienia.
  3. Dostosuj swoje preferencje.
Chrome (Desktop)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje preferencje.