Esempio n. 1
0
    public void SetImage()
    {
        UIWindowSelectionListImage select = new UIWindowSelectionListImage(SelectImage, SELECT_IMAGE.Translate());

        select.AddItem("{NONE}", "", true);

        Dictionary <string, IEnumerable <string> > traits = new Dictionary <string, IEnumerable <string> >();

        traits.Add(CommonStringKeys.SOURCE.Translate(), new string[] { CommonStringKeys.FILE.Translate() });
        string relativePath = new FileInfo(Path.GetDirectoryName(Game.Get().quest.qd.questPath)).FullName;

        foreach (string s in Directory.GetFiles(relativePath, "*.png", SearchOption.AllDirectories))
        {
            select.AddItem(s.Substring(relativePath.Length + 1), traits);
        }
        foreach (string s in Directory.GetFiles(relativePath, "*.jpg", SearchOption.AllDirectories))
        {
            select.AddItem(s.Substring(relativePath.Length + 1), traits);
        }
        foreach (ImageData imageData in Game.Get().cd.Values <ImageData>())
        {
            select.AddItem(imageData);
        }
        select.ExcludeExpansions();
        select.Draw();
    }
Esempio n. 2
0
    public void Image()
    {
        var select = new UIWindowSelectionListImage(SelectImage, new StringKey("val", "SELECT_IMAGE"));

        select.AddItem("{NONE}", "");
        var traits = new Dictionary <string, IEnumerable <string> >
        {
            {
                CommonStringKeys.SOURCE.Translate(),
                new string[] { CommonStringKeys.FILE.Translate() }
            }
        };
        string relativePath = new FileInfo(Path.GetDirectoryName(Game.Get().quest.qd.questPath.Replace('\\', '/'))).FullName.Replace('\\', '/');

        foreach (string s in Directory.GetFiles(relativePath, "*.png", SearchOption.AllDirectories))
        {
            string file = s.Replace('\\', '/');
            select.AddItem(file.Substring(relativePath.Length + 1), traits);
        }
        foreach (string s in Directory.GetFiles(relativePath, "*.jpg", SearchOption.AllDirectories))
        {
            string file = s.Replace('\\', '/');
            select.AddItem(file.Substring(relativePath.Length + 1), traits);
        }
        select.Draw();
    }
Esempio n. 3
0
    public void Image()
    {
        if (puzzleComponent.puzzleClass.Equals("code"))
        {
            UIWindowSelectionList selectType = new UIWindowSelectionList(SelectImage, SELECT_IMAGE.Translate());
            selectType.AddItem("{NUMBERS}", "");
            selectType.AddItem(new StringKey("val", "SYMBOL").Translate(), "symbol");
            selectType.AddItem(new StringKey("val", "ELEMENT").Translate(), "element");
            selectType.Draw();
            return;
        }

        UIWindowSelectionListImage select = new UIWindowSelectionListImage(SelectImage, SELECT_IMAGE.Translate());

        Dictionary <string, IEnumerable <string> > traits = new Dictionary <string, IEnumerable <string> >();

        traits.Add(new StringKey("val", "SOURCE").Translate(), new string[] { new StringKey("val", "FILE").Translate() });
        string relativePath = new FileInfo(Path.GetDirectoryName(Game.Get().quest.qd.questPath)).FullName;

        foreach (string s in Directory.GetFiles(relativePath, "*.png", SearchOption.AllDirectories))
        {
            select.AddItem(s.Substring(relativePath.Length + 1), traits);
        }
        foreach (string s in Directory.GetFiles(relativePath, "*.jpg", SearchOption.AllDirectories))
        {
            select.AddItem(s.Substring(relativePath.Length + 1), traits);
        }
        foreach (KeyValuePair <string, PuzzleData> kv in Game.Get().cd.puzzles)
        {
            select.AddItem(kv.Value);
        }
        select.ExcludeExpansions();
        select.Draw();
    }
Esempio n. 4
0
    public void SetImage()
    {
        UIWindowSelectionListImage select = new UIWindowSelectionListImage(SelectImage, SELECT_IMAGE.Translate());

        select.AddItem("{NONE}", "");

        Dictionary <string, IEnumerable <string> > traits = new Dictionary <string, IEnumerable <string> >();

        traits.Add(new StringKey("val", "SOURCE").Translate(), new string[] { new StringKey("val", "FILE").Translate() });
        string relativePath = new FileInfo(Path.GetDirectoryName(Game.Get().quest.qd.questPath)).FullName;

        foreach (string s in Directory.GetFiles(relativePath, "*.png", SearchOption.AllDirectories))
        {
            select.AddItem(s.Substring(relativePath.Length + 1), traits);
        }
        foreach (string s in Directory.GetFiles(relativePath, "*.jpg", SearchOption.AllDirectories))
        {
            select.AddItem(s.Substring(relativePath.Length + 1), traits);
        }
        foreach (KeyValuePair <string, ImageData> kv in Game.Get().cd.images)
        {
            select.AddItem(kv.Value);
        }
        select.Draw();
    }
    public void ChangeTileSide()
    {
        if (GameObject.FindGameObjectWithTag(Game.DIALOG) != null)
        {
            return;
        }
        Game game = Game.Get();
        UIWindowSelectionListTraits select = new UIWindowSelectionListImage(SelectTileSide, new StringKey("val", "SELECT", CommonStringKeys.TILE));

        // Work out what sides are used
        HashSet <string> usedSides = new HashSet <string>();

        foreach (KeyValuePair <string, QuestData.QuestComponent> kv in game.quest.qd.components)
        {
            QuestData.Tile t = kv.Value as QuestData.Tile;
            if (t != null)
            {
                usedSides.Add(t.tileSideName);
                usedSides.Add(game.cd.tileSides[t.tileSideName].reverse);
            }
        }

        foreach (KeyValuePair <string, TileSideData> kv in game.cd.tileSides)
        {
            if (usedSides.Contains(kv.Key))
            {
                select.AddItem(kv.Value, new Color(0.4f, 0.4f, 1));
            }
            else
            {
                select.AddItem(kv.Value);
            }
        }
        select.Draw();
    }
Esempio n. 6
0
    public void Type()
    {
        if (GameObject.FindGameObjectWithTag(Game.DIALOG) != null)
        {
            return;
        }
        Game game = Game.Get();
        UIWindowSelectionListTraits select = new UIWindowSelectionListImage(SelectType, new StringKey("val", "SELECT", CommonStringKeys.TOKEN));

        select.AddItem(CommonStringKeys.NONE.Translate(), "{NONE}");

        foreach (KeyValuePair <string, TokenData> kv in game.cd.tokens)
        {
            select.AddItem(kv.Value);
        }
        select.Draw();
    }
Esempio n. 7
0
    public void Type()
    {
        if (GameObject.FindGameObjectWithTag(Game.DIALOG) != null)
        {
            return;
        }
        Game game = Game.Get();
        UIWindowSelectionListTraits select = new UIWindowSelectionListImage(SelectType, new StringKey("val", "SELECT", CommonStringKeys.TOKEN));

        select.AddItem(CommonStringKeys.NONE.Translate(), "{NONE}", true);

        foreach (TokenData kv in game.cd.Values <TokenData>())
        {
            select.AddItem(kv);
        }
        select.ExcludeExpansions();
        select.Draw();
    }