Changeset 756
- Timestamp:
- 03/12/08 15:56:19 (9 months ago)
- Files:
-
- trunk/src/birth.c (modified) (8 diffs)
- trunk/src/button.c (modified) (1 diff)
- trunk/src/ui-menu.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/birth.c
r700 r756 907 907 908 908 909 static const menu_iter menu_defs[] = { 910 { 0, 0, 0, display_gender, gender_handler }, 911 { 0, 0, 0, display_race, race_handler }, 912 { 0, 0, 0, display_class, class_handler }, 913 { 0, 0, 0, display_roller, roller_handler }, 909 static const menu_iter menu_defs[] = 910 { 911 { MN_NULL, 0, 0, display_gender, gender_handler }, 912 { MN_NULL, 0, 0, display_race, race_handler }, 913 { MN_NULL, 0, 0, display_class, class_handler }, 914 { MN_NULL, 0, 0, display_roller, roller_handler }, 914 915 }; 915 916 … … 1700 1701 } 1701 1702 1702 typedef enum 1703 typedef enum 1703 1704 { 1704 1705 BIRTH_RESTART = 0, … … 1732 1733 case BIRTH_RESTART: 1733 1734 { 1734 state ++;1735 state = BIRTH_QUESTIONS; 1735 1736 break; 1736 1737 } … … 1739 1740 { 1740 1741 /* Race, class, etc. choices */ 1741 if (player_birth_aux_1(start_at_end)) 1742 state ++;1742 if (player_birth_aux_1(start_at_end)) 1743 state = BIRTH_STATS; 1743 1744 break; 1744 1745 } … … 1746 1747 case BIRTH_STATS: 1747 1748 { 1749 int temp; 1750 1748 1751 if (roller_type == ROLLER_POINT) 1749 1752 { 1750 1753 /* Fill stats using point-based methods */ 1751 state += player_birth_aux_2(start_at_end);1754 temp = player_birth_aux_2(start_at_end); 1752 1755 } 1753 1756 else 1754 1757 { 1755 1758 /* Fills stats using the standard- or auto-roller */ 1756 state += player_birth_aux_3(start_at_end, roller_type == ROLLER_AUTO);1759 temp = player_birth_aux_3(start_at_end, roller_type == ROLLER_AUTO); 1757 1760 } 1761 1762 if (temp > 0) 1763 state = BIRTH_NAME; 1764 else if (temp < 0) 1765 state = BIRTH_QUESTIONS; 1766 1758 1767 break; 1759 1768 } … … 1762 1771 { 1763 1772 /* Get a name, prepare savefile */ 1764 if (get_name(FALSE)) 1765 state ++;1766 else 1767 state --;1773 if (get_name(FALSE)) 1774 state = BIRTH_FINAL_APPROVAL; 1775 else 1776 state = BIRTH_STATS; 1768 1777 1769 1778 break; 1770 1779 } 1771 1780 1772 1781 case BIRTH_FINAL_APPROVAL: 1773 1782 { … … 1784 1793 button_add("[S]", 'S'); 1785 1794 redraw_stuff(); 1786 1795 1787 1796 /* Get a key */ 1788 1797 ke = inkey_ex(); 1789 1798 1790 1799 /* Start over */ 1791 if (ke.key == 'S') 1800 if (ke.key == 'S') 1792 1801 state = BIRTH_RESTART; 1793 1802 1794 if (ke.key == KTRL('X')) 1803 if (ke.key == KTRL('X')) 1795 1804 quit(NULL); 1796 1805 1797 if (ke.key == ESCAPE) 1798 state --;1806 if (ke.key == ESCAPE) 1807 state = BIRTH_NAME; 1799 1808 else 1800 state ++;1809 state = BIRTH_ACCEPTED; 1801 1810 1802 1811 /* Buttons */ 1803 1812 button_kill_all(); 1804 1813 redraw_stuff(); 1805 1814 1806 1815 /* Clear prompt */ 1807 1816 clear_from(23); … … 1809 1818 break; 1810 1819 } 1811 1820 1812 1821 case BIRTH_ACCEPTED: 1813 1822 { trunk/src/button.c
r698 r756 55 55 static int button_length; 56 56 static int button_num; 57 static int prompt_end;58 57 59 58 trunk/src/ui-menu.h
r542 r756 180 180 typedef enum 181 181 { 182 /* An empty slate */ 183 MN_NULL = 0x0, 184 182 185 /* A simple list of actions with an associated name and id. 183 186 An array of menu_action */
