Beispiel #1
0
std::string GetConfsInt(std::string Name, std::string Namespace, LuaManager &L)
{
    std::string Retval;
    if (Namespace.length())
    {
        if (L.UseArray(Namespace))
        {
			if (L.CallFunction(Name.c_str(), 0, 1)) {
				if (L.RunFunction())
					Retval = L.GetFunctionResultS();
			}
			else {
				Retval = L.GetFieldS(Name);
			}
			L.Pop();
		}
    }
    else {
		if (L.CallFunction(Name.c_str(), 0, 1)) {
			if (L.RunFunction())
				Retval = L.GetFunctionResultS();
		} else
	        Retval = L.GetGlobalS(Name);
	}
    return Retval;
}
Beispiel #2
0
double GetConffInt(std::string Name, std::string Namespace, LuaManager &L)
{
    double Retval = 0;
    if (Namespace.length())
    {
        if (L.UseArray(Namespace))
        {
			if (L.CallFunction(Name.c_str(), 0, 1)) {
				if (L.RunFunction())
					Retval = L.GetFunctionResultD();
			}
			else {
				Retval = L.GetFieldD(Name, 0);
			}

			L.Pop();
        }
    }
    else {
		if (L.CallFunction(Name.c_str(), 0, 1)) {
			if (L.RunFunction())
				Retval = L.GetFunctionResultD();
		} else
	        Retval = L.GetGlobalD(Name, 0);
	}
    return Retval;
}
Beispiel #3
0
float ScreenSelectMusic::GetListVerticalTransformation(const float Y)
{
    LuaManager *Lua = Animations->GetEnv();
    if (Lua->CallFunction("TransformListVertical", 1, 1))
    {
        Lua->PushArgument(Y);
        Lua->RunFunction();
        return Lua->GetFunctionResultF();
    }
    else return 0;
}