PY-Board wird bei Clientstart von alleine geöffnet

11/17/2013 02:15 Yiv#1
Hallo liebe Community,

ich habe in meinen Clienten diese Modifikation eingebaut: [Only registered and activated users can see links. Click Here To Register...]

Wenn ich mich nun einlogge, erscheint sofort das Board...

In die game.py habe ich folgendes eingetragen:
Ganz oben:
Code:
import uigmonlineboard
Bei "BuildKeyDict":
Code:
onPressKeyDict[app.DIK_F7]	= lambda : self.__uigmonlineboard()
Und ganz unten:
Code:
	def __uigmonlineboard(self):
		self.gmob = uigmonlineboard.GMOnlineBoardDialog()
		self.gmob.LoadUserInterface()
		self.gmob.SetTop()
Wer kann mir helfen?

MfG
11/17/2013 02:21 iYoshix3#2
Entfern die letzte Zeile, mit dem "ClassName.Show()"

Mfg,
Yoshix3
11/17/2013 02:32 Yiv#3
Jetzt hängt er am Ladebalken und in der syserr.txt steht folgendes:
Code:
1117 02:20:26111 ::   File "networkModule.py", line 231, in SetGamePhase

1117 02:20:26111 ::   File "system.py", line 130, in __pack_import

1117 02:20:26111 ::   File "system.py", line 110, in _process_result
02:31 17.11.2013
1117 02:20:26111 ::   File "game.py", line 38, in ?

1117 02:20:26111 ::   File "system.py", line 130, in __pack_import

1117 02:20:26111 ::   File "
1117 02:20:26112 :: <string>
1117 02:20:26112 :: ", line 
1117 02:20:26112 :: 126
1117 02:20:26112 :: 

1117 02:20:26112 ::     
1117 02:20:26112 :: #GMOnlineBoardDialog().UpdateActivity("[SGA]Nova", 1)
1117 02:20:26112 :: 

1117 02:20:26112 ::     
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 ::  
1117 02:20:26112 :: ^

1117 02:20:26112 :: SyntaxError
1117 02:20:26112 :: : 
1117 02:20:26112 :: invalid syntax
1117 02:20:26112 ::
MfG
11/17/2013 02:50 CryPrime#4
Entferne mal import uigmonlineboard

Yoshi erzählt nur misst der hat doch kein plan
11/17/2013 02:52 iYoshix3#5
Poste mal die uigmonlineboard.py hier rein.

Mfg,
Yoshix3
11/17/2013 02:54 Yiv#6
Das Board öffnet sich zwar nicht mehr, aber ich kann es auch nicht mit F7 öffnen...

syserr:
Code:
1117 02:53:31641 :: Traceback (most recent call last):

1117 02:53:31641 ::   File "game.py", line 1200, in OnKeyDown

1117 02:53:31641 ::   File "game.py", line 333, in <lambda>

1117 02:53:31641 ::   File "game.py", line 2208, in __uigmonlineboard

1117 02:53:31641 :: NameError
1117 02:53:31641 :: : 
1117 02:53:31641 :: global name 'uigmonlineboard' is not defined
1117 02:53:31641 ::
11/17/2013 04:20 [SA]Tears aka.[BlackBite]#7
haste vllt einfach ma beim ersten code versucht : self.gmob.Hide() ? das es "versteckt" ist :3
11/17/2013 04:24 Yiv#8
Wie meinst du? :o

MfG
11/17/2013 05:01 [SA]Tears aka.[BlackBite]#9
gibt doch nen python befehl das das borad standardmäßig hidden(versteckt) ist vllt solltest du den ma testen also vom ersten code ganz unten den befehl mit meinem versuchen(bin 1. total besoffen 2. hasse ich python) aber nen versuch jemand zu helfen isses wert :)
11/17/2013 05:32 Yiv#10
Ich verstehe es immer noch nicht :D

Code:
import ui
import chat
import app
import player
import net

GMList = [["[SA]ViCi",0], ["[GA]DJB",0], ["",0], ["",0], ["",0], ["",0]]
TeamCount = len(GMList)

class GMOnlineBoardDialog(ui.ScriptWindow):
	GMActivityList = []
	test = []
	PageCount = 6
	if PageCount > TeamCount:
		PageCount = TeamCount
	LastContactTimeStamp = app.GetTime() - 5
	WaitTime = 10
	State = "Disabled"

	def __init__(self):
		ui.ScriptWindow.__init__(self)
		if self.GMActivityList == []:
			self.LoadUserInterface()
		
	def __del__(self):
		ui.ScriptWindow.__del__(self)
		if self.Board:
			self.Board.Hide()
		
	def LoadUserInterface(self):
		global TeamCount
		global GMList
		width = 295
		if TeamCount > self.PageCount:
			width = 15 + 280 * int(DivideToFloat(TeamCount, self.PageCount) + 0.5)
		height = 135 + 25 * self.PageCount
		
		self.Board = ui.BoardWithTitleBar()
		self.Board.SetSize(width, height)
		self.Board.SetCenterPosition()
		self.Board.AddFlag("movable")
		self.Board.AddFlag("float")
		self.Board.SetTitleName("EOS-2 GMOnlineBoard | By DaRealFreak")
		self.Board.SetCloseEvent(self.__del__)
		self.Board.Show()
		
		x = 20
		y = 45
		for GM in GMList:
			if (int(GMList.index(GM))/self.PageCount == DivideToFloat(GMList.index(GM), self.PageCount)) and (int(GMList.index(GM))/self.PageCount != 0):
				x = 20 + 280 * int(DivideToFloat(GMList.index(GM), self.PageCount) + 0.5)
				y = 45
			
			GMVisage = ui.ExpandedImageBox()
			GMVisage.SetParent(self.Board)
			GMVisage.SetPosition(x, y)
			GMVisage.LoadImage("d:/ymir work/ui/game/windows/messenger_list_online.sub")
			if GM[1] == 0:
				GMVisage.LoadImage("d:/ymir work/ui/game/windows/messenger_list_offline.sub")				
			GMVisage.Show()
			
			WhisperButton = ui.Button()
			WhisperButton.SetParent(self.Board)
			WhisperButton.SetUpVisual("d:/ymir work/ui/public/xlarge_button_01.sub")
			WhisperButton.SetOverVisual("d:/ymir work/ui/public/xlarge_button_02.sub")
			WhisperButton.SetDownVisual("d:/ymir work/ui/public/xlarge_button_03.sub")
			WhisperButton.SetText(str(GM[0]))
			WhisperButton.SetToolTipText("Anschreiben", 125, 7)
			WhisperButton.SetPosition(x + 20, y)
			WhisperButton.SetEvent(lambda arg = GM: self.Whisper(arg))
			WhisperButton.Show()	
			
			self.GMActivityList.append([GMVisage, WhisperButton])
			
			y += 25
			
		x = 20
		y = 65 + self.PageCount * 25
		for i in xrange(3):
			Description = ui.TextLine()
			Description.SetParent(self.Board)
			Description.SetDefaultFontName()
			Description.SetPosition(x, y)
			if i == 0:
				Description.SetText("Beschreibung:")
				Description.SetFontColor(0.1, 0.7, 1)
			elif i == 1:
				Description.SetText("Klicke auf den Button mit dem Namen des Teammitgliedes")				
			elif i == 2:
				Description.SetText("um ihn anzuschreiben, falls er online ist.")				
			Description.Show()			
			self.GMActivityList.append(Description)
			
			y += 15
		
	def Whisper(self, name):
		if int(name[1]) == 0:			
			chat.AppendChat(chat.CHAT_TYPE_INFO, "Das Teammitglied " + str(name[0]) + " ist momentan nicht online.")
		else:
			if self.State == "Disabled":
				chat.AppendChat(chat.CHAT_TYPE_INFO, "Warte noch " + str(int(int(self.LastContactTimeStamp) + self.WaitTime) - int(app.GetTime())) + " Sekunden bevor du erneut ein Teammitglied anschreibst.")
				return
			net.SendWhisperPacket(str(name[0]), "Der Spieler " + player.GetName() + " möchte sie kontaktieren.")			
			chat.AppendChat(chat.CHAT_TYPE_INFO, "Du hast dem Teammitglied " + str(name[0]) + " eine Nachricht geschickt.")
			self.State = "Disabled"
			self.LastContactTimeStamp = app.GetTime()
		
	def OnUpdate(self):
		if int(int(self.LastContactTimeStamp) + self.WaitTime) < int(app.GetTime()) and self.State == "Disabled":
			self.State = "Enabled"
		
	def UpdateActivity(self, member, activity):
		for bla in self.GMActivityList:
			try:
				if bla[1].GetText() == member:
					if activity == 1:
						bla[0].LoadImage("d:/ymir work/ui/game/windows/messenger_list_online.sub")
					else:
						bla[0].LoadImage("d:/ymir work/ui/game/windows/messenger_list_offline.sub")
			except:
				pass
				
def DivideToFloat(x, y):
	y = x * (y**-1)
	return y
		
GMOnlineBoardDialog().Show()
#GMOnlineBoardDialog().UpdateActivity("[SGA]Nova", 1)
Was muss da jetzt wo rein? :D

MfG
11/17/2013 05:36 [SA]Tears aka.[BlackBite]#11
Ich tippe mal bei :

GMOnlineBoardDialog().Show()

zu:

GMOnlineBoardDialog().Hide()

Aber wie gesagt keine Ahnung(also nich wirklich, pyton hasst mich und ich hasse python)
11/17/2013 05:54 Yiv#12
Erscheint trotzdem :(
Aber Danke für den Lösungsversuch :)

Bin aber nun erstmal schlafen :D

MfG
11/17/2013 10:05 KaMeR1337#13
Quote:
Originally Posted by DaJuBi View Post
Erscheint trotzdem :(
Aber Danke für den Lösungsversuch :)

Bin aber nun erstmal schlafen :D

MfG
add empty line at the end
11/17/2013 12:07 .XXShuzZzle#14
Quote:
Originally Posted by iYoshix3 View Post
Entfern die letzte Zeile, mit dem "ClassName.Show()"

Mfg,
Yoshix3
Das ist richtig. In der uigmboard.py letzte zeile wo das steht entfernen wie karmer auch schon sagte

Quote:
Originally Posted by CryPrime View Post
Entferne mal import uigmonlineboard

Yoshi erzählt nur misst der hat doch kein plan
Das ist einfach nur dämlich er will es ja schließlich mit f7 aufrufen
11/17/2013 14:36 Yiv#15
Shuzzle, das habe ich ja schon gemacht - steht auch als Antwort. Ich habe dann aber einen Fehler bekommen: [Only registered and activated users can see links. Click Here To Register...]

MfG