guiProfiles.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2013 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. if ($platform $= "windows")
  23. $platformFontType = "lucida console";
  24. else if ($platform $= "Android")
  25. $platformFontType = "Droid";
  26. else
  27. $platformFontType = "monaco";
  28. if ($platform $= "ios")
  29. $platformFontSize = 18;
  30. else if ($platform $= "Android")
  31. $platformFontSize = 14;
  32. else
  33. $platformFontSize = 12;
  34. //-----------------------------------------------------------------------------
  35. new GuiCursor(DefaultCursor)
  36. {
  37. hotSpot = "4 4";
  38. renderOffset = "0 0";
  39. bitmapName = "^Sandbox/gui/images/defaultCursor";
  40. };
  41. //---------------------------------------------------------------------------------------------
  42. // GuiDefaultProfile is a special profile that all other profiles inherit defaults from. It
  43. // must exist.
  44. //---------------------------------------------------------------------------------------------
  45. if(!isObject(GuiDefaultProfile)) new GuiControlProfile (GuiDefaultProfile)
  46. {
  47. tab = false;
  48. canKeyFocus = false;
  49. hasBitmapArray = false;
  50. mouseOverSelected = false;
  51. // fill color
  52. opaque = false;
  53. fillColor = "211 211 211";
  54. fillColorHL = "244 244 244";
  55. fillColorNA = "244 244 244";
  56. // border color
  57. border = 0;
  58. borderColor = "100 100 100 255";
  59. borderColorHL = "128 128 128";
  60. borderColorNA = "64 64 64";
  61. // font
  62. fontType = $platformFontType;
  63. fontSize = $platformFontSize;
  64. fontColor = "0 0 0";
  65. fontColorHL = "32 100 100";
  66. fontColorNA = "0 0 0";
  67. fontColorSEL= "10 10 10";
  68. // bitmap information
  69. bitmap = "^Sandbox/gui/images/window.png";
  70. bitmapBase = "";
  71. textOffset = "0 0";
  72. // used by guiTextControl
  73. modal = true;
  74. justify = "left";
  75. autoSizeWidth = false;
  76. autoSizeHeight = false;
  77. returnTab = false;
  78. numbersOnly = false;
  79. cursorColor = "0 0 0 255";
  80. // sounds
  81. soundButtonDown = $ButtonSound.fileName;
  82. soundButtonOver = "";
  83. };
  84. // ----------------------------------------------------------------------------
  85. if (!isObject(GuiTransparentProfile)) new GuiControlProfile (GuiTransparentProfile : GuiDefaultProfile)
  86. {
  87. opaque = false;
  88. border = false;
  89. };
  90. // ----------------------------------------------------------------------------
  91. if(!isObject(GuiSolidProfile)) new GuiControlProfile (GuiSolidProfile)
  92. {
  93. opaque = true;
  94. border = true;
  95. };
  96. // ----------------------------------------------------------------------------
  97. if (!isObject(GuiToolTipProfile)) new GuiControlProfile (GuiToolTipProfile : GuiDefaultProfile)
  98. {
  99. fillColor = "246 220 165 255";
  100. fontType = $platformFontType;
  101. fontSize = $platformFontSize;
  102. };
  103. // ----------------------------------------------------------------------------
  104. if (!isObject(GuiPopupMenuItemBorder)) new GuiControlProfile (GuiPopupMenuItemBorder : GuiDefaultProfile)
  105. {
  106. bitmap = "^Sandbox/gui/images/scroll";
  107. hasBitmapArray = true;
  108. };
  109. // ----------------------------------------------------------------------------
  110. if (!isObject(GuiPopUpMenuDefault)) new GuiControlProfile (GuiPopUpMenuDefault)
  111. {
  112. tab = false;
  113. canKeyFocus = false;
  114. hasBitmapArray = false;
  115. mouseOverSelected = false;
  116. // fill color
  117. opaque = false;
  118. fillColor = "255 255 255 192";
  119. fillColorHL = "255 0 0 192";
  120. fillColorNA = "0 0 255 255";
  121. // border color
  122. border = 1;
  123. borderColor = "100 100 100 255";
  124. borderColorHL = "0 128 0 255";
  125. borderColorNA = "0 226 226 52";
  126. // font
  127. fontType = $platformFontType;
  128. fontSize = $platformFontSize;
  129. fontColor = "27 59 95 255";
  130. fontColorHL = "232 240 248 255";
  131. fontColorNA = "0 0 0 255";
  132. fontColorSEL= "255 255 255 255";
  133. // bitmap information
  134. bitmap = "^Sandbox/gui/images/scroll";
  135. hasBitmapArray = true;
  136. bitmapBase = "";
  137. textOffset = "0 0";
  138. // used by guiTextControl
  139. modal = true;
  140. justify = "left";
  141. autoSizeWidth = false;
  142. autoSizeHeight = false;
  143. returnTab = false;
  144. numbersOnly = false;
  145. cursorColor = "0 0 0 255";
  146. profileForChildren = GuiPopupMenuItemBorder;
  147. // sounds
  148. soundButtonDown = "";
  149. soundButtonOver = "";
  150. };
  151. // ----------------------------------------------------------------------------
  152. if (!isObject(GuiPopUpMenuProfile)) new GuiControlProfile (GuiPopUpMenuProfile : GuiPopUpMenuDefault)
  153. {
  154. textOffset = "6 3";
  155. justify = "center";
  156. bitmap = "^Sandbox/gui/images/dropDown";
  157. hasBitmapArray = true;
  158. border = -3;
  159. profileForChildren = GuiPopUpMenuDefault;
  160. opaque = true;
  161. };
  162. //-----------------------------------------------------------------------------
  163. if (!isObject(GuiTextProfile)) new GuiControlProfile (GuiTextProfile)
  164. {
  165. border=false;
  166. // font
  167. fontType = $platformFontType;
  168. fontSize = $platformFontSize;
  169. fontColor = "white";
  170. modal = true;
  171. justify = "left";
  172. autoSizeWidth = false;
  173. autoSizeHeight = false;
  174. returnTab = false;
  175. numbersOnly = false;
  176. cursorColor = "0 0 0 255";
  177. };
  178. //-----------------------------------------------------------------------------
  179. if (!isObject(GuiCheckBoxProfile)) new GuiControlProfile (GuiCheckBoxProfile)
  180. {
  181. opaque = false;
  182. fontColor = "white";
  183. fillColor = "232 232 232 255";
  184. fontColorHL = "white";
  185. border = false;
  186. borderColor = "0 0 0 255";
  187. fontType = $platformFontType;
  188. fontSize = $platformFontSize;
  189. fixedExtent = true;
  190. justify = "left";
  191. bitmap = "^Sandbox/gui/images/checkBox";
  192. hasBitmapArray = true;
  193. };
  194. //-----------------------------------------------------------------------------
  195. if(!isObject(GuiConsoleProfile)) new GuiControlProfile (GuiConsoleProfile)
  196. {
  197. fontType = $platformFontType;
  198. fontSize = $platformFontSize * 1.1;
  199. fontColor = White;
  200. fontColorHL = LightSlateGray;
  201. fontColorNA = Red;
  202. fontColors[6] = "100 100 100";
  203. fontColors[7] = "100 100 0";
  204. fontColors[8] = "0 0 100";
  205. fontColors[9] = "0 100 0";
  206. };
  207. //-----------------------------------------------------------------------------
  208. if (!isObject(GuiTextEditProfile)) new GuiControlProfile (GuiTextEditProfile)
  209. {
  210. fontSize = $platformFontSize;
  211. opaque = false;
  212. fillColor = "232 240 248 255";
  213. fillColorHL = "251 170 0 255";
  214. fillColorNA = "127 127 127 52";
  215. border = -2;
  216. bitmap = "^Sandbox/gui/images/textEdit.png";
  217. borderColor = "40 40 40 10";
  218. fontColor = "27 59 95 255";
  219. fontColorHL = "232 240 248 255";
  220. fontColorNA = "0 0 0 52";
  221. fontColorSEL = "0 0 0 255";
  222. textOffset = "5 2";
  223. autoSizeWidth = false;
  224. autoSizeHeight = false;
  225. tab = false;
  226. canKeyFocus = true;
  227. returnTab = true;
  228. };
  229. //-----------------------------------------------------------------------------
  230. if(!isObject(GuiNumberEditProfile)) new GuiControlProfile (GuiNumberEditProfile: GuiTextEditProfile)
  231. {
  232. numbersOnly = true;
  233. };
  234. //-----------------------------------------------------------------------------
  235. if(!isObject(GuiConsoleTextEditProfile)) new GuiControlProfile (GuiConsoleTextEditProfile : GuiTextEditProfile)
  236. {
  237. fontType = $platformFontType;
  238. fontSize = $platformFontSize * 1.1;
  239. };
  240. //-----------------------------------------------------------------------------
  241. if(!isObject(GuiScrollProfile)) new GuiControlProfile (GuiScrollProfile)
  242. {
  243. opaque = true;
  244. fillColor = "255 255 255";
  245. border = 1;
  246. borderThickness = 2;
  247. bitmap = "^Sandbox/gui/images/scrollBar.png";
  248. hasBitmapArray = true;
  249. };
  250. //-----------------------------------------------------------------------------
  251. if(!isObject(GuiTransparentScrollProfile)) new GuiControlProfile (GuiTransparentScrollProfile)
  252. {
  253. opaque = false;
  254. fillColor = "255 255 255";
  255. border = false;
  256. borderThickness = 2;
  257. borderColor = "0 0 0";
  258. bitmap = "^Sandbox/gui/images/scrollBar.png";
  259. hasBitmapArray = true;
  260. };
  261. //-----------------------------------------------------------------------------
  262. if(!isObject(ConsoleScrollProfile)) new GuiControlProfile( ConsoleScrollProfile : GuiScrollProfile )
  263. {
  264. opaque = true;
  265. fillColor = "0 0 0 120";
  266. border = 3;
  267. borderThickness = 0;
  268. borderColor = "0 0 0";
  269. };
  270. //-----------------------------------------------------------------------------
  271. if(!isObject(GuiToolboxProfile)) new GuiControlProfile( GuiToolboxProfile : GuiScrollProfile )
  272. {
  273. opaque = true;
  274. fillColor = "255 255 255 220";
  275. border = 3;
  276. borderThickness = 0;
  277. borderColor = "0 0 0";
  278. };
  279. //-----------------------------------------------------------------------------
  280. if(!isObject(SandboxWindowProfile)) new GuiControlProfile (SandboxWindowProfile : GuiDefaultProfile)
  281. {
  282. // fill color
  283. opaque = false;
  284. fillColor = "0 0 0 92";
  285. // font
  286. fontType = $platformFontType;
  287. fontSize = $platformFontSize;
  288. fontColor = "255 255 255 255";
  289. lockMouse = "0";
  290. };
  291. //-----------------------------------------------------------------------------
  292. if (!isObject(GuiButtonProfile)) new GuiControlProfile (GuiButtonProfile)
  293. {
  294. opaque = true;
  295. border = -1;
  296. fontColor = "white";
  297. fontColorHL = "229 229 229 255";
  298. fixedExtent = true;
  299. justify = "center";
  300. canKeyFocus = false;
  301. fontType = $platformFontType;
  302. bitmap = "^Sandbox/gui/images/smallButtonContainer";
  303. };
  304. //-----------------------------------------------------------------------------
  305. if (!isObject(BlueButtonProfile)) new GuiControlProfile (BlueButtonProfile : GuiButtonProfile)
  306. {
  307. fontSize = $platformFontSize;
  308. fontColor = "255 255 255 255";
  309. fontColorHL = "255 255 255 255";
  310. bitmap = "^Sandbox/gui/images/blueButton.png";
  311. };
  312. //-----------------------------------------------------------------------------
  313. if (!isObject(RedButtonProfile)) new GuiControlProfile (RedButtonProfile : GuiButtonProfile)
  314. {
  315. fontSize = $platformFontSize;
  316. fontColor = "255 255 255 255";
  317. fontColorHL = "255 255 255 255";
  318. bitmap = "^Sandbox/gui/images/redButton.png";
  319. };
  320. //-----------------------------------------------------------------------------
  321. if (!isObject(GreenButtonProfile)) new GuiControlProfile (GreenButtonProfile : GuiButtonProfile)
  322. {
  323. fontSize = $platformFontSize;
  324. fontColor = "255 255 255 255";
  325. fontColorHL = "255 255 255 255";
  326. bitmap = "^Sandbox/gui/images/greenButton.png";
  327. };
  328. //-----------------------------------------------------------------------------
  329. if (!isObject(GuiRadioProfile)) new GuiControlProfile (GuiRadioProfile : GuiDefaultProfile)
  330. {
  331. fillColor = "232 232 232 255";
  332. fixedExtent = true;
  333. bitmap = "^Sandbox/gui/images/radioButton.png";
  334. hasBitmapArray = true;
  335. };
  336. //-----------------------------------------------------------------------------
  337. if (!isObject(GuiSliderProfile)) new GuiControlProfile (GuiSliderProfile)
  338. {
  339. bitmap = "^Sandbox/gui/images/slider.png";
  340. fontType = $platformFontType;
  341. fontSize = $platformFontSize;
  342. fontColor = "white";
  343. };
  344. //-----------------------------------------------------------------------------
  345. if (!isObject(GuiSliderNoTextProfile)) new GuiControlProfile (GuiSliderNoTextProfile)
  346. {
  347. bitmap = "^Sandbox/gui/images/slider.png";
  348. fontColor = "white";
  349. fontSize = 1;
  350. };
  351. //-----------------------------------------------------------------------------
  352. if (!isObject(GuiSpinnerProfile)) new GuiControlProfile (GuiSpinnerProfile)
  353. {
  354. fontType = $platformFontType;
  355. fontSize = $platformFontSize;
  356. opaque = false;
  357. justify = "center";
  358. fillColor = "232 240 248 255";
  359. fillColorHL = "251 170 0 255";
  360. fillColorNA = "127 127 127 52";
  361. numbersOnly = true;
  362. border = -2;
  363. bitmap = "^Sandbox/gui/images/textEdit_noSides";
  364. borderColor = "40 40 40 10";
  365. fontColor = "27 59 95 255";
  366. fontColorHL = "232 240 248 255";
  367. fontColorNA = "0 0 0 52";
  368. fontColorSEL = "0 0 0 255";
  369. textOffset = "4 2";
  370. autoSizeWidth = false;
  371. autoSizeHeight = false;
  372. tab = false;
  373. canKeyFocus = true;
  374. returnTab = true;
  375. };
  376. //-----------------------------------------------------------------------------
  377. if (!isObject(GuiLightScrollProfile)) new GuiControlProfile (GuiLightScrollProfile : GuiScrollProfile)
  378. {
  379. opaque = false;
  380. fillColor = "212 216 220";
  381. border = 0;
  382. bitmap = "^Sandbox/gui/images/scrollBar";
  383. hasBitmapArray = true;
  384. };
  385. //-----------------------------------------------------------------------------
  386. if (!isObject(GuiSunkenContainerProfile)) new GuiControlProfile (GuiSunkenContainerProfile)
  387. {
  388. opaque = false;
  389. fillColor = "232 240 248 255";
  390. fillColorHL = "251 170 0 255";
  391. fillColorNA = "127 127 127 52";
  392. border = -2;
  393. bitmap = "^Sandbox/gui/images/sunkenContainer";
  394. borderColor = "40 40 40 10";
  395. };