Ejemplo n.º 1
0
    public void SetApp(ModApp app)
    {
        this.app   = app;
        title.text = app.name;

        if (app.has_build == false)
        {
            lastBuildDate.gameObject.SetActive(false);
            noBuilds.SetActive(true);
        }
        else
        {
            lastBuildDate.text = app.last_build.GetCreatedAt().ToLongDateString();
        }
    }
Ejemplo n.º 2
0
        public async static Task <GetAppsResponse> Like(ModApp app)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }

            var func = ModPlayerFB.Functions;
            var resp = await func.GetHttpsCallable("like")
                       .CallAsync(new Dictionary <string, object>()
            {
                ["app_id"] = app.id
            });

            return(Reinterpret <GetAppsResponse>(resp.Data));
        }
Ejemplo n.º 3
0
        public async static Task SetPreviews(ModApp app, string[] urls)
        {
            if (app == null)
            {
                throw new ArgumentException(nameof(app));
            }
            if (urls == null)
            {
                throw new ArgumentException(nameof(urls));
            }

            var func = ModPlayerFB.Functions;
            var resp = await func.GetHttpsCallable("setThumbnail")
                       .CallAsync(new Dictionary <string, object>()
            {
                ["app_id"]       = app.id,
                ["preview_urls"] = string.Join(",", urls)
            });
        }
Ejemplo n.º 4
0
        public async static Task SetThumbnail(ModApp app, string url)
        {
            if (app == null)
            {
                throw new ArgumentException(nameof(app));
            }
            if (string.IsNullOrEmpty(url))
            {
                throw new ArgumentException(nameof(url));
            }

            var func = ModPlayerFB.Functions;
            var resp = await func.GetHttpsCallable("setThumbnail")
                       .CallAsync(new Dictionary <string, object>()
            {
                ["app_id"]        = app.id,
                ["thumbnail_url"] = url
            });
        }
Ejemplo n.º 5
0
        public void OnGUI()
        {
            EnsureResources();

            GUI.DrawTexture(new Rect(0, 0, 450, 400), Texture2D.whiteTexture);
            GUI.DrawTexture(new Rect(0, 0, 450, 100), logo);

            EditorGUILayout.BeginVertical();
            GUILayout.Space(110);

            if (appTitles != null)
            {
                appIdx = EditorGUILayout.Popup("App", appIdx, appTitles);
            }
            else
            {
                EditorGUILayout.HelpBox("Please wait for fetching app list", MessageType.Info);
            }

            modName = EditorGUILayout.TextField("Mod name", modName);
            version = EditorGUILayout.TextField("Version", version);

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Description", GUILayout.Width(146));
            description = EditorGUILayout.TextArea(description,
                                                   GUILayout.Height(40));
            EditorGUILayout.EndHorizontal();

            if (GUI.Button(new Rect(340, 270, 100, 30), "Publish"))
            {
                if (string.IsNullOrEmpty(modName) == false)
                {
                    targetApp = apps[appIdx];
                    BuildMod();
                }
            }

            EditorGUILayout.EndVertical();
        }
Ejemplo n.º 6
0
        public async static Task AddBuild(ModApp app, ModBuild build)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }
            if (build == null)
            {
                throw new ArgumentNullException(nameof(build));
            }

            var func = ModPlayerFB.Functions;
            var resp = await func.GetHttpsCallable("addBuild")
                       .CallAsync(new Dictionary <string, object>()
            {
                ["app_id"]      = app.id,
                ["scene_url"]   = build.scene_url,
                ["script_url"]  = build.script_url,
                ["title"]       = build.title,
                ["version"]     = build.version,
                ["description"] = build.description
            });
        }