Skip to content

Commit

Permalink
Merge pull request #225 from OpenWebGAL/dev
Browse files Browse the repository at this point in the history
4.4.11
  • Loading branch information
MakinoharaShoko authored Jan 27, 2024
2 parents 2e9fb92 + 370ec1a commit a04fb7e
Show file tree
Hide file tree
Showing 65 changed files with 1,616 additions and 1,291 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webgal-terre",
"version": "4.4.10",
"version": "4.4.11",
"private": true,
"scripts": {
"dev": "concurrently \"yarn dev:terre\" \"yarn dev:origine\" \"yarn dev:start-dev-server\"",
Expand Down
3 changes: 2 additions & 1 deletion packages/origine2/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "webgal-origine-2",
"private": true,
"version": "4.4.10",
"version": "4.4.11",
"license": "MPL-2.0",
"scripts": {
"dev": "vite --host",
Expand All @@ -19,6 +19,7 @@
"@icon-park/react": "^1.4.2",
"@monaco-editor/react": "^4.4.5",
"@reduxjs/toolkit": "^1.8.1",
"@uiw/react-json-view": "^2.0.0-alpha.12",
"axios": "^1.6.0",
"cloudlogjs": "^1.0.11",
"i18next": "^22.4.15",
Expand Down
Binary file not shown.
1 change: 0 additions & 1 deletion packages/origine2/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
background-color: var(--bg-root);
width: 100%;
height: 100%;
text-align: center;
}

.App-logo {
Expand Down
1 change: 1 addition & 0 deletions packages/origine2/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Translation from "./components/translation/Translation";
import {lspSceneName} from "@/runtime/WG_ORIGINE_RUNTIME";
import './config/themes/theme.css';
import {PersistGate} from 'redux-persist/integration/react';
import './assets/font-family.css';

function App() {
useEffect(() => {
Expand Down
5 changes: 5 additions & 0 deletions packages/origine2/src/assets/font-family.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@font-face {
font-family: 'JetBrains Mono'; /* 自定义的字体名称 */
/*noinspection CssUnknownTarget*/
src: url('fonts/JetBrainsMono-Regular.ttf') format('truetype'); /* 字体文件的路径和格式 */
}
15 changes: 10 additions & 5 deletions packages/origine2/src/components/terreToggle/TerreToggle.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Toggle } from "@fluentui/react";
import { Switch } from "@fluentui/react-components";

interface ITerreToggle{
title:string,
Expand All @@ -9,8 +9,13 @@ interface ITerreToggle{
}

export default function TerreToggle(props:ITerreToggle){
return <Toggle styles={{ root: { margin: "0 0 0 0" } }}
checked={props.isChecked}
label={props.title} inlineLabel onText={props.onText} offText={props.offText}
onChange={(event, checked) => props.onChange(checked ?? false)} />;
return (
<div style={{display: 'flex', alignItems: 'center', flexWrap: 'nowrap'}}>
<Switch
checked={props.isChecked}
onChange={(event, data) => props.onChange(data.checked ?? false)}
/>
{props.isChecked ? props.onText : props.offText}
</div>
);
}
2 changes: 1 addition & 1 deletion packages/origine2/src/config/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export interface Info {
}

export const __INFO: Info = {
version: '4.4.10',
version: '4.4.11',
buildTime: '2023-12-30T03:22:49.651Z', // 编译时会通过 version-sync.js 自动更新
};
2 changes: 1 addition & 1 deletion packages/origine2/src/pages/dashboard/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const About: React.FunctionComponent = () => {
</p>
<hr />
<div >
Powered by <Link href="https://github.com/MakinoharaShoko/WebGAL" target="_blank" >WebGAL</Link> Framework
Powered by <Link href="https://github.com/OpenWebGAL" target="_blank" >WebGAL</Link> Framework
</div>
<div>
Made with ❤ by <Link href="https://github.com/MakinoharaShoko" target="_blank" >Mahiru</Link>
Expand Down
47 changes: 23 additions & 24 deletions packages/origine2/src/pages/editor/ChooseFile/ChooseFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import { useEffect, useMemo } from "react";
import axios from "axios";
import { useSelector } from "react-redux";
import { RootState } from "../../../store/origineStore";
import { useId } from "@fluentui/react-hooks";
import { Callout, DefaultButton, TextField } from "@fluentui/react";
import styles from "./chooseFile.module.scss";
import { FolderOpen, FolderWithdrawal, Notes } from "@icon-park/react";
import useTrans from "@/hooks/useTrans";
import { Button, Input, Popover, PopoverSurface, PopoverTrigger } from "@fluentui/react-components";

export interface IChooseFile {
sourceBase: string;
Expand Down Expand Up @@ -47,7 +46,6 @@ export default function ChooseFile(props: IChooseFile) {
}, [currentDirName]);

const isShowChooseFileCallout = useValue(false);
const buttonId = useId("choosefile-callout");

function toggleIsCalloutVisible() {
updateFileList();
Expand Down Expand Up @@ -91,27 +89,28 @@ export default function ChooseFile(props: IChooseFile) {
props.onChange(null);
}

return <>
<DefaultButton
id={buttonId}
onClick={isShowChooseFileCallout.value ? onCancel : toggleIsCalloutVisible}
text={isShowChooseFileCallout.value ? t('cancel') : t('choose')}
/>
{isShowChooseFileCallout.value && (
<Callout
role="dialog"
gapSpace={0}
target={`#${buttonId}`}
onDismiss={onCancel}
setInitialFocus
className={styles.callout}
>
<div className={styles.chooseFileCalloutContentWarpper}>
<div className={styles.chooseFileCalloutTitle}>
return (
<Popover
withArrow
trapFocus
open={isShowChooseFileCallout.value}
onOpenChange={isShowChooseFileCallout.value ? onCancel : toggleIsCalloutVisible}
>
<PopoverTrigger>
<Button style={{minWidth: 0}}>{isShowChooseFileCallout.value ? t('cancel') : t('choose')}</Button>
</PopoverTrigger>
<PopoverSurface>
<div className={styles.chooseFileContentWarpper}>
<div className={styles.chooseFileTitle}>
{t('choose')}
</div>
<div className="file-search">
<TextField label={t('fileSearch')} onChange={(ev, newValue) => fileSearch.set(newValue || '')}/>
<Input
placeholder={t('fileSearch')}
aria-label={t('fileSearch')}
onChange={(ev, data) => fileSearch.set(data.value || '')}
style={{width: '100%'}}
/>
</div>
<div className={styles.chooseFileFileListWarpper}>
{currentChildDir.value.length > 0 && (
Expand All @@ -123,9 +122,9 @@ export default function ChooseFile(props: IChooseFile) {
{fileSelectButtonList}
</div>
</div>
</Callout>
)}
</>;
</PopoverSurface>
</Popover>
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
.callout{
padding: 10px 12px;
width: 320px;
max-width: 90%;
height: 30vh;
}

.chooseFileCalloutTitle{
.chooseFileTitle{
font-weight: bold;
font-size: large;
padding: 2px 0 2px 4px;
Expand All @@ -21,10 +14,12 @@
border-bottom: var(--border-md);
}

.chooseFileCalloutContentWarpper{
.chooseFileContentWarpper{
display: flex;
flex-flow: column;
height: 100%;
max-height: 40vh;
gap: 8px;
}

.chooseFileFileListWarpper{
Expand Down
17 changes: 12 additions & 5 deletions packages/origine2/src/pages/editor/EditorSidebar/EditorSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@ import Assets from "./SidebarTags/Assets/Assets";
import Scenes from "./SidebarTags/Scenes/Scenes";
import React, { useEffect, useRef } from "react";
import useTrans from "@/hooks/useTrans";
import { IconButton } from "@fluentui/react";
import {eventBus} from "@/utils/eventBus";
import { ArrowClockwise24Filled, ArrowClockwise24Regular, bundleIcon, Open24Filled, Open24Regular } from "@fluentui/react-icons";
import { Button } from "@fluentui/react-components";

let startX = 0;
let prevXvalue = 0;
let isMouseDown = false;

export default function EditorSideBar() {
const t = useTrans("editor.sideBar.");

const ArrowClockwiseIcon = bundleIcon(ArrowClockwise24Filled, ArrowClockwise24Regular);
const OpenIcon = bundleIcon(Open24Filled, Open24Regular);

const state = useSelector((state: RootState) => state.status.editor);
const ifRef = useRef(null);
useEffect(() => {
Expand Down Expand Up @@ -112,13 +117,15 @@ export default function EditorSideBar() {
src={`/games/${state.currentEditingGame}`}
/>
<div className={styles.gamePreviewButons}>
<IconButton
iconProps={{ iconName: 'Refresh' }}
<Button
appearance="subtle"
icon={<ArrowClockwiseIcon />}
title={t("preview.refresh")}
onClick={refreshGame}
/>
<IconButton
iconProps={{ iconName: 'OpenInNewWindow' }}
<Button
appearance="subtle"
icon={<OpenIcon />}
title={t("preview.previewInNewTab")}
onClick={() => window.open(`/games/${state.currentEditingGame}`, "_blank")}
/>
Expand Down
Loading

0 comments on commit a04fb7e

Please sign in to comment.