Example #1
0
    public static void ShowMap(string mapName)
    {
        TarKov.MainWindow window = AppHandler.window;
        window.ChromiumBrowser.Visibility = Visibility.Hidden;
        window.MapImage.Visibility        = Visibility.Visible;
        window.CloseMap.Visibility        = Visibility.Visible;
        ImageBrush imgBrush = new ImageBrush();

        imgBrush.Opacity = 1f;
        var resourceNames = GetResourceNames();
        var b             = false;

        foreach (var v in resourceNames)
        {
            if (v == ("res/" + mapName.ToLower() + ".png") || v == ("res/" + mapName.ToLower() + ".jpg"))
            {
                var extention = v.Split('.')[1];
                imgBrush.ImageSource = new BitmapImage(new Uri($"pack://application:,,,/res/{mapName}.{extention}"));
                b = true;
                break;
            }
        }
        if (b)
        {
            window.MapImage.Fill = imgBrush;
        }
        else
        {
            throw new System.IO.FileNotFoundException(mapName);
        }
    }
Example #2
0
 public static void HideAndBrowserShow()
 {
     TarKov.MainWindow window = AppHandler.window;
     window.ChromiumBrowser.Visibility = Visibility.Visible;
     window.MapImage.Visibility        = Visibility.Hidden;
 }