font updates
This commit is contained in:
Binary file not shown.
BIN
RVM_Beta1.0/RVM_Beta1.0/RVM安装与使用指南Beta1.0.pdf
Normal file
BIN
RVM_Beta1.0/RVM_Beta1.0/RVM安装与使用指南Beta1.0.pdf
Normal file
Binary file not shown.
12
RVM_Beta1.0/RVM_Beta1.0/index.html
Normal file
12
RVM_Beta1.0/RVM_Beta1.0/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>RimWorld Visual Mod Maker v50</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
1242
RVM_Beta1.0/RVM_Beta1.0/package-lock.json
generated
Normal file
1242
RVM_Beta1.0/RVM_Beta1.0/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
RVM_Beta1.0/RVM_Beta1.0/package.json
Normal file
22
RVM_Beta1.0/RVM_Beta1.0/package.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "rimworld-visual-mod-maker-v50",
|
||||
"version": "0.50.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"web": "vite --host 127.0.0.1",
|
||||
"dev": "vite --host 127.0.0.1",
|
||||
"build": "tsc && vite build"
|
||||
},
|
||||
"dependencies": {
|
||||
"jszip": "3.10.1",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "18.2.66",
|
||||
"@types/react-dom": "18.2.22",
|
||||
"typescript": "5.4.5",
|
||||
"vite": "5.4.21"
|
||||
}
|
||||
}
|
||||
10
RVM_Beta1.0/RVM_Beta1.0/src/main.tsx
Normal file
10
RVM_Beta1.0/RVM_Beta1.0/src/main.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import App from "./ui/App";
|
||||
import "./ui/styles.css";
|
||||
|
||||
createRoot(document.getElementById("root")!).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
||||
1936
RVM_Beta1.0/RVM_Beta1.0/src/ui/App.tsx
Normal file
1936
RVM_Beta1.0/RVM_Beta1.0/src/ui/App.tsx
Normal file
File diff suppressed because it is too large
Load Diff
78
RVM_Beta1.0/RVM_Beta1.0/src/ui/styles.css
Normal file
78
RVM_Beta1.0/RVM_Beta1.0/src/ui/styles.css
Normal file
@@ -0,0 +1,78 @@
|
||||
:root {
|
||||
font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
color: #2e2419;
|
||||
background: #eee8dc;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body { margin: 0; }
|
||||
button, input, select, textarea { font: inherit; }
|
||||
button { border: 0; border-radius: 12px; padding: 10px 14px; background: #efe1cf; color: #3d2f20; font-weight: 700; cursor: pointer; }
|
||||
button:hover { filter: brightness(.97); }
|
||||
button.active, button.primary { background: #254834; color: white; }
|
||||
.app { min-height: 100vh; }
|
||||
header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 26px 38px; background: linear-gradient(90deg, #f7f4ed, #eadfcd); border-bottom: 1px solid #d9cab7; position: sticky; top: 0; z-index: 5; }
|
||||
h1 { margin: 0; font-size: 28px; }
|
||||
header p { margin: 8px 0 0; color: #765f48; }
|
||||
code { background: #f3eadb; color: #613b18; border-radius: 8px; padding: 2px 6px; }
|
||||
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
|
||||
.toolbar label { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 14px; background: #fbf8f0; border: 1px solid #e3d2bd; }
|
||||
main { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 96px); align-items: start; }
|
||||
nav {
|
||||
padding: 22px;
|
||||
background: #faf7ef;
|
||||
border-right: 1px solid #decfbd;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
position: sticky;
|
||||
top: 106px;
|
||||
height: calc(100vh - 106px);
|
||||
overflow-y: auto;
|
||||
z-index: 4;
|
||||
}
|
||||
nav::-webkit-scrollbar { width: 8px; }
|
||||
nav::-webkit-scrollbar-thumb { background: #d9cab7; border-radius: 999px; }
|
||||
nav button { text-align: left; }
|
||||
section { padding: 28px; }
|
||||
.grid { display: grid; grid-template-columns: minmax(350px, 1fr) minmax(350px, 1fr); gap: 24px; align-items: start; }
|
||||
.card { background: #fffaf3; border: 1px solid #deceb9; border-radius: 22px; padding: 22px; box-shadow: 0 18px 60px rgba(68,45,20,.08); margin-bottom: 22px; }
|
||||
.card h2 { margin-top: 0; }
|
||||
.field { display: grid; gap: 8px; margin: 14px 0; font-weight: 700; color: #5b452e; }
|
||||
.field input, .field select, .field textarea, select { width: 100%; border: 1px solid #cdb89f; background: white; border-radius: 14px; padding: 12px; color: #22180e; }
|
||||
.field textarea { min-height: 120px; resize: vertical; }
|
||||
.check { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 12px; background: #f3eadc; border-radius: 14px; font-weight: 700; }
|
||||
.rowCard { padding: 16px; margin: 16px 0; border: 1px solid #e1d2bf; border-radius: 18px; background: #fffdf8; }
|
||||
.textureGroup { background: #f7efe4; border-radius: 18px; padding: 14px; margin: 16px 0; }
|
||||
.textureGroup h3 { margin: 0 0 10px; }
|
||||
.drop { display: grid; gap: 8px; padding: 16px; border: 2px dashed #c9b69e; border-radius: 18px; background: rgba(255,255,255,.64); margin: 10px 0; min-height: 95px; align-content: center; cursor: pointer; }
|
||||
.drop input { display: none; }
|
||||
.drop.dragOver { background: #e6f4ea; border-color: #2d7a46; }
|
||||
.drop span { color: #735a40; }
|
||||
.asset { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #deceb9; }
|
||||
.errors { color: #aa2a1c; font-weight: 700; }
|
||||
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
|
||||
.chips label { background: #fff; border: 1px solid #e4d5c5; border-radius: 14px; padding: 12px; }
|
||||
pre { white-space: pre-wrap; background: #f4eadb; border-radius: 14px; padding: 18px; }
|
||||
@media (max-width: 900px) { main { grid-template-columns: 1fr; } nav { position: sticky; top: 0; height: auto; max-height: 45vh; overflow-y: auto; border-right: 0; border-bottom: 1px solid #decfbd; } .grid { grid-template-columns: 1fr; } header { align-items: flex-start; flex-direction: column; position: static; } }
|
||||
.rowHeader { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
|
||||
.rowHeader h3 { margin: 0; }
|
||||
button.danger { background: #f4d6d1; color: #8a1f12; }
|
||||
.rowLine { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
|
||||
.selectedGenes { margin: 10px 0 16px; }
|
||||
.chip { display: inline-flex; align-items: center; gap: 6px; background: #dff3e8; border-radius: 999px; padding: 6px 10px; font-weight: 700; }
|
||||
.chip button { padding: 0 6px; border-radius: 999px; background: transparent; }
|
||||
.geneCategory { margin: 16px 0; padding: 14px; border-radius: 18px; background: #f7efe4; }
|
||||
.geneCategory h3 { margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; }
|
||||
.geneOption { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
|
||||
.geneOption span { display: grid; gap: 4px; }
|
||||
.geneOption em { color: #765f48; font-style: normal; font-size: .92em; }
|
||||
@media (max-width: 700px) { .rowLine { grid-template-columns: 1fr; } .rowHeader { align-items: stretch; flex-direction: column; } }
|
||||
.toolbarInline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
||||
.accordionCard { padding: 0; overflow: hidden; }
|
||||
.accordionHeader { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 16px; cursor: pointer; background: #f8efe2; border-bottom: 1px solid #e3d3c0; }
|
||||
.accordionHeader:hover { filter: brightness(.985); }
|
||||
.accordionHeader h3 { margin: 0 0 4px; }
|
||||
.accordionHeader p { margin: 0; color: #765f48; font-size: .92rem; }
|
||||
.accordionBody { padding: 16px; }
|
||||
.hint { color: #765f48; font-size: .95rem; }
|
||||
@media (max-width: 700px) { .accordionHeader { align-items: stretch; flex-direction: column; } .toolbarInline { width: 100%; } }
|
||||
1
RVM_Beta1.0/RVM_Beta1.0/src/vite-env.d.ts
vendored
Normal file
1
RVM_Beta1.0/RVM_Beta1.0/src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
declare module "*.css";
|
||||
28
RVM_Beta1.0/RVM_Beta1.0/tsconfig.json
Normal file
28
RVM_Beta1.0/RVM_Beta1.0/tsconfig.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": [
|
||||
"DOM",
|
||||
"DOM.Iterable",
|
||||
"ES2020"
|
||||
],
|
||||
"allowJs": false,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
"ignoreDeprecations": "5.0"
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
],
|
||||
"references": []
|
||||
}
|
||||
77
RVM_Beta1.0/RVM_Beta1.0/vite.config.js
Normal file
77
RVM_Beta1.0/RVM_Beta1.0/vite.config.js
Normal file
@@ -0,0 +1,77 @@
|
||||
import { defineConfig } from "vite";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
function readRequestBody(req) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let body = "";
|
||||
req.setEncoding("utf8");
|
||||
req.on("data", (chunk) => { body += chunk; });
|
||||
req.on("end", () => resolve(body));
|
||||
req.on("error", reject);
|
||||
});
|
||||
}
|
||||
|
||||
function sendJson(res, code, payload) {
|
||||
res.statusCode = code;
|
||||
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
||||
res.end(JSON.stringify(payload));
|
||||
}
|
||||
|
||||
function sanitizeFileName(value) {
|
||||
return String(value || "modmaker_log.txt")
|
||||
.replace(/[^A-Za-z0-9._-]+/g, "_")
|
||||
.replace(/^_+|_+$/g, "") || "modmaker_log.txt";
|
||||
}
|
||||
|
||||
function modMakerLoggerPlugin() {
|
||||
return {
|
||||
name: "modmaker-terminal-and-file-logger",
|
||||
configureServer(server) {
|
||||
const logsDir = path.resolve(process.cwd(), "logs");
|
||||
const sourceDir = path.resolve(process.cwd(), "source");
|
||||
fs.mkdirSync(logsDir, { recursive: true });
|
||||
fs.mkdirSync(sourceDir, { recursive: true });
|
||||
|
||||
server.middlewares.use(async (req, res, next) => {
|
||||
const url = (req.url || "").split("?")[0];
|
||||
if (req.method !== "POST" || (url !== "/__modmaker/log" && url !== "/__modmaker/export-log" && url !== "/__modmaker/export-source")) return next();
|
||||
try {
|
||||
const raw = await readRequestBody(req);
|
||||
const payload = raw ? JSON.parse(raw) : {};
|
||||
|
||||
if (url === "/__modmaker/log") {
|
||||
const entries = Array.isArray(payload.entries) ? payload.entries : [];
|
||||
for (const entry of entries) {
|
||||
console.log(`[ModMaker][${entry.timestamp || new Date().toISOString()}][${entry.scope || "project"}] ${entry.action || "Log"}: ${entry.detail || ""}`);
|
||||
}
|
||||
return sendJson(res, 200, { ok: true, count: entries.length });
|
||||
}
|
||||
|
||||
if (url === "/__modmaker/export-log") {
|
||||
const fileName = sanitizeFileName(payload.fileName);
|
||||
const target = path.join(logsDir, fileName.endsWith(".txt") ? fileName : `${fileName}.txt`);
|
||||
fs.writeFileSync(target, String(payload.content || ""), "utf8");
|
||||
console.log(`[ModMaker] Full export log written: ${target}`);
|
||||
return sendJson(res, 200, { ok: true, path: target });
|
||||
}
|
||||
|
||||
if (url === "/__modmaker/export-source") {
|
||||
const fileName = sanitizeFileName(payload.fileName);
|
||||
const target = path.join(sourceDir, fileName.endsWith(".json") ? fileName : `${fileName}.json`);
|
||||
fs.writeFileSync(target, String(payload.content || ""), "utf8");
|
||||
console.log(`[ModMaker] Project source written: ${target}`);
|
||||
return sendJson(res, 200, { ok: true, path: target });
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("[ModMaker] Logger endpoint failed:", error);
|
||||
return sendJson(res, 500, { ok: false, error: String(error) });
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [modMakerLoggerPlugin()]
|
||||
});
|
||||
Reference in New Issue
Block a user