Generate Super Mario War worlds from real-world data.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

225 lines
5.8 KiB

  1. import {VFC} from 'react';
  2. import {DropdownSelect} from '../DropdownSelect';
  3. import {Checkbox} from '../Checkbox';
  4. import {NumericInput} from '../NumericInput';
  5. import styles from '../../styles/components/GenerateMapForm/index.module.css';
  6. import {ActionButton} from '../ActionButton';
  7. type GenerateMapFormProps = {
  8. disabled?: boolean;
  9. }
  10. export const GenerateMapForm: VFC<GenerateMapFormProps> = ({
  11. disabled = false,
  12. }) => {
  13. return (
  14. <div
  15. className={styles.base}
  16. >
  17. <div
  18. className={styles.fieldsetWrapper}
  19. >
  20. <fieldset
  21. className={styles.fieldset}
  22. disabled={disabled}
  23. >
  24. <legend>
  25. Base
  26. </legend>
  27. <div
  28. className={styles.formGroup}
  29. >
  30. <DropdownSelect
  31. name="map"
  32. block
  33. options={[
  34. {
  35. label: 'World',
  36. value: 'world',
  37. },
  38. {
  39. label: 'Multiple Continents',
  40. value: 'multiple-continents',
  41. children: [
  42. {
  43. label: 'Afro-Eurasia',
  44. value: 'multiple-continents.afro-eurasia',
  45. },
  46. {
  47. label: 'Americas',
  48. value: 'multiple-continents.americas',
  49. },
  50. {
  51. label: 'Eurasia',
  52. value: 'multiple-continents.eurasia',
  53. }
  54. ]
  55. },
  56. {
  57. label: 'Single Continents',
  58. value: 'single-continents',
  59. children: [
  60. {
  61. label: 'Africa',
  62. value: 'single-continents.africa',
  63. },
  64. {
  65. label: 'Antarctica',
  66. value: 'single-continents.antarctica',
  67. },
  68. {
  69. label: 'Asia',
  70. value: 'single-continents.asia',
  71. },
  72. {
  73. label: 'Australia & Oceania',
  74. value: 'single-continents.australia-oceania',
  75. },
  76. {
  77. label: 'Europe',
  78. value: 'single-continents.europe',
  79. },
  80. {
  81. label: 'North America',
  82. value: 'single-continents.north-america',
  83. },
  84. {
  85. label: 'South America',
  86. value: 'single-continents.south-america',
  87. },
  88. ],
  89. },
  90. ]}
  91. />
  92. </div>
  93. <div
  94. className={styles.formGroup}
  95. >
  96. <DropdownSelect
  97. name="projection"
  98. block
  99. options={[
  100. {
  101. label: 'Equirectangular',
  102. value: 'equirectangular',
  103. },
  104. {
  105. label: 'Mercator',
  106. value: 'mercator',
  107. },
  108. ]}
  109. />
  110. </div>
  111. <div
  112. className={styles.formGroup}
  113. >
  114. <DropdownSelect
  115. name="terrain"
  116. block
  117. options={[
  118. {
  119. label: 'Normal (with shallow waters)',
  120. value: 'normal-shallow-waters',
  121. },
  122. {
  123. label: 'Normal (uniform waters)',
  124. value: 'normal-uniform-waters',
  125. },
  126. {
  127. label: 'Lava',
  128. value: 'lava',
  129. },
  130. ]}
  131. />
  132. </div>
  133. <div
  134. className={styles.formGroup}
  135. >
  136. <Checkbox
  137. label="Force Island"
  138. defaultChecked
  139. name="forceIsland"
  140. />
  141. </div>
  142. <div
  143. className={styles.formGroup}
  144. >
  145. <Checkbox
  146. label="Add Natural Objects"
  147. defaultChecked
  148. name="addNaturalObjects"
  149. />
  150. </div>
  151. </fieldset>
  152. </div>
  153. <div
  154. className={styles.cities}
  155. >
  156. <fieldset
  157. className={styles.fieldset}
  158. disabled={disabled}
  159. >
  160. <legend>
  161. Cities
  162. </legend>
  163. </fieldset>
  164. </div>
  165. <div
  166. className={styles.fieldsetWrapper}
  167. >
  168. <fieldset
  169. className={styles.fieldset}
  170. disabled={disabled}
  171. >
  172. <legend>
  173. Map
  174. </legend>
  175. <div
  176. className={styles.horizontalFormGroup}
  177. >
  178. <div>
  179. <NumericInput
  180. min={1}
  181. block
  182. placeholder="Width"
  183. name="width"
  184. defaultValue={288}
  185. />
  186. </div>
  187. <div>
  188. <NumericInput
  189. min={1}
  190. block
  191. placeholder="Height"
  192. readOnly
  193. name="height"
  194. />
  195. </div>
  196. </div>
  197. <div
  198. className={styles.formGroup}
  199. >
  200. <div>
  201. <NumericInput
  202. block
  203. placeholder="Aspect Ratio"
  204. readOnly
  205. />
  206. </div>
  207. </div>
  208. </fieldset>
  209. </div>
  210. <div
  211. className={styles.fieldsetWrapper}
  212. >
  213. <ActionButton
  214. block
  215. disabled={disabled}
  216. >
  217. Generate Map
  218. </ActionButton>
  219. </div>
  220. </div>
  221. )
  222. }