Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat graphical editor sentences hotkey #349

Closed

Conversation

ClodLingxi
Copy link
Contributor

Sentence 和 AddSentence 快捷键

Sentence (不包括自定义)

(OUTER 为焦点在整个语句控件时触发)
(INNER 为焦点在语句控件内输入框时触发)

快捷键 动作 层级
Ctrl+Enter 执行该语句 INNER, OUTER
Alt+Enter 在该语句下插入新语句 INNER, OUTER
Shift+Enter 执行并跳转至下一句,如果没有则插入 INNER, OUTER
Ctrl+C 复制当前语句 OUTER
Ctrl+V 粘贴语句 OUTER
Ctrl+D 删除当前语句 OUTER
Ctrl+Shift+ArrowDown 与下方语句交换 OUTER
Ctrl+Shift+ArrowUp 与上方语句交换 OUTER
ArrowDown 向下移动 OUTER
ArrowUp 向上移动 OUTER

AddSentence (包括自定义,且储存至IEditorState

在AddSentence左下角切换设置模组,并点击对应按钮调整其快捷键

属性 类型 描述 示例
shortcuts string 代表快捷键组合的字符串。例如,"Ctrl+Enter""Alt+Enter" shortcuts: "Ctrl+Enter"
type commandType | "custom" 指定快捷键触发的动作类型。它可以是预定义的命令类型(如 commandType 枚举中的值),也可以是自定义的 "custom" type: commandType.run_sentence
initialText string? (可选) type"custom" 时,可以提供一个初始文本,用于快捷执行某指令(待写)。 initialText: "changeFigure:stand.png -left"

nini22P and others added 30 commits May 2, 2024 13:51
rename auto selection

Former-commit-id: 30a5eaf
Basic WebGAL Language Service

Former-commit-id: 14d19e3
add template folder info on assets

Former-commit-id: 9a52611
Former-commit-id: 0b85cf8
improve display of the delete dialog, fix nested folder scene file editing

Former-commit-id: ef9d700
Former-commit-id: d3bf514
Former-commit-id: b7d7c5b
feat: add live preview button on game preview
Former-commit-id: 3fb41d4
Former-commit-id: 6661351
Former-commit-id: 7f49848
Former-commit-id: a8721a3
Former-commit-id: 1860147
Former-commit-id: 4ed6619
Former-commit-id: 1a6e5a8
Former-commit-id: 0d92957
dabao1955 and others added 2 commits December 5, 2024 10:24
@ClodLingxi
Copy link
Contributor Author

1、Ctrl+D 不符合通常的习惯,一般来说是复制一份当前语句到下一行 2、不建议使用 ArrowDown 和 ArrowDown,因为太过于常用,可能更常用于在文本框里面移动光标 3、需要一定的视觉提示当前被选中的语句,否则用户很难搞清楚快捷键将要操作的语句 4、不建议使用焦点获取将要操作的语句,这不是一般的使用习惯,一般来说以最后一次点击的语句为选中的将要操作的语句 5、既然 Ctrl+ Enter 是执行当前语句,Alt+Enter 是在该语句下插入新语句,那么,执行并跳转至下一句,如果没有则插入,应该是 Ctrl+Shift+Enter 或者 Ctrl+ Alt+ Enter

  1. 已完成
  2. 在Sentence内部通过 e.stopPropagation(); 阻止向Outer传递指令
  3. 目前只有一个蓝色的框,之后得改,
    .sentenceEditorWrapper:focus {
    border: 1px solid blue;
    }
  4. 准确是通过每个Sentence的Keydown将自己的index传出去。如果记录最后一个点击,需要读取整个界面的keydown,而不仅仅是export default function GraphicalEditor的,跨过的层很大,而且需要forwardRef调用GraphicalEditor内部的sentenceShortCutHandle
  5. 默认不应该加个shift,键位太多。之后应该可以加上自定义键位

@MakinoharaShoko
Copy link
Member

1、对设置添加语句的快捷键这个功能没有任何指引,用户很难理解如何操作。
2、边框的颜色应当是 WebGAL Terre 主题色 var(--primary)
3、边框的位置也不对
image

@MakinoharaShoko MakinoharaShoko requested review from MakinoharaShoko and removed request for loliko114514 and nini22P December 10, 2024 12:46
Comment on lines 15 to 18
.sentenceEditorWrapper:focus {
border: 1px solid blue;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里样式改成像这样的

.sentenceEditorWrapper:focus {
  outline: none;
}

.sentenceEditorWrapper:focus .sentenceEditorContent {
  border: var(--border-primary-lg);
}

packages\origine2\src\config\themes\theme.css 可以查看常用的样式

@MakinoharaShoko MakinoharaShoko force-pushed the dev branch 2 times, most recently from 0c2fdbd to be4e2c7 Compare December 20, 2024 16:52
@ClodLingxi ClodLingxi closed this Dec 21, 2024
@ClodLingxi ClodLingxi deleted the feat-graphical-editor-sentences-hotkey branch December 25, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants