refactor(editor): 重构编辑器架构并增强行为树执行可视化

This commit is contained in:
YHH
2025-11-04 18:29:28 +08:00
parent adfc7e91b3
commit f9afa22406
44 changed files with 4942 additions and 546 deletions

View File

@@ -253,6 +253,14 @@
color: #dcb67a;
}
.asset-info {
flex: 1;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.asset-name {
font-size: var(--font-size-sm);
color: #cccccc;

View File

@@ -18,16 +18,30 @@
animation: gentle-glow 2s ease-in-out infinite;
}
.bt-node.running::before {
content: '';
position: absolute;
inset: -6px;
border: 2px solid #ffa726;
border-radius: 6px;
pointer-events: none;
animation: pulse-border 1.5s ease-in-out infinite;
z-index: -1;
}
.bt-node.success {
box-shadow: 0 0 0 3px #4caf50, 0 4px 16px rgba(76, 175, 80, 0.6);
background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, transparent 100%);
}
.bt-node.failure {
box-shadow: 0 0 0 3px #f44336, 0 4px 16px rgba(244, 67, 54, 0.6);
background: linear-gradient(135deg, rgba(244, 67, 54, 0.1) 0%, transparent 100%);
}
.bt-node.executed {
box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
background: linear-gradient(135deg, rgba(76, 175, 80, 0.05) 0%, transparent 100%);
}
.bt-node.root {
@@ -219,6 +233,35 @@
}
}
@keyframes pulse-border {
0%, 100% {
opacity: 0.6;
transform: scale(1);
}
50% {
opacity: 1;
transform: scale(1.02);
}
}
@keyframes success-flash {
0% {
box-shadow: 0 0 0 8px rgba(76, 175, 80, 0.8), 0 6px 24px rgba(76, 175, 80, 0.8);
}
100% {
box-shadow: 0 0 0 3px #4caf50, 0 4px 16px rgba(76, 175, 80, 0.6);
}
}
@keyframes failure-flash {
0% {
box-shadow: 0 0 0 8px rgba(244, 67, 54, 0.8), 0 6px 24px rgba(244, 67, 54, 0.8);
}
100% {
box-shadow: 0 0 0 3px #f44336, 0 4px 16px rgba(244, 67, 54, 0.6);
}
}
.bt-node-empty-warning-tooltip {
display: none;
position: absolute;

View File

@@ -61,7 +61,10 @@
}
.inspector-section {
margin-bottom: var(--spacing-lg);
margin-bottom: 20px;
padding: 12px;
background-color: rgba(255, 255, 255, 0.02);
border-radius: 6px;
}
.inspector-section:last-child {
@@ -297,3 +300,151 @@
font-size: var(--font-size-sm);
font-style: italic;
}
.entity-name {
font-size: 14px;
font-weight: 600;
color: var(--color-text-primary);
}
.section-title {
font-size: 11px;
font-weight: 600;
color: var(--color-text-secondary);
text-transform: uppercase;
letter-spacing: 0.05em;
margin: -4px -4px 12px -4px;
padding-bottom: 8px;
border-bottom: 1px solid var(--color-border-subtle);
}
.property-field {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 8px 6px;
font-size: 12px;
gap: 16px;
background-color: rgba(255, 255, 255, 0.01);
border-radius: 4px;
margin-bottom: 4px;
}
.property-field:last-child {
margin-bottom: 0;
}
.property-field:hover {
background-color: rgba(255, 255, 255, 0.03);
}
.property-label {
color: var(--color-text-secondary);
font-weight: 500;
flex-shrink: 0;
min-width: 80px;
font-size: 12px;
}
.property-value-text {
color: var(--color-text-primary);
text-align: right;
word-break: break-word;
font-size: 12px;
flex: 1;
}
.component-remove-btn {
display: inline-flex;
align-items: center;
justify-content: center;
background: none;
border: none;
color: var(--color-text-tertiary);
padding: 4px;
cursor: pointer;
border-radius: 3px;
transition: all 0.15s;
flex-shrink: 0;
opacity: 0;
margin-left: auto;
}
.component-header:hover .component-remove-btn {
opacity: 1;
}
.component-remove-btn:hover {
background-color: var(--color-error);
color: white;
}
.empty-inspector {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 48px 24px;
text-align: center;
height: 100%;
}
.child-node-item {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 10px;
background-color: rgba(255, 255, 255, 0.03);
border-radius: 4px;
font-size: 12px;
transition: background-color 0.15s;
cursor: default;
}
.child-node-item:hover {
background-color: rgba(255, 255, 255, 0.05);
}
.child-node-index {
color: #666;
min-width: 20px;
font-size: 12px;
}
.child-node-name {
color: #ccc;
flex: 1;
font-size: 12px;
}
.file-preview-content {
background: #1e1e1e;
border: 1px solid #3e3e3e;
border-radius: 4px;
padding: 12px;
max-height: 400px;
overflow-y: auto;
font-family: Consolas, Monaco, monospace;
font-size: 12px;
line-height: 1.6;
color: #d4d4d4;
white-space: pre-wrap;
word-break: break-word;
}
.file-preview-content::-webkit-scrollbar {
width: 10px;
}
.file-preview-content::-webkit-scrollbar-track {
background: #1e1e1e;
}
.file-preview-content::-webkit-scrollbar-thumb {
background: #424242;
border-radius: 5px;
}
.file-preview-content::-webkit-scrollbar-thumb:hover {
background: #4e4e4e;
}

View File

@@ -1,5 +1,35 @@
.file-tree-toolbar {
display: flex;
gap: 4px;
padding: 4px 8px;
background: #252526;
border-bottom: 1px solid #3e3e3e;
}
.file-tree-toolbar-btn {
display: flex;
align-items: center;
justify-content: center;
padding: 4px 8px;
background: transparent;
border: 1px solid transparent;
border-radius: 3px;
color: #cccccc;
cursor: pointer;
transition: all 0.2s;
}
.file-tree-toolbar-btn:hover {
background: #2a2d2e;
border-color: #3e3e3e;
}
.file-tree-toolbar-btn:active {
background: #37373d;
}
.file-tree {
height: 100%;
height: calc(100% - 32px);
overflow-y: auto;
overflow-x: hidden;
background: #1e1e1e;
@@ -76,3 +106,15 @@
.tree-children {
/* Children are indented via inline style */
}
.tree-rename-input {
flex: 1;
background: #3c3c3c;
border: 1px solid #007acc;
border-radius: 2px;
padding: 2px 4px;
color: #cccccc;
font-size: var(--font-size-base);
font-family: inherit;
outline: none;
}

View File

@@ -0,0 +1,153 @@
.prompt-dialog-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
z-index: 10000;
animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.prompt-dialog {
background: var(--bg-secondary, #2a2a2a);
border: 1px solid var(--border-color, #404040);
border-radius: 8px;
min-width: 400px;
max-width: 600px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
animation: slideIn 0.2s ease-out;
}
@keyframes slideIn {
from {
transform: translateY(-20px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.prompt-dialog-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid var(--border-color, #404040);
}
.prompt-dialog-header h2 {
margin: 0;
font-size: 16px;
font-weight: 600;
color: var(--text-primary, #e0e0e0);
}
.prompt-dialog-header .close-btn {
background: none;
border: none;
color: var(--text-secondary, #999);
cursor: pointer;
padding: 4px;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
}
.prompt-dialog-header .close-btn:hover {
background: var(--bg-hover, #3a3a3a);
color: var(--text-primary, #fff);
}
.prompt-dialog-content {
padding: 20px;
color: var(--text-primary, #e0e0e0);
line-height: 1.6;
}
.prompt-dialog-content p {
margin: 0 0 12px 0;
}
.prompt-dialog-input {
width: 100%;
padding: 8px 12px;
background: #1e1e1e;
border: 1px solid var(--border-color, #404040);
border-radius: 4px;
color: var(--text-primary, #e0e0e0);
font-size: 14px;
font-family: inherit;
outline: none;
transition: border-color 0.2s;
}
.prompt-dialog-input:focus {
border-color: #4a9eff;
}
.prompt-dialog-input::placeholder {
color: var(--text-tertiary, #666);
}
.prompt-dialog-footer {
padding: 12px 20px;
border-top: 1px solid var(--border-color, #404040);
display: flex;
justify-content: flex-end;
gap: 8px;
}
.prompt-dialog-btn {
padding: 8px 24px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: all 0.2s;
}
.prompt-dialog-btn.cancel {
background: var(--bg-hover, #3a3a3a);
color: var(--text-primary, #e0e0e0);
}
.prompt-dialog-btn.cancel:hover {
background: var(--bg-active, #4a4a4a);
}
.prompt-dialog-btn.confirm {
background: #4a9eff;
color: white;
}
.prompt-dialog-btn.confirm:hover {
background: #6bb0ff;
}
.prompt-dialog-btn.confirm:disabled {
background: #3a3a3a;
color: #666;
cursor: not-allowed;
}
.prompt-dialog-btn:active:not(:disabled) {
transform: scale(0.98);
}