added video ad to commandline

This commit is contained in:
Miodec 2022-07-18 11:36:47 +02:00
parent 5a3773da69
commit a7910477ff
2 changed files with 12 additions and 2 deletions

View file

@ -24,6 +24,7 @@ import { Auth } from "../firebase";
import * as EditPresetPopup from "../popups/edit-preset-popup";
import * as EditTagPopup from "../popups/edit-tags-popup";
import { navigate } from "../controllers/route-controller";
import * as VideoAdPopup from "../popups/video-ad-popup";
export let current: MonkeyTypes.CommandsGroup[] = [];
@ -2926,6 +2927,15 @@ export const defaultCommands: MonkeyTypes.CommandsGroup = {
icon: "fa-ad",
subgroup: commandsEnableAds,
},
{
id: "watchVideoAd",
display: "Watch video ad",
alias: "support donate",
icon: "fa-ad",
exec: (): void => {
VideoAdPopup.show();
},
},
{
id: "changeTheme",
display: "Theme...",

View file

@ -1,6 +1,6 @@
import * as Notifications from "../elements/notifications";
function show(): void {
export function show(): void {
if ($("#videoAdPopupWrapper").hasClass("hidden")) {
$("#videoAdPopupWrapper")
.stop(true, true)
@ -38,7 +38,7 @@ export function egVideoListener(options: Record<string, string>): void {
} else if (event === "finished") {
hide();
} else if (event === "empty") {
Notifications.add("Failed to load video ad. Please try again later", 0, 3);
Notifications.add("Failed to load video ad. Please try again later", -1, 3);
hide();
}
}