Exemplo n.º 1
0
    private static void CheckConflicts(GameStringTable table)
    {
        Map <string, string> .KeyCollection keys = table.GetAll().Keys;
        GameStringCategory category = table.GetCategory();

        foreach (GameStringTable table2 in s_tables.Values)
        {
            foreach (string str in keys)
            {
                if (table2.Get(str) != null)
                {
                    string message = string.Format("GameStrings.CheckConflicts() - Tag {0} is used in {1} and {2}. All tags must be unique.", str, category, table2.GetCategory());
                    Error.AddDevWarning("GameStrings Error", message, new object[0]);
                }
            }
        }
    }
Exemplo n.º 2
0
    public static bool LoadCategory(GameStringCategory cat)
    {
        if (s_tables.ContainsKey(cat))
        {
            Debug.LogWarning(string.Format("GameStrings.LoadCategory() - {0} is already loaded", cat));
            return(false);
        }
        GameStringTable table = new GameStringTable();

        if (!table.Load(cat))
        {
            Debug.LogError(string.Format("GameStrings.LoadCategory() - {0} failed to load", cat));
            return(false);
        }
        if (ApplicationMgr.IsInternal())
        {
            CheckConflicts(table);
        }
        s_tables.Add(cat, table);
        return(true);
    }