Skip to content
Snippets Groups Projects
Commit 4927ae7f authored by Falampe's avatar Falampe
Browse files

added png support for static presentations

parent 2ad1121b
No related branches found
No related tags found
No related merge requests found
using Codice.Client.BaseCommands.IssueTracker;
using System;
using System.IO;
using TeachR.ApplicationManager;
using TeachR.WebCommunication;
using UnityEngine;
using TeachR.StructureTree;
using System.Linq;
namespace TeachR.Displays
{
......@@ -12,6 +12,9 @@ namespace TeachR.Displays
{
public static Presentation Presentation { get; private set; }
public static event Action OnLoad;
private static readonly string[] allowedFileFormats = { ".png", ".jpg" };
private static string folderPath;
private static string[] filePath;
[RuntimeInitializeOnLoadMethod]
private static void Init()
......@@ -44,17 +47,16 @@ namespace TeachR.Displays
else Debug.Log("No slides loaded yet");
}
private static string folderPath;
private static string[] filePath;
// Look into themeFolder and load jpg-pictures to posters in classroom.
// If folder does not exist or is empty, no posters will be loaded.
public static async void LoadPresentationOnThemeChange(string fromFolder)
{
Debug.Log("ICH LEBE!");
folderPath = Path.Combine(Application.streamingAssetsPath, "Config~", fromFolder, "presentation");
if (!Directory.Exists(folderPath)) return;
filePath = Directory.GetFiles(folderPath, "*.jpg");// mehr dateiformate zulassen
//filePath = Directory.GetFiles(folderPath, "*.jpg");// mehr dateiformate zulassen
filePath = Directory.GetFiles(folderPath, "*.*", SearchOption.TopDirectoryOnly)
.Where(f => allowedFileFormats.Contains(Path.GetExtension(f)))
.ToArray();
if (filePath.Length > 0)
{
Presentation = await Presentation.FromFiles(filePath);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment