LoneTraveller
Warlord
I'm working on creating a widget
I finished my SDK part of the mod now I'm having problems with the button creation. Specifically when I start the mod up I always get this error message and I don't understand what the python is reading. I looked in the python API and in theory it should work.
Here is the error log :
Here is the code relating to the error message :
It seems to think that the 1st parameter for the widget is a CyPlayer although when I searched this API (http://civ4bug.sourceforge.net/PythonAPI/index.html) it leads to an integer.
Please help
PS : the error is for the second "appendMultiListButton" the first one seems to pass.
I finished my SDK part of the mod now I'm having problems with the button creation. Specifically when I start the mod up I always get this error message and I don't understand what the python is reading. I looked in the python API and in theory it should work.
Here is the error log :
Code:
Traceback (most recent call last):
File "CvScreensInterface", line 705, in forceScreenRedraw
File "CvMainInterface", line 727, in redraw
File "CvMainInterface", line 1541, in updateSelectionButtons
ArgumentError: Python argument types in
CyGInterfaceScreen.appendMultiListButton(CyGInterfaceScreen, str, str, int, CvPythonExtensions.WidgetTypes, CyPlayer, int, bool)
did not match C++ signature:
appendMultiListButton(class CyGInterfaceScreen {lvalue}, char const *, char const *, int, enum WidgetTypes, int, int, bool)
ERR: Python function forceScreenRedraw failed, module CvScreensInterface
Here is the code relating to the error message :
Code:
# Lone's Tanker Addon Start
# Section for the unloading of Oil to cities
pUnit = g_pSelectedUnit
iUnitType = pUnit.getUnitType()
pPlot = CyInterface().getSelectionPlot()
pUnitOwner = gc.getPlayer( pUnit.getOwner( ))
if pUnitOwner.isTurnActive( ):
if iUnitType == gc.getInfoTypeForString('UNIT_TANKER') and pPlot.isCity() and pUnit.isTankerFull():
screen.appendMultiListButton( "BottomButtonContainer", ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTON_OIL").getPath(), 0, WidgetTypes.WIDGET_TANKER_UNLOAD_OIL, pUnitOwner, pUnit.getID(), False )
pPlot.addOilToPlotGroup(NB_TURNS_OIL, pUnitOwner)
screen.show( "BottomButtonContainer" )
iCount = iCount + 1
# Section for the loading of oil from oil producing cities
pUnit = g_pSelectedUnit
if pUnitOwner.isTurnActive( ):
if iUnitType == gc.getInfoTypeForString('UNIT_TANKER') and (pPlot.getPlotCity()).hasBonus(gc.getInfoTypeForString('BONUS_OIL')) and (pUnit.isTankerFull()!= 1):
screen.appendMultiListButton( "BottomButtonContainer", ArtFileMgr.getInterfaceArtInfo("INTERFACE_BUTTON_OIL").getPath(), 0, WidgetTypes.WIDGET_TANKER_LOAD_OIL, pUnitOwner, pUnit.getID(), False )
screen.show( "BottomButtonContainer" )
iCount = iCount + 1
# Lone's Tanker Addon End
It seems to think that the 1st parameter for the widget is a CyPlayer although when I searched this API (http://civ4bug.sourceforge.net/PythonAPI/index.html) it leads to an integer.
Please help
PS : the error is for the second "appendMultiListButton" the first one seems to pass.