aboutsummaryrefslogtreecommitdiff
path: root/src/gui.rs
diff options
context:
space:
mode:
authortslil clingman <>2020-02-15 16:31:05 -0800
committertslil clingman <>2020-02-15 16:32:10 -0800
commitf68e7b59a08b3c211b6eeff70f7346d4d1e71a66 (patch)
tree76393075b205b287fed67faa7fa93b753017d56b /src/gui.rs
parent15f64980573085e9ab6a9d47fc2a6e8092d6d109 (diff)
Preparing for release
Diffstat (limited to 'src/gui.rs')
-rw-r--r--src/gui.rs59
1 files changed, 18 insertions, 41 deletions
diff --git a/src/gui.rs b/src/gui.rs
index 3a828b6..98c29c0 100644
--- a/src/gui.rs
+++ b/src/gui.rs
@@ -1,3 +1,20 @@
+/*
+ This file is part of Takwrap.
+
+ Takwrap is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Foobar is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Foobar. If not, see <https://www.gnu.org/licenses/>.
+*/
+
extern crate pancurses;
pub use pancurses::Input::*;
@@ -294,46 +311,6 @@ impl BoardGUI {
self.board_window.untouch();
}
- /*
- pub fn read_action(&mut self) -> GUIResult {
- loop {
- if let Some(key) = self.board_window.getch() {
- match key {
- KeyDown => {
- if 0 < self.cur_cell.y {
- self.cur_cell.y -= 1;
- self.mv_to_cell(&self.cur_cell, 0);
- }
- }
- KeyUp => {
- if self.cur_cell.y + 1 < self.size {
- self.cur_cell.y += 1;
- self.mv_to_cell(&self.cur_cell, 0);
- }
- }
- KeyLeft => {
- if 0 < self.cur_cell.x {
- self.cur_cell.x -= 1;
- self.mv_to_cell(&self.cur_cell, 0);
- }
- }
- KeyRight => {
- if self.cur_cell.x + 1 < self.size {
- self.cur_cell.x += 1;
- self.mv_to_cell(&self.cur_cell, 0);
- }
- }
- Character('q') => (),
-
- x => {
- self.board_window.addstr(format!("{:?}", x));
- self.board_window.refresh();
- }
- }
- }
- }
- }*/
-
pub fn new(
ypos: i32,
xpos: i32,
@@ -770,7 +747,7 @@ impl GUI {
return false;
} else {
self.message_log.log_error(format!(
- "Cannot perform \"{}\": p{}",
+ "Cannot perform \"{}\": {}",
act_string, e
));
}