1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Notifications

Discussion in 'Civ5 - SDK / LUA' started by Bhruic, Sep 30, 2010.

  1. Bhruic

    Bhruic Emperor

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    I'm trying to add a new notification in my script. Unfortunately it seems like I'm banging my head against the wall.

    FromLua called on NotificationAdded- this shouldn't happen. Use UI.AddNotification()

    That's the error I got when I tried, for informational sake, to call Events.NotificationAdded directly. The problem is, UI. AddNotification isn't exposed to Lua, so you can't call it. This leads to the banging my head part, I can't seem to find any other way to add notifications. I can manually call OnNotificationAdded(), but while that will put a fake notification up, you can't actually interact with it, and you can't even remove it.

    So on the off chance that someone with more knowledge/insight than I have has an idea, I welcome any suggestions. :)

    Bh
     
  2. Bhruic

    Bhruic Emperor

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    Well, after lots... and lots... and lots of file hacking, I finally managed to come up with a system that works. It doesn't do "real" notifications, but it can fake them well enough.

    If anyone else is interested in using the system, let me know, and I can write something up on it. But ideally, Firaxis will implement UI.AddNotification() in Lua sooner rather than later.

    Bh
     
  3. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    I would love to see how it's done, yes. It doesn't have to be uber-detailed, just a working example with a little explanation is a great start.
     
  4. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    i'm interested too
     
  5. Bhruic

    Bhruic Emperor

    Joined:
    Nov 15, 2005
    Messages:
    1,457

Share This Page