Browse code

v0.2.0 - Start Menu Page base

frtk authored on 17/02/2016 00:37:52
Showing 4 changed files
... ...
@@ -14,6 +14,8 @@ NPGClient.PageHandler = {
14 14
     self.currPage = NPGClient.LOGIN.NAME;
15 15
     // create login page 
16 16
     self.createLoginPage();
17
+    // create start menu page
18
+    self.createStartMenuPage();
17 19
   },
18 20
 
19 21
   //
... ...
@@ -85,7 +87,7 @@ NPGClient.PageHandler = {
85 85
     //
86 86
     console.log('[NPGClient] Creating Login Page');
87 87
     var self = this;
88
-    var p = new NPGClient.AppPage('login');
88
+    var p = new NPGClient.AppPage(NPGClient.LOGIN.NAME);
89 89
     // Title label     
90 90
     p.addUIObject(new NPGClient.UILabel('login_title', NPGClient.LOGIN.TITLE));
91 91
     // name input
... ...
@@ -98,5 +100,25 @@ NPGClient.PageHandler = {
98 98
     self.pages.push(p);  
99 99
   },
100 100
 
101
+
102
+  // create login page
103
+  createStartMenuPage: function() {
104
+    //
105
+    console.log('[NPGClient] Creating Start Menu Page');
106
+    var self = this;
107
+    var p = new NPGClient.AppPage(NPGClient.STARTMENU.NAME);
108
+    // Title label     
109
+    p.addUIObject(new NPGClient.UILabel('login_title', NPGClient.STARTMENU.TITLE));
110
+    // Start Menu
111
+
112
+    // Server Players and Games status
113
+
114
+    //
115
+    self.pages.push(p);  
116
+  },
117
+
118
+
119
+
120
+
101 121
 }; 
102 122
 
... ...
@@ -82,12 +82,40 @@ NPGClient.LOGIN = {
82 82
       'bw': 0,
83 83
       'bc': '',
84 84
     }
85
-  },
86
-
87
-  
85
+  },  
88 86
 };
89 87
 
90 88
 
89
+/*
90
+ * Start Menu Page
91
+ */
92
+NPGClient.STARTMENU = {
93
+  NAME: 'start_menu',
94
+  SERVSTATUS: { 
95
+    'text': {
96
+      'online' : 'server: online',
97
+      'offline' : 'server: offline',
98
+    },
99
+    'x': 400,
100
+    'y': 450,
101
+    'style': { 
102
+      'font': '15px Arial',
103
+      'col': '#FFFFFF',
104
+      'align': 'center'
105
+    },
106
+  },
107
+  TITLE: {
108
+    'text': 'nodePong',
109
+    'x': 400,
110
+    'y': 150,
111
+    'style': { 
112
+      'font': '50px Arial',
113
+      'col': '#FFFFFF',
114
+      'align': 'center'
115
+    }
116
+  },
117
+
118
+};
91 119
 
92 120
 
93 121
 
... ...
@@ -84,7 +84,8 @@ NPGClient.SocketIO = {
84 84
     // 'regDone'
85 85
     self.socket.on('regDone', function() {
86 86
       NPGClient.Utils.log(' > Server: User registration done');
87
-      //NPGClient.PageHandler.moveToPage(NPGClient.LOGIN.NAME);
87
+      //NPGClient.PageHandler.moveToPage(NPGClient.STARTMENU.NAME);
88
+	NPGClient.PageHandler.setCurrPage(NPGClient.STARTMENU.NAME);
88 89
     });     
89 90
 
90 91
     // 'regNameTaken'
... ...
@@ -93,7 +94,7 @@ NPGClient.SocketIO = {
93 93
       NPGClient.PageHandler.moveToPage(NPGClient.LOGIN.NAME);
94 94
     });     
95 95
 
96
- },
96
+  },
97 97
 
98 98
   // send message to server
99 99
   sendMsg: function(name, data) {
... ...
@@ -1,25 +1,34 @@
1
-### **v0.1.5:**
2
-focus: client/server user registration 
1
+
2
+# **v0.2.0:**
3
+##focus: Start Menu Page
4
+--------------------------
5
+### client
6
+- create start menu page skeletton with title
7
+- socketio: on 'regDone' move current page to 'start menu' page
8
+
9
+
10
+
11
+
12
+# **v0.1.5:**
13
+##focus: client/server user registration 
3 14
 -------------------------- 
15
+### added socket messages in npg_server.js and client/lib/socket/socketio_handler.js 
4 16
 'regRequest' server socket msg 
5 17
 'regDone' client socket message
6 18
 'regNameTaken' client socket message
19
+### 
7 20
 Added user handling utilities {
8 21
 userRegistration
9 22
 clientDisconnect
10 23
 }
24
+### added User object on server
11 25
 check if user already exist and handle issues
26
+### 
12 27
 user disconnection handling (server & client)
13 28
 
14 29
 
15 30
 
16 31
 ### **v0.1.4:**
17 32
 focus: client ui lib 
18 33
 -------------------------- 
19 34
 ---- changed font (Lucida -> Arial)