コード例 #1
0
    private void LoadSuggestions()
    {
        List <GConsoleItem> sugitems;

        //Not enough characters typed yet, no suggestions to be shown!
        if (minCharBeforeSuggestions != 0 && input.text.Length < minCharBeforeSuggestions)
        {
            sugitems = new List <GConsoleItem>();
        }
        else
        {
            sugitems = GConsole.GetSuggestionItems(input.text); //Ask GConsole for suggestions.
        }
        //Display suggestions (and hide unused suggestion boxes by passing null).
        for (int i = 0; i < suggestions.Length; i++)
        {
            if (i < sugitems.Count)
            {
                suggestions[i].ShowSuggestion(sugitems[i]);
            }
            else
            {
                suggestions[i].ShowSuggestion(null);
            }
        }
    }
コード例 #2
0
    static int GetSuggestionItems(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        string arg0           = LuaScriptMgr.GetLuaString(L, 1);
        List <GConsoleItem> o = GConsole.GetSuggestionItems(arg0);

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }