浏览代码

Updated: initial design of main play screen.

Steve Thielemann 4 年之前
父节点
当前提交
196a0702f5
共有 2 个文件被更改,包括 23 次插入3 次删除
  1. 10 0
      deck.h
  2. 13 3
      main.cpp

+ 10 - 0
deck.h

@@ -27,6 +27,16 @@ layout, rev2:
  █████   █████   █████   #####   #####   #####   #####   #####   #####   #####
  █████   █████   █████   #####   #####   #####   #####   #####   #####   #####
  █████   █████   █████   #####   #####   #####   #####   #####   #####   #####
  █████   █████   █████   #####   #####   #####   #####   #####   #####   #####
 
 
+  Name:                          #####   -----       Playing: December 31
+  Score:                         #####   -----       Current Streak: nn
+  Time used: xxx / XXX left      #####   -----       Longest Streak: nn
+  Playing Hand X of X            Cards left XX
+  1234567890123456789012345      123456789012345     12345678901234567890
+ [4/<] Left [6/>] Right [Space] Play Card [Enter] Draw [Q]uit [R]edraw [H]elp
+
+^ -- above is 20 lines from +-- to [4/<] < Left
+
+
                            #####
                            #####
 Player Information         #####        Time in: xx Time out: xx
 Player Information         #####        Time in: xx Time out: xx
 Name:                      #####    Playing Day: November 3rd
 Name:                      #####    Playing Day: November 3rd

+ 13 - 3
main.cpp

@@ -24,6 +24,14 @@ bool replace(std::string &str, const std::string &from, const std::string &to) {
   return true;
   return true;
 }
 }
 
 
+bool replace(std::string &str, const char *from, const char *to) {
+  size_t start_pos = str.find(from);
+  if (start_pos == std::string::npos)
+    return false;
+  str.replace(start_pos, strlen(from), to);
+  return true;
+}
+
 door::ANSIColor from_string(std::string colorCode);
 door::ANSIColor from_string(std::string colorCode);
 
 
 std::function<std::ofstream &(void)> get_logger;
 std::function<std::ofstream &(void)> get_logger;
@@ -713,9 +721,11 @@ door::Panel make_about(void) {
       std::make_unique<door::Line>(SPACEACE " v" SPACEACE_VERSION, 60));
       std::make_unique<door::Line>(SPACEACE " v" SPACEACE_VERSION, 60));
   std::string copyright = SPACEACE_COPYRIGHT;
   std::string copyright = SPACEACE_COPYRIGHT;
   if (door::unicode) {
   if (door::unicode) {
+    /*
     std::string textcp = "(C)";
     std::string textcp = "(C)";
     std::string utf8cp = "\u00a9";
     std::string utf8cp = "\u00a9";
-    replace(copyright, textcp, utf8cp);
+    replace(copyright, textcp, utf8cp);*/
+    replace(copyright, "(C)", "\u00a9");
   }
   }
 
 
   about.addLine(std::make_unique<door::Line>(copyright, 60));
   about.addLine(std::make_unique<door::Line>(copyright, 60));
@@ -900,9 +910,9 @@ int main(int argc, char *argv[]) {
   door::Panel timeout = make_timeout(mx, my);
   door::Panel timeout = make_timeout(mx, my);
   door::Menu m = make_main_menu();
   door::Menu m = make_main_menu();
 
 
-  door::Panel about = make_about();
+  door::Panel about = make_about(); // 8 lines
   // center the about box
   // center the about box
-  about.set((mx - 60) / 2, (my - 5) / 2);
+  about.set((mx - 60) / 2, (my - 9) / 2);
 
 
   int r = 0;
   int r = 0;
   while ((r >= 0) and (r != 6)) {
   while ((r >= 0) and (r != 6)) {