Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 12, 2011, 12:11:53 AM (13 years ago)
Author:
dafrick
Message:

Replacing GametypeStatus overlay with notifications.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutoriallevel2/src/modules/notifications/NotificationQueueCEGUI.cc

    r8449 r8450  
    4949    // Register tolua_open function when loading the library.
    5050    DeclareToluaInterface(Notifications);
     51
     52    /*static*/ const std::string NotificationQueueCEGUI::NOTIFICATION_LAYER("NotificationLayer");
    5153
    5254    NotificationQueueCEGUI::NotificationQueueCEGUI(const std::string& name, const std::string& senders, unsigned int size, unsigned int displayTime) : NotificationQueue(name, senders, size, displayTime)
     
    8183        // Remove the NotificationQueue in lua.
    8284        if(GameMode::showsGraphics() && !noGraphics)
    83             GUIManager::getInstance().getLuaState()->doString("NotificationLayer.removeQueue(\"" + this->getName() +  "\")");
     85            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".removeQueue(\"" + this->getName() +  "\")");
    8486
    8587        NotificationQueue::destroy();
     
    110112        this->displaySize_ = size;
    111113        if(size.z == 0.0 && size.w == 0.0)
    112             GUIManager::getInstance().getLuaState()->doString("NotificationLayer.resizeQueue(\"" + this->getName() + "\", " + multi_cast<std::string>(this->displaySize_.x) + ", " + multi_cast<std::string>(this->displaySize_.y) + ")");
     114            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".resizeQueue(\"" + this->getName() + "\", " + multi_cast<std::string>(this->displaySize_.x) + ", " + multi_cast<std::string>(this->displaySize_.y) + ")");
    113115        else
    114             GUIManager::getInstance().getLuaState()->doString("NotificationLayer.resizeQueue(\"" + this->getName() + "\", " + multi_cast<std::string>(this->displaySize_.x) + ", " + multi_cast<std::string>(this->displaySize_.y) + ", " + multi_cast<std::string>(this->displaySize_.z) + ", " + multi_cast<std::string>(this->displaySize_.w) + ")");
     116            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".resizeQueue(\"" + this->getName() + "\", " + multi_cast<std::string>(this->displaySize_.x) + ", " + multi_cast<std::string>(this->displaySize_.y) + ", " + multi_cast<std::string>(this->displaySize_.z) + ", " + multi_cast<std::string>(this->displaySize_.w) + ")");
    115117    }
    116118
     
    137139
    138140        this->position_ = position;
    139         GUIManager::getInstance().getLuaState()->doString("NotificationLayer.moveQueue(\"" + this->getName() + "\", " + multi_cast<std::string>(this->position_.x) + ", " + multi_cast<std::string>(this->position_.y) + ", " + multi_cast<std::string>(this->position_.z) + ", " + multi_cast<std::string>(this->position_.w) + ")");
     141        GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".moveQueue(\"" + this->getName() + "\", " + multi_cast<std::string>(this->position_.x) + ", " + multi_cast<std::string>(this->position_.y) + ", " + multi_cast<std::string>(this->position_.z) + ", " + multi_cast<std::string>(this->position_.w) + ")");
    140142    }
    141143
     
    154156        // TODO: Check whether the alignment string is correct?
    155157        this->alignment_ = alignment;
    156         GUIManager::getInstance().getLuaState()->doString("NotificationLayer.changeQueueAlignment(\"" + this->getName() + "\", \"" + this->alignment_ + "\")");
     158        GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".changeQueueAlignment(\"" + this->getName() + "\", \"" + this->alignment_ + "\")");
    157159    }
    158160
     
    169171
    170172        this->fontSize_ = size;
    171         GUIManager::getInstance().getLuaState()->doString("NotificationLayer.changeQueueFontSize(\"" + this->getName() + "\", " + multi_cast<std::string>(this->fontSize_) + ")");
     173        GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".changeQueueFontSize(\"" + this->getName() + "\", " + multi_cast<std::string>(this->fontSize_) + ")");
    172174    }
    173175
     
    189191            stream << std::hex << std::setw(2) << std::setfill('0') << int(this->fontColor_[(i+3)%4]*255);
    190192        this->fontColorStr_ = stream.str();
    191         GUIManager::getInstance().getLuaState()->doString("NotificationLayer.changeQueueFontColor(\"" + this->getName() + "\", \"" + this->fontColorStr_ + "\")");
     193        GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".changeQueueFontColor(\"" + this->getName() + "\", \"" + this->fontColorStr_ + "\")");
    192194    }
    193195
     
    218220         // Push the Notification to the GUI.
    219221        if(GameMode::showsGraphics())
    220             GUIManager::getInstance().getLuaState()->doString("NotificationLayer.pushNotification(\"" + this->getName() + "\", \"" + notification->getMessage() + "\")");
     222            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".pushNotification(\"" + this->getName() + "\", \"" + notification->getMessage() + "\")");
    221223    }
    222224
     
    229231        // Pops the Notification from the GUI.
    230232        if(GameMode::showsGraphics())
    231             GUIManager::getInstance().getLuaState()->doString("NotificationLayer.popNotification(\"" + this->getName() + "\")");
     233            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".popNotification(\"" + this->getName() + "\")");
    232234    }
    233235
     
    240242        // Removes the Notification from the GUI.
    241243        if(GameMode::showsGraphics())
    242             GUIManager::getInstance().getLuaState()->doString("NotificationLayer.removeNotification(\"" + this->getName() + "\", " + multi_cast<std::string>(index) + ")");
     244            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".removeNotification(\"" + this->getName() + "\", " + multi_cast<std::string>(index) + ")");
    243245    }
    244246
     
    255257        // Clear the NotificationQueue in the GUI.
    256258        if(GameMode::showsGraphics() && !noGraphics)
    257             GUIManager::getInstance().getLuaState()->doString("NotificationLayer.clearQueue(\"" + this->getName() + "\")");
     259            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".clearQueue(\"" + this->getName() + "\")");
    258260    }
    259261
     
    265267    {
    266268        if(GameMode::showsGraphics())
    267             GUIManager::getInstance().getLuaState()->doString("NotificationLayer.createQueue(\"" + this->getName() +  "\", " + multi_cast<std::string>(this->getMaxSize()) + ")");
     269            GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".createQueue(\"" + this->getName() +  "\", " + multi_cast<std::string>(this->getMaxSize()) + ")");
    268270    }
    269271
Note: See TracChangeset for help on using the changeset viewer.