guiProfiles.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  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. $platformFontType = ($platform $= "windows") ? "lucida console" : "monaco";
  23. $platformFontSize = ($platform $= "ios") ? 18 : 12;
  24. //-----------------------------------------------------------------------------
  25. new GuiCursor(DefaultCursor)
  26. {
  27. hotSpot = "4 4";
  28. renderOffset = "0 0";
  29. bitmapName = "^Sandbox/gui/images/defaultCursor";
  30. };
  31. //---------------------------------------------------------------------------------------------
  32. // GuiDefaultProfile is a special profile that all other profiles inherit defaults from. It
  33. // must exist.
  34. //---------------------------------------------------------------------------------------------
  35. if(!isObject(GuiDefaultProfile)) new GuiControlProfile (GuiDefaultProfile)
  36. {
  37. tab = false;
  38. canKeyFocus = false;
  39. hasBitmapArray = false;
  40. mouseOverSelected = false;
  41. // fill color
  42. opaque = false;
  43. fillColor = "211 211 211";
  44. fillColorHL = "244 244 244";
  45. fillColorNA = "244 244 244";
  46. // border color
  47. border = 0;
  48. borderColor = "100 100 100 255";
  49. borderColorHL = "128 128 128";
  50. borderColorNA = "64 64 64";
  51. // font
  52. fontType = $platformFontType;
  53. fontSize = $platformFontSize;
  54. fontColor = "0 0 0";
  55. fontColorHL = "32 100 100";
  56. fontColorNA = "0 0 0";
  57. fontColorSEL= "10 10 10";
  58. // bitmap information
  59. bitmap = "^Sandbox/gui/images/window.png";
  60. bitmapBase = "";
  61. textOffset = "0 0";
  62. // used by guiTextControl
  63. modal = true;
  64. justify = "left";
  65. autoSizeWidth = false;
  66. autoSizeHeight = false;
  67. returnTab = false;
  68. numbersOnly = false;
  69. cursorColor = "0 0 0 255";
  70. // sounds
  71. soundButtonDown = $ButtonSound.fileName;
  72. soundButtonOver = "";
  73. };
  74. // ----------------------------------------------------------------------------
  75. if (!isObject(GuiTransparentProfile)) new GuiControlProfile (GuiTransparentProfile : GuiDefaultProfile)
  76. {
  77. opaque = false;
  78. border = false;
  79. };
  80. // ----------------------------------------------------------------------------
  81. if(!isObject(GuiSolidProfile)) new GuiControlProfile (GuiSolidProfile)
  82. {
  83. opaque = true;
  84. border = true;
  85. };
  86. // ----------------------------------------------------------------------------
  87. if (!isObject(GuiToolTipProfile)) new GuiControlProfile (GuiToolTipProfile : GuiDefaultProfile)
  88. {
  89. fillColor = "246 220 165 255";
  90. fontType = $platformFontType;
  91. fontSize = $platformFontSize;
  92. };
  93. // ----------------------------------------------------------------------------
  94. if (!isObject(GuiPopupMenuItemBorder)) new GuiControlProfile (GuiPopupMenuItemBorder : GuiDefaultProfile)
  95. {
  96. bitmap = "^Sandbox/gui/images/scroll";
  97. hasBitmapArray = true;
  98. };
  99. // ----------------------------------------------------------------------------
  100. if (!isObject(GuiPopUpMenuDefault)) new GuiControlProfile (GuiPopUpMenuDefault)
  101. {
  102. tab = false;
  103. canKeyFocus = false;
  104. hasBitmapArray = false;
  105. mouseOverSelected = false;
  106. // fill color
  107. opaque = false;
  108. fillColor = "255 255 255 192";
  109. fillColorHL = "255 0 0 192";
  110. fillColorNA = "0 0 255 255";
  111. // border color
  112. border = 1;
  113. borderColor = "100 100 100 255";
  114. borderColorHL = "0 128 0 255";
  115. borderColorNA = "0 226 226 52";
  116. // font
  117. fontType = $platformFontType;
  118. fontSize = $platformFontSize;
  119. fontColor = "27 59 95 255";
  120. fontColorHL = "232 240 248 255";
  121. fontColorNA = "0 0 0 255";
  122. fontColorSEL= "255 255 255 255";
  123. // bitmap information
  124. bitmap = "^Sandbox/gui/images/scroll";
  125. hasBitmapArray = true;
  126. bitmapBase = "";
  127. textOffset = "0 0";
  128. // used by guiTextControl
  129. modal = true;
  130. justify = "left";
  131. autoSizeWidth = false;
  132. autoSizeHeight = false;
  133. returnTab = false;
  134. numbersOnly = false;
  135. cursorColor = "0 0 0 255";
  136. profileForChildren = GuiPopupMenuItemBorder;
  137. // sounds
  138. soundButtonDown = "";
  139. soundButtonOver = "";
  140. };
  141. // ----------------------------------------------------------------------------
  142. if (!isObject(GuiPopUpMenuProfile)) new GuiControlProfile (GuiPopUpMenuProfile : GuiPopUpMenuDefault)
  143. {
  144. textOffset = "6 3";
  145. justify = "center";
  146. bitmap = "^Sandbox/gui/images/dropDown";
  147. hasBitmapArray = true;
  148. border = -3;
  149. profileForChildren = GuiPopUpMenuDefault;
  150. opaque = true;
  151. };
  152. //-----------------------------------------------------------------------------
  153. if (!isObject(GuiTextProfile)) new GuiControlProfile (GuiTextProfile)
  154. {
  155. border=false;
  156. // font
  157. fontType = $platformFontType;
  158. fontSize = $platformFontSize;
  159. fontColor = "white";
  160. modal = true;
  161. justify = "left";
  162. autoSizeWidth = false;
  163. autoSizeHeight = false;
  164. returnTab = false;
  165. numbersOnly = false;
  166. cursorColor = "0 0 0 255";
  167. };
  168. //-----------------------------------------------------------------------------
  169. if (!isObject(GuiCheckBoxProfile)) new GuiControlProfile (GuiCheckBoxProfile)
  170. {
  171. opaque = false;
  172. fontColor = "white";
  173. fillColor = "232 232 232 255";
  174. fontColorHL = "white";
  175. border = false;
  176. borderColor = "0 0 0 255";
  177. fontType = $platformFontType;
  178. fontSize = $platformFontSize;
  179. fixedExtent = true;
  180. justify = "left";
  181. bitmap = "^Sandbox/gui/images/checkBox";
  182. hasBitmapArray = true;
  183. };
  184. //-----------------------------------------------------------------------------
  185. if(!isObject(GuiConsoleProfile)) new GuiControlProfile (GuiConsoleProfile)
  186. {
  187. fontType = $platformFontType;
  188. fontSize = $platformFontSize * 1.1;
  189. fontColor = White;
  190. fontColorHL = LightSlateGray;
  191. fontColorNA = Red;
  192. fontColors[6] = "100 100 100";
  193. fontColors[7] = "100 100 0";
  194. fontColors[8] = "0 0 100";
  195. fontColors[9] = "0 100 0";
  196. };
  197. //-----------------------------------------------------------------------------
  198. if (!isObject(GuiTextEditProfile)) new GuiControlProfile (GuiTextEditProfile)
  199. {
  200. fontSize = $platformFontSize;
  201. opaque = false;
  202. fillColor = "232 240 248 255";
  203. fillColorHL = "251 170 0 255";
  204. fillColorNA = "127 127 127 52";
  205. border = -2;
  206. bitmap = "^Sandbox/gui/images/textEdit.png";
  207. borderColor = "40 40 40 10";
  208. fontColor = "27 59 95 255";
  209. fontColorHL = "232 240 248 255";
  210. fontColorNA = "0 0 0 52";
  211. fontColorSEL = "0 0 0 255";
  212. textOffset = "5 2";
  213. autoSizeWidth = false;
  214. autoSizeHeight = false;
  215. tab = false;
  216. canKeyFocus = true;
  217. returnTab = true;
  218. };
  219. //-----------------------------------------------------------------------------
  220. if(!isObject(GuiNumberEditProfile)) new GuiControlProfile (GuiNumberEditProfile: GuiTextEditProfile)
  221. {
  222. numbersOnly = true;
  223. };
  224. //-----------------------------------------------------------------------------
  225. if(!isObject(GuiConsoleTextEditProfile)) new GuiControlProfile (GuiConsoleTextEditProfile : GuiTextEditProfile)
  226. {
  227. fontType = $platformFontType;
  228. fontSize = $platformFontSize * 1.1;
  229. };
  230. //-----------------------------------------------------------------------------
  231. if(!isObject(GuiScrollProfile)) new GuiControlProfile (GuiScrollProfile)
  232. {
  233. opaque = true;
  234. fillColor = "255 255 255";
  235. border = 1;
  236. borderThickness = 2;
  237. bitmap = "^Sandbox/gui/images/scrollBar.png";
  238. hasBitmapArray = true;
  239. };
  240. //-----------------------------------------------------------------------------
  241. if(!isObject(GuiTransparentScrollProfile)) new GuiControlProfile (GuiTransparentScrollProfile)
  242. {
  243. opaque = false;
  244. fillColor = "255 255 255";
  245. border = false;
  246. borderThickness = 2;
  247. borderColor = "0 0 0";
  248. bitmap = "^Sandbox/gui/images/scrollBar.png";
  249. hasBitmapArray = true;
  250. };
  251. //-----------------------------------------------------------------------------
  252. if(!isObject(ConsoleScrollProfile)) new GuiControlProfile( ConsoleScrollProfile : GuiScrollProfile )
  253. {
  254. opaque = true;
  255. fillColor = "0 0 0 120";
  256. border = 3;
  257. borderThickness = 0;
  258. borderColor = "0 0 0";
  259. };
  260. //-----------------------------------------------------------------------------
  261. if(!isObject(GuiToolboxProfile)) new GuiControlProfile( GuiToolboxProfile : GuiScrollProfile )
  262. {
  263. opaque = true;
  264. fillColor = "255 255 255 220";
  265. border = 3;
  266. borderThickness = 0;
  267. borderColor = "0 0 0";
  268. };
  269. //-----------------------------------------------------------------------------
  270. if(!isObject(SandboxWindowProfile)) new GuiControlProfile (SandboxWindowProfile : GuiDefaultProfile)
  271. {
  272. // fill color
  273. opaque = false;
  274. fillColor = "0 0 0 92";
  275. // font
  276. fontType = $platformFontType;
  277. fontSize = $platformFontSize;
  278. fontColor = "255 255 255 255";
  279. };
  280. //-----------------------------------------------------------------------------
  281. if (!isObject(GuiButtonProfile)) new GuiControlProfile (GuiButtonProfile)
  282. {
  283. opaque = true;
  284. border = -1;
  285. fontColor = "white";
  286. fontColorHL = "229 229 229 255";
  287. fixedExtent = true;
  288. justify = "center";
  289. canKeyFocus = false;
  290. fontType = $platformFontType;
  291. bitmap = "^Sandbox/gui/images/smallButtonContainer";
  292. };
  293. //-----------------------------------------------------------------------------
  294. if (!isObject(BlueButtonProfile)) new GuiControlProfile (BlueButtonProfile : GuiButtonProfile)
  295. {
  296. fontSize = $platformFontSize;
  297. fontColor = "255 255 255 255";
  298. fontColorHL = "255 255 255 255";
  299. bitmap = "^Sandbox/gui/images/blueButton.png";
  300. };
  301. //-----------------------------------------------------------------------------
  302. if (!isObject(RedButtonProfile)) new GuiControlProfile (RedButtonProfile : GuiButtonProfile)
  303. {
  304. fontSize = $platformFontSize;
  305. fontColor = "255 255 255 255";
  306. fontColorHL = "255 255 255 255";
  307. bitmap = "^Sandbox/gui/images/redButton.png";
  308. };
  309. //-----------------------------------------------------------------------------
  310. if (!isObject(GreenButtonProfile)) new GuiControlProfile (GreenButtonProfile : GuiButtonProfile)
  311. {
  312. fontSize = $platformFontSize;
  313. fontColor = "255 255 255 255";
  314. fontColorHL = "255 255 255 255";
  315. bitmap = "^Sandbox/gui/images/greenButton.png";
  316. };
  317. //-----------------------------------------------------------------------------
  318. if (!isObject(GuiRadioProfile)) new GuiControlProfile (GuiRadioProfile : GuiDefaultProfile)
  319. {
  320. fillColor = "232 232 232 255";
  321. fixedExtent = true;
  322. bitmap = "^Sandbox/gui/images/radioButton.png";
  323. hasBitmapArray = true;
  324. };
  325. //-----------------------------------------------------------------------------
  326. if (!isObject(GuiSliderProfile)) new GuiControlProfile (GuiSliderProfile)
  327. {
  328. bitmap = "^Sandbox/gui/images/slider.png";
  329. fontType = $platformFontType;
  330. fontSize = $platformFontSize;
  331. fontColor = "white";
  332. };
  333. //-----------------------------------------------------------------------------
  334. if (!isObject(GuiSliderNoTextProfile)) new GuiControlProfile (GuiSliderNoTextProfile)
  335. {
  336. bitmap = "^Sandbox/gui/images/slider.png";
  337. fontColor = "white";
  338. fontSize = 1;
  339. };
  340. //-----------------------------------------------------------------------------
  341. if (!isObject(GuiSpinnerProfile)) new GuiControlProfile (GuiSpinnerProfile)
  342. {
  343. fontType = $platformFontType;
  344. fontSize = $platformFontSize;
  345. opaque = false;
  346. justify = "center";
  347. fillColor = "232 240 248 255";
  348. fillColorHL = "251 170 0 255";
  349. fillColorNA = "127 127 127 52";
  350. numbersOnly = true;
  351. border = -2;
  352. bitmap = "^Sandbox/gui/images/textEdit_noSides";
  353. borderColor = "40 40 40 10";
  354. fontColor = "27 59 95 255";
  355. fontColorHL = "232 240 248 255";
  356. fontColorNA = "0 0 0 52";
  357. fontColorSEL = "0 0 0 255";
  358. textOffset = "4 2";
  359. autoSizeWidth = false;
  360. autoSizeHeight = false;
  361. tab = false;
  362. canKeyFocus = true;
  363. returnTab = true;
  364. };
  365. //-----------------------------------------------------------------------------
  366. if (!isObject(GuiLightScrollProfile)) new GuiControlProfile (GuiLightScrollProfile : GuiScrollProfile)
  367. {
  368. opaque = false;
  369. fillColor = "212 216 220";
  370. border = 0;
  371. bitmap = "^Sandbox/gui/images/scrollBar";
  372. hasBitmapArray = true;
  373. };
  374. //-----------------------------------------------------------------------------
  375. if (!isObject(GuiSunkenContainerProfile)) new GuiControlProfile (GuiSunkenContainerProfile)
  376. {
  377. opaque = false;
  378. fillColor = "232 240 248 255";
  379. fillColorHL = "251 170 0 255";
  380. fillColorNA = "127 127 127 52";
  381. border = -2;
  382. bitmap = "^Sandbox/gui/images/sunkenContainer";
  383. borderColor = "40 40 40 10";
  384. };