mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-15 08:54:05 +09:00
edit.js: can move text cursor left/right
This commit is contained in:
@@ -3,17 +3,19 @@
|
||||
let menu = [
|
||||
{label:"BASIC",pwd:"\\",exec:"basic",args:""},
|
||||
{label:"DOS",pwd:"\\",exec:"command",args:""},
|
||||
{label:"TEXT",pwd:"\\home",exec:"undefined",args:""},
|
||||
{label:"TEXT",pwd:"\\home",exec:"edit",args:""},
|
||||
{label:"TELCOM",pwd:"\\home",exec:"undefined",args:""}
|
||||
];
|
||||
|
||||
const MENU_COLS = 4;
|
||||
const MENU_ROWS = 6;
|
||||
const COL_SIZE = 10;
|
||||
|
||||
function redraw() {
|
||||
con.clear();
|
||||
for (let i = 0; i < MENU_COLS*6; i++) {
|
||||
for (let i = 0; i < MENU_COLS*MENU_ROWS; i++) {
|
||||
let m = menu[i];
|
||||
con.move(2+((i/MENU_COLS)|0),2+((i%MENU_COLS)*10));
|
||||
con.move(2+((i / MENU_COLS)|0),2+((i % MENU_COLS)*COL_SIZE));
|
||||
print(m ? m.label : "-.-");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user