- Timestamp:
- 06/01/08 02:08:06 (6 months ago)
- Location:
- lang/d/koke/trunk
- Files:
-
- 4 modified
-
resource/image/menu.bmp (modified) (previous)
-
src/clickable.d (modified) (5 diffs)
-
src/gamecore.d (modified) (7 diffs)
-
src/hell2.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/d/koke/trunk/src/clickable.d
r12011 r12957 37 37 ECONOMY, // エコノミー 38 38 CHART, // チャート 39 SAVE, // SAVE40 LOAD, // LOAD41 39 42 40 STOP, // 停止 … … 44 42 KSK, // 加速 45 43 DANGER, // 危 44 45 SAVE, // SAVE 46 LOAD, // LOAD 47 RESET, // RESET 46 48 } 47 49 … … 50 52 SML, // 小 51 53 MIN, // 極小 52 } 53 // del he ray ni up fen eco crt save load stp ply ksk dgr 54 const int type_width[] = [ 80 , 80 , 80 , 80 , 80 , 80 , 64 , 64 , 64 , 64 , 32 , 32 , 32 , 32 ]; 55 const int type_height[] = [ 32 , 32 , 32 , 32 , 32 , 32 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 ]; 56 const int type_style[] = [ LRG , LRG , LRG , LRG , LRG , LRG , SML , SML , SML , SML , MIN , MIN , MIN , MIN ]; 54 ICO, // アイコン 55 } 56 57 const int type_style[] = [ LRG , LRG , LRG , LRG , LRG , LRG 58 , SML , SML 59 , MIN , MIN , MIN , MIN 60 , ICO , ICO , ICO , ICO ]; 61 // LRG SML MIN ICO 62 const int type_width[] = [ 80 , 64 , 32 , 32 ]; 63 const int type_height[] = [ 32 , 16 , 16 , 24 ]; 57 64 58 65 this(TYPE type){ … … 64 71 } 65 72 66 int getWidth(){return type_width[type ];}67 int getHeight(){return type_height[type ];}73 int getWidth(){return type_width[type_style[type]];} 74 int getHeight(){return type_height[type_style[type]];} 68 75 69 76 void draw(bool selected,bool onMouse){ … … 124 131 Hell_drawTexture("menu" , x , y 125 132 , 306 , (cast(int)type - TYPE.STOP) * getHeight() 133 , getWidth() , getHeight() 134 ,1,1,0, 128,128,128,alpha); 135 } 136 }else if(type_style[type] == ICO){ 137 // イメージボタン アイコン 138 int alpha = (onMouse || selected) ? 255 : 128; 139 if(onMouse){ // マウスon状態 140 Hell_drawTexture("menu" , x , y 141 , 338 , (cast(int)type - TYPE.SAVE) * getHeight() 142 , getWidth() , getHeight() 143 ,1,1,0, 255,255,255,alpha); 144 }else{ // 非選択状態 145 Hell_drawTexture("menu" , x , y 146 , 338 , (cast(int)type - TYPE.SAVE) * getHeight() 126 147 , getWidth() , getHeight() 127 148 ,1,1,0, 128,128,128,alpha); -
lang/d/koke/trunk/src/gamecore.d
r12476 r12957 49 49 ClickablePool economy_switch; // エコノミーのON/OFFスイッチ(右上 50 50 ClickablePool speed_switch; // 速度スイッチ(右上 51 ClickablePool save_switch; // セーブ 52 ClickablePool load_switch; // ロード 51 ClickablePool sys_switch; // システム(セーブ/ロード/リセット) 53 52 54 53 int cursor_x; // マウス直下の座標x(マップチップ座標系) … … 151 150 152 151 // save/load 153 s ave_switch = new ClickablePool();154 s ave_switch.add("save" , new Vec3( -32*4 , 32, 0)152 sys_switch = new ClickablePool(); 153 sys_switch.add("save" , new Vec3( -32*6 - 16 , 0 , 0) 155 154 , ImageButton.TYPE.SAVE); 156 157 load_switch = new ClickablePool(); 158 load_switch.add("load" , new Vec3( -32*2 , 32 , 0) 155 sys_switch.add("load" , new Vec3( -32*5 - 16 , 0 , 0) 159 156 , ImageButton.TYPE.LOAD); 160 157 … … 194 191 economy_switch.getMouseClick(); 195 192 speed_switch.getMouseClick(); 196 save_switch.getMouseClick(); 197 load_switch.getMouseClick(); 198 199 // save&load 200 if(load_switch.getSelected() == "load"){ 193 sys_switch.getMouseClick(); 194 195 // システム save&load 196 if(sys_switch.getSelected() == "load"){ 201 197 if( map.loadFile( configparser.get("MAP_LOAD_FILE") ) ){ 202 198 setMessage("MAP LOAD SUCCESS"); … … 204 200 setMessage("** MAP LOAD FAIL **" , MESSAGE_COLOR.ERROR); 205 201 } 206 load_switch.setSelected("");207 } 208 if(s ave_switch.getSelected() == "save"){202 sys_switch.setSelected(""); 203 } 204 if(sys_switch.getSelected() == "save"){ 209 205 if( map.saveFile( configparser.get("MAP_SAVE_FILE") ) ){ 210 206 setMessage("MAP SAVE SUCCESS"); … … 212 208 setMessage("** MAP SAVE FAIL **" , MESSAGE_COLOR.ERROR); 213 209 } 214 s ave_switch.setSelected("");210 sys_switch.setSelected(""); 215 211 } 216 212 … … 439 435 economy_switch.draw(); 440 436 speed_switch.draw(); 441 save_switch.draw(); 442 load_switch.draw(); 437 sys_switch.draw(); 443 438 444 439 // チャート … … 482 477 if(menu.getMouseOver() == "" && economy_switch.getMouseOver() == "" 483 478 && chart_switch.getMouseOver() == "" && speed_switch.getMouseOver() == "" 484 && s ave_switch.getMouseOver() == "" && load_switch.getMouseOver() == "") return true;479 && sys_switch.getMouseOver() == "" ) return true; 485 480 486 481 return false; -
lang/d/koke/trunk/src/hell2.d
r12011 r12957 316 316 // ログファイル削除(あれば 317 317 if(std.file.exists(g_logname)){ 318 std.file.remove(g_logname); 318 try { 319 std.file.remove(g_logname); 320 } catch ( Exception e ) { 321 std.stdio.writefln( "log file cant write." ); 322 } 319 323 } 320 324 } … … 364 368 void Hell_write(...) 365 369 { 366 void _putc(dchar c) 367 { 368 fputc(c, stdout); 369 auto tmp = [c]; 370 append(g_logname, toUTF8(tmp)); 371 } 372 doFormat(&_putc, _arguments, _argptr); 370 try { 371 void _putc(dchar c) 372 { 373 fputc(c, stdout); 374 auto tmp = [c]; 375 append(g_logname, toUTF8(tmp)); 376 } 377 doFormat(&_putc, _arguments, _argptr); 378 } catch ( Exception e ){ 379 std.stdio.writefln( "log file cant write." ); 380 } 373 381 } 374 382 375 383 void Hell_write(Exception e) 376 384 { 377 dout.writeLine(e.toString()); 378 append(g_logname, e.toString() ~ "\n"); 385 try { 386 dout.writeLine(e.toString()); 387 append(g_logname, e.toString() ~ "\n"); 388 } catch ( Exception e ){ 389 std.stdio.writefln( "log file cant write." ); 390 } 379 391 } 380 392
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)