[bugfix] Plugins(VRCT Subtitles as testing one): Apply styles by importing css file.
This commit is contained in:
1 parent
a59b9282df
commit
5681038c22
28 files changed
+52
-13
No files matched your search
+17
-2
@@ -1,11 +1,13 @@
|
||||
import { initStore, StoreContext } from "./store/store.js";
|
||||
import { SubtitleSystemContainer } from "./subtitle_system_container/SubtitleSystemContainer";
|
||||
import { SubtitlesController } from "./subtitle_system_container/_controllers/subtitlesController.jsx";
|
||||
import { SubtitlesController } from "./subtitle_system_container/_controllers/SubtitlesController.jsx";
|
||||
|
||||
export const init = (plugin_context) => {
|
||||
initStore(plugin_context.createAtomWithHook);
|
||||
const { logic_configs } = plugin_context;
|
||||
|
||||
loadPluginCSS("./main.css");
|
||||
|
||||
const EntryComponents = () => {
|
||||
return (
|
||||
<StoreContext.Provider value={logic_configs}>
|
||||
@@ -19,4 +21,17 @@ export const init = (plugin_context) => {
|
||||
plugin_context.registerComponent(EntryComponents);
|
||||
};
|
||||
|
||||
export default init;
|
||||
export default init;
|
||||
|
||||
|
||||
// CSS を動的に読み込む関数
|
||||
const loadPluginCSS = (cssUrl) => {
|
||||
if (typeof document === "undefined") return;
|
||||
// すでに読み込まれているかチェック
|
||||
if (document.getElementById("plugin-main-css")) return;
|
||||
const link = document.createElement("link");
|
||||
link.rel = "stylesheet";
|
||||
link.href = cssUrl;
|
||||
link.id = "plugin-main-css";
|
||||
document.head.appendChild(link);
|
||||
};
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
"plugin_id": "vrct_plugin_subtitles",
|
||||
"asset_name": "vrct_plugin_subtitles.zip",
|
||||
"location": "main_section",
|
||||
"plugin_version": "0.0.1",
|
||||
"plugin_version": "0.0.0",
|
||||
"min_supported_vrct_version": "3.0.4",
|
||||
"max_supported_vrct_version": "3.0.6"
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,7 +1,7 @@
|
||||
// import React, { useState, useRef, useEffect } from "react";
|
||||
import styles from "./PlayControlContainer.module.scss";
|
||||
import { useSubtitles } from "../_logics/useSubtitles";
|
||||
import { clsx } from "clsx";
|
||||
import clsx from "clsx";
|
||||
|
||||
export const PlayControlContainer = () => {
|
||||
const {
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
import plugin_index_1 from "./plugin_examples/index.jsx";
|
||||
import plugin_info_1 from "./plugin_examples/plugin_info.json";
|
||||
import plugin_index_1 from "./dev_plugin_subtitles/index.jsx";
|
||||
import plugin_info_1 from "./dev_plugin_subtitles/plugin_info.json";
|
||||
|
||||
export const dev_plugins = [
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user