Here is my HOW2 add the client with pressing Fx buton.
1.) Open game.py and add this line:
Example:
Code:
testAlignment = 0
BPisLoaded = 0
2.) Now search for 'DIK_F4'.
3.) Add a new line with this:
Code:
onPressKeyDict[app.DIK_F7] = lambda : self.__BonusPage()
4.) Then you must add this function:
Code:
def __BonusPage(self):
import uiBonusPage
global BPisLoaded
try:
if BPisLoaded != 1:
exec 'uiBonusPage.BonusBoardDialog().Show()'
else:
pass
except ImportError:
import dbg,app
dbg.Trace('uiBonusPage.py Importing error')
app.Abort()
5.) Now you done the game.py, save&close.
6.) Open uibonuspage.py and write in the first lines this:
7.) Now replace the __init__ to this:
Code:
def __init__(self):
ui.ScriptWindow.__init__(self)
self.LoadUI()
game.BPisLoaded = 1
8.) Now replace the __del__ to this:
Code:
def __del__(self):
ui.ScriptWindow.__del__(self)
self.Board.Hide()
game.BPisLoaded = 0
9. Then search for this and make it to comment with '#':
Code:
#BonusBoardDialog().Show()
10.) Now save&close, then open the ui.py and search for this in ui.py:
Code:
class Button(Window):
11.) And add this function in the class:
Code:
##GM Online Board Extension
def GetText(self):
if not self.ButtonText:
return# ""
return self.ButtonText.GetText()
Example:
Code:
def SetText(self, text, height = 4):
if not self.ButtonText:
textLine = TextLine()
textLine.SetParent(self)
textLine.SetPosition(self.GetWidth()/2, self.GetHeight()/2)
textLine.SetVerticalAlignCenter()
textLine.SetHorizontalAlignCenter()
textLine.Show()
self.ButtonText = textLine
self.ButtonText.SetText(text)
##GM Online Board Extension
def GetText(self):
if not self.ButtonText:
return# ""
return self.ButtonText.GetText()
def SetFormToolTipText(self, type, text, x, y):
if not self.ToolTipText:
toolTip=createToolTipWindowDict[type]()
toolTip.SetParent(self)
toolTip.SetSize(0, 0)
toolTip.SetHorizontalAlignCenter()
toolTip.SetOutline()
toolTip.Hide()
toolTip.SetPosition(x + self.GetWidth()/2, y)
self.ToolTipText=toolTip
self.ToolTipText.SetText(text)
12.) Save&Close. Now you must add the uibonuspage.py in the root_pack.xml and you're done.
Code:
<File archivedPath="uibonuspage.py" type="2"><![CDATA[Source\uibonuspage.py]]></File>