Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
active-shell
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
echicken
active-shell
Commits
17b62d2e
Commit
17b62d2e
authored
11 months ago
by
echicken
Browse files
Options
Downloads
Patches
Plain Diff
Reorg
parent
24e68345
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/active-shell.ts
+1
-5
1 addition, 5 deletions
src/active-shell.ts
src/lib/UI.ts
+6
-2
6 additions, 2 deletions
src/lib/UI.ts
src/lib/menu.ts
+2
-0
2 additions, 0 deletions
src/lib/menu.ts
with
9 additions
and
7 deletions
src/active-shell.ts
+
1
−
5
View file @
17b62d2e
import
type
{
ICgaDefs
,
ISbbsDefs
}
from
'
@swag/ts4s
'
;
import
{
load
}
from
'
@swag/ts4s
'
;
import
*
as
swindows
from
'
swindows
'
;
import
UI
from
'
./lib/UI
'
;
const
sbbsdefs
:
ISbbsDefs
=
load
(
'
sbbsdefs.js
'
);
const
cgadefs
:
ICgaDefs
=
load
(
'
cga_defs.js
'
);
const
{
bbs
,
console
,
mswait
}
=
js
.
global
;
const
windowManager
=
new
swindows
.
WindowManager
();
const
ui
=
new
UI
(
windowManager
);
const
ui
=
new
UI
();
function
init
():
void
{
js
.
on_exit
(
`bbs.sys_status =
${
bbs
.
sys_status
}
;`
);
...
...
@@ -22,13 +20,11 @@ function init(): void {
bbs
.
sys_status
|=
sbbsdefs
.
SS_MOFF
;
console
.
ctrlkey_passthru
=
"
+UPKTG
"
;
console
.
clear
(
cgadefs
.
BG_BLACK
|
cgadefs
.
LIGHTGRAY
);
windowManager
.
hideCursor
();
}
function
main
():
void
{
while
(
!
js
.
terminated
)
{
ui
.
cycle
();
windowManager
.
refresh
();
bbs
.
nodesync
();
mswait
(
5
);
}
...
...
This diff is collapsed.
Click to expand it.
src/lib/UI.ts
+
6
−
2
View file @
17b62d2e
...
...
@@ -62,9 +62,12 @@ function getWindows(windowManager: swindows.WindowManager): IShellWindow[] {
export
default
class
UI
{
activeWindow
:
number
=
0
;
windows
:
IShellWindow
[]
=
[];
windowManager
:
swindows
.
WindowManager
;
constructor
(
windowManager
:
swindows
.
WindowManager
)
{
this
.
windows
=
getWindows
(
windowManager
);
constructor
()
{
this
.
windowManager
=
new
swindows
.
WindowManager
();
this
.
windowManager
.
hideCursor
();
this
.
windows
=
getWindows
(
this
.
windowManager
);
this
.
focusWindow
(
1
);
}
...
...
@@ -73,6 +76,7 @@ export default class UI {
window
.
cycle
();
}
this
.
getInput
();
this
.
windowManager
.
refresh
();
}
focusWindow
(
n
:
number
):
void
{
...
...
This diff is collapsed.
Click to expand it.
src/lib/menu.ts
+
2
−
0
View file @
17b62d2e
...
...
@@ -10,6 +10,7 @@ function clear(): void {
}
function
exec
(
wm
:
WindowManager
,
fn
:
(...
args
:
any
[])
=>
any
,
...
args
:
any
[]):
void
{
wm
.
showCursor
();
clear
();
try
{
fn
(...
args
);
...
...
@@ -17,6 +18,7 @@ function exec(wm: WindowManager, fn: (...args: any[]) => any, ...args: any[]): v
console
.
putmsg
(
err
as
string
);
}
clear
();
wm
.
hideCursor
();
wm
.
draw
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment