home
·
contact
·
privacy
projects
/
plomrogue2-experiments
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't provide space for unused input line.
[plomrogue2-experiments]
/
new2
/
rogue_chat_nocanvas_monochrome.html
diff --git
a/new2/rogue_chat_nocanvas_monochrome.html
b/new2/rogue_chat_nocanvas_monochrome.html
index 14668eaa6c015e1b3e5c483c16600f007d53c63d..43c7ce85d5f87823976a5a2ecdbffbcbfa3a3d64 100644
(file)
--- a/
new2/rogue_chat_nocanvas_monochrome.html
+++ b/
new2/rogue_chat_nocanvas_monochrome.html
@@
-161,6
+161,7
@@
let tui = {
explorer.position = game.things[game.player_id];
}
this.mode = mode_name;
explorer.position = game.things[game.player_id];
}
this.mode = mode_name;
+ this.empty_input();
this.full_refresh();
},
draw_history: function() {
this.full_refresh();
},
draw_history: function() {
@@
-168,7
+169,6
@@
let tui = {
return;
}
terminal.drawBox(this.height_turn_line, this.window_width, terminal.rows - this.height_turn_line - this.height_input, this.window_width);
return;
}
terminal.drawBox(this.height_turn_line, this.window_width, terminal.rows - this.height_turn_line - this.height_input, this.window_width);
- console.log(this.log);
for (let y = terminal.rows - this.height_input - this.height_turn_line,
i = this.log.length - 1;
y >= this.height_turn_line && i >= 0;
for (let y = terminal.rows - this.height_input - this.height_turn_line,
i = this.log.length - 1;
y >= this.height_turn_line && i >= 0;
@@
-220,7
+220,11
@@
let tui = {
},
empty_input: function(str) {
this.input = "";
},
empty_input: function(str) {
this.input = "";
- this.recalc_input_lines();
+ if (this.mode == 'annotate' || this.mode == 'chat') {
+ this.recalc_input_lines();
+ } else {
+ this.height_input = 0;
+ }
},
add_to_input: function(str) {
if (this.input.length + str.length > this.window_width * terminal.rows) {
},
add_to_input: function(str) {
if (this.input.length + str.length > this.window_width * terminal.rows) {
@@
-234,10
+238,8
@@
let tui = {
this.height_input = this.input_lines.length;
},
shorten_input: function() {
this.height_input = this.input_lines.length;
},
shorten_input: function() {
- if (this.input.length > 2) {
- this.input = tui.input.slice(0, -1);
- this.recalc_input_lines();
- }
+ this.input = tui.input.slice(0, -1);
+ this.recalc_input_lines();
},
draw_input: function() {
terminal.drawBox(terminal.rows - this.height_input, this.window_width, this.height_input, this.window_width);
},
draw_input: function() {
terminal.drawBox(terminal.rows - this.height_input, this.window_width, this.height_input, this.window_width);
@@
-264,7
+266,7
@@
let tui = {
log_msg: function(msg) {
let lines = this.msg_into_lines_of_width(msg, this.window_width);
this.log = this.log.concat(lines);
log_msg: function(msg) {
let lines = this.msg_into_lines_of_width(msg, this.window_width);
this.log = this.log.concat(lines);
- while (this.log.length > terminal.rows
- 2
) {
+ while (this.log.length > terminal.rows) {
this.log.shift();
};
this.draw_history();
this.log.shift();
};
this.draw_history();
@@
-531,7
+533,6
@@
document.addEventListener('keydown', (event) => {
tui.full_refresh();
} else if (event.key == 'Enter') {
explorer.annotate(tui.input);
tui.full_refresh();
} else if (event.key == 'Enter') {
explorer.annotate(tui.input);
- tui.empty_input();
tui.switch_mode('study', true);
}
}
tui.switch_mode('study', true);
}
}