Changeset 26 for trunk/Classes/construct_dialog.cpp
- Timestamp:
- 2010-05-28 07:39:52 (2 years ago)
- File:
-
- 1 edited
-
trunk/Classes/construct_dialog.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Classes/construct_dialog.cpp
r23 r26 145 145 // std::string msg = font::word_wrap_text(message, message_font_size, screen.getx() / 2, screen.gety() / 2); 146 146 std::string msg = font::word_wrap_text(message, message_font_size, screen.getx() - 22, screen.gety() - 22); 147 #ifdef __IPAD__ 148 // KP: looks ugly when too big... 149 if (title == "Choose an option...") 150 { 151 msg = font::word_wrap_text(message, message_font_size, 480 - 22, screen.gety() - 22); 152 } 153 #endif 147 154 message_ = new label(screen, msg, message_font_size, font::NORMAL_COLOUR, false); 148 155 } catch(utils::invalid_utf8_exception&) { … … 316 323 // KP: redraw every frame for openGL rendering 317 324 draw_frame(); 318 update_widget_positions();325 // update_widget_positions(); 319 326 draw_contents(); 320 327 321 328 //refresh(); 322 329 323 SDL_Delay( 80);330 SDL_Delay(20); 324 331 } 325 332 action(dp_info); … … 524 531 525 532 // Prevent the menu to be larger than the screen 533 534 int maxX = screen.getx(); 535 526 536 dim.menu_width = menu_->width(); 527 if(dim.menu_width + image_width + padding_width + left_preview_pane_width + right_preview_pane_width > static_cast<size_t>( screen.getx()))528 dim.menu_width = screen.getx()- image_width - padding_width - left_preview_pane_width - right_preview_pane_width;537 if(dim.menu_width + image_width + padding_width + left_preview_pane_width + right_preview_pane_width > static_cast<size_t>(maxX)) 538 dim.menu_width = maxX - image_width - padding_width - left_preview_pane_width - right_preview_pane_width; 529 539 if(dim.menu_width > text_width) 530 540 text_width = dim.menu_width; … … 596 606 597 607 // recheck 598 int bestHeight = screen.gety() - above_preview_pane_height - frame_bottom_pad - check_button_height - padding_height ;608 int bestHeight = screen.gety() - above_preview_pane_height - frame_bottom_pad - check_button_height - padding_height - dim.y; 599 609 dim.menu_height = bestHeight; 600 dim.menu_y = dim. interior.h - dim.menu_height - frame_bottom_pad;610 dim.menu_y = dim.y; //dim.interior.h - dim.menu_height - frame_bottom_pad; 601 611 602 // KP: dirty hack 612 // KP: dirty hacks 613 #ifdef __IPAD__ 614 #else 603 615 if (title_ == "Attack Enemy") 604 616 { 605 dim.y = 126 ;617 dim.y = 126-10; 606 618 dim.menu_y = 149; 607 619 dim.interior.y = 36; 608 dim.interior.h = 248 ;620 dim.interior.h = 248-10; 609 621 dim.menu_height = 135; 610 622 } 623 #endif 611 624 } 612 625 … … 666 679 // dim.menu_y -= 24; 667 680 // dim.menu_height += 24; 668 dim.menu_y = 14; 681 dim.menu_y -= 8;//4; 682 dim.menu_height += 4; 683 if (left_preview_pane_width > 0) 684 { 685 dim.menu_y -= 8; 686 dim.menu_height += 8; 687 } 669 688 } 670 689 #endif … … 722 741 } 723 742 } 743 /* 744 // KP: dirty hacks for custom layouts 745 if (title_ == "Load Game") 746 { 747 dim.x = 0; 748 dim.interior.x = 0; 749 //dim.height = 480; 750 dim.interior.w = 480; 751 dim.menu_height += 8; 752 dim.menu_x = 15; //-1; 753 dim.menu_width = 480-30; 754 755 } 756 */ 757 758 #ifdef __IPAD__ 759 if (title_ == "Attack Enemy") 760 { 761 dim.menu_y -= 12; 762 } 763 #endif 724 764 725 765 set_layout(dim);
Note: See TracChangeset
for help on using the changeset viewer.