Announcement

Collapse
No announcement yet.

Screen Input handling

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Screen Input handling

    I'm trying to make changes to some of the advisor screens, but can't seem to get the handleInput function to even be called. Does anyone have any ideas how the input works?

    Even on a screen which already has code in that function like the Religion screen, it seems like the handleInput function isn't getting called at all.

    I know how to add new text and buttons etc, and can use some of the standard default input handling ie... add a new foreign advisor screen and the text label to the bottom of the screen so that the new screen can be selected. But thats as far I can get.

    As a test to see if the handleInput function is getting called at all. I added code which displays some text (also have tried buttons and images) on the screen and if the handleinput function got called at all then this text would disappear.

    By creating a global variable called "show" and then adding to the screen drawing:

    if (show == 0):
    szActiveId = "test"
    screen.setText(szActiveId, "", u"" + localText.getColorText("TXT_KEY_FOREIGN_ADVISOR_ACTIVE", (), gc.getInfoTypeForString("COLOR_YELLOW")).upper() + u"", CvUtil.FONT_LEFT_JUSTIFY, 400, 200, 0, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

    Then making the first line in the handleInput function:

    show = 1

    But it really seems that no matter what happens the text is always there ( I have also tried various screens).
Working...
X