Exemple #1
0
void DynamicObject::FireTimer(void)
{
    Script *script = 0;
    Lock();
    if (timer_script) {
        script = new Script(GetName(), timer_script);
    }
    Unlock();
    if (script) {
      script->Execute();
      delete script;
    }
}
Exemple #2
0
void Console::HandleTextFinished(StringHash eventType, VariantMap& eventData)
{
    using namespace TextFinished;
    
    String line = lineEdit_->GetText();
    if (!line.Empty())
    {
        Script* script = GetSubsystem<Script>();
        if (script)
            script->Execute(line);
        
        // Store to history, then clear the lineedit
        history_.Push(line);
        if (history_.Size() > historyRows_)
            history_.Erase(history_.Begin());
        historyPosition_ = history_.Size();
        
        currentRow_.Clear();
        lineEdit_->SetText(currentRow_);
    }
}