Author Topic: Build yourself a fancy menu!  (Read 1720 times)

0 Members and 1 Guest are viewing this topic.

Offline loudar

  • Newbie
  • Posts: 73
  • improve it bit by bit.
    • View Profile
Build yourself a fancy menu!
« on: May 20, 2020, 10:38:01 pm »
Hello everyone!

As part of a couple of my projects, I've been using a self-coded set of SUB's that deal with creating menu elements.
I've always found menus not fun, if caring about the structuring part, so I thought I'd automate it ;)

Here's the code! For questions and feedback, I'm also available on Discord: loudar#0582

>>>> <<<<
This file is for this specific example, but feel free to use a different source for accepted characters!

Best regards,
Alex

Code: QB64: [Select]
  1. DIM SHARED maxx
  2. DIM SHARED maxy
  3. maxx = (_DESKTOPWIDTH / 2) * 1.1
  4. maxy = maxx / 16 * 9
  5. SCREEN _NEWIMAGE(maxx, maxy, 32)
  6. _SCREENMOVE (_DESKTOPWIDTH / 2) - (maxx / 2), (_DESKTOPHEIGHT / 2) - (maxy / 2)
  7.  
  8. 'loads allowed characters (ac) from file
  9. DIM SHARED ac$(200)
  10. DIM SHARED alch 'amount of different allowed characters
  11.  
  12. 'font
  13. DIM SHARED maxrows 'maximum amount of rows
  14. DIM SHARED maxlines 'maximum amount of columns
  15. DIM SHARED fontheight
  16. DIM SHARED fontwidth
  17. DIM SHARED firstline 'standard 0-column
  18. DIM SHARED firstchar 'standard 0-row
  19. fontheight = 16
  20. fontfiler$ = "C:\WINDOWS\FONTS\COUR.TTF"
  21. r& = _LOADFONT(fontfiler$, fontheight, "MONOSPACE")
  22. fontwidth = _FONTWIDTH(r&)
  23. maxrows = INT(maxx / fontwidth)
  24. maxlines = INT(maxy / fontheight) - 4
  25.  
  26. 'menu (alphabetically sorted)
  27. maxmenuitems = 50
  28. maxarraylen = 20
  29. mafirstchars = 3000
  30. DIM SHARED arraydata$(maxmenuitems, maxarraylen) '  used to store the contents of selectors and dropdown elements
  31. DIM SHARED backspace(maxmenuitems) '                determines whether backspace was pressed during an active input
  32. DIM SHARED basex(maxmenuitems) '                    represents the very left x value of a menu object
  33. DIM SHARED basey(maxmenuitems) '                    represents the very top y value of a menu object
  34. DIM SHARED borderoffsetx(maxmenuitems) '            change this to widen/narrow items with borders
  35. DIM SHARED borderoffsety(maxmenuitems) '            change this to widen/narrow items with borders
  36. DIM SHARED c(maxmenuitems) '                        amount of characters in input element
  37. DIM SHARED cbf(maxmenuitems) '                      amount of characters in input element, but from one loop before
  38. DIM SHARED char$(maxmenuitems, mafirstchars) '      single character within element at specific position
  39. DIM SHARED defaultstyle(maxmenuitems) '             determines the default style of a menu object
  40. DIM SHARED destination$(maxmenuitems) '             what should happen if the user interacts with this element
  41. DIM SHARED editpos(maxmenuitems) '                  current editing position in input
  42. DIM SHARED endparameter$ '                          this gives you info about what the user did in the menu, can be used to transfer data (could potentially convert the RunMenu SUB into a Function...)
  43. DIM SHARED endx(maxmenuitems) '                     represents the very right x value of a menu object
  44. DIM SHARED endy(maxmenuitems) '                     represents the very bottom y value of a menu object
  45. DIM SHARED expanded(maxmenuitems) '                 if the dropdown menu is expanded
  46. DIM SHARED fill$(maxmenuitems) '                    text to fill the editable part of an input with, good for stuff that is loaded, changed, then saved again
  47. DIM SHARED firstprint(maxmenuitems) '               equals 0 if the element hasn't been written on screen before, can be used to reinitialize it
  48. DIM SHARED kind$(maxmenuitems) '                    defines the button type
  49. DIM SHARED inter(maxmenuitems) '                    if element is interactable with
  50. DIM SHARED m '                                      could be used to get current element and use it in other SUB's/Functions
  51. DIM SHARED maxad(maxmenuitems) '                    amount of data in array
  52. DIM SHARED maxadlength(maxmenuitems) '              maximum length of array data for dropdown element
  53. DIM SHARED maxc(maxmenuitems) '                     maximum amount of characters in input element
  54. DIM SHARED maxmi '                                  highest interactable element
  55. DIM SHARED maxval(maxmenuitems) '                   maximum value of slider element
  56. DIM SHARED minval(maxmenuitems) '                   minimum value of slider element
  57. DIM SHARED overlaptrigger(maxmenuitems) '           used to deal with overlapping issues of dropdown-elements
  58. DIM SHARED selected(maxmenuitems) '                 selectd object within array of element
  59. DIM SHARED setting$(maxmenuitems) '                 setting that the toggle element changes
  60. DIM SHARED state(maxmenuitems) '                    state of toggle element
  61. DIM SHARED status$(maxmenuitems) '                  used for interactive elements, "finished" if determined done (e.g. for filling out forms)
  62. DIM SHARED style(maxmenuitems) '                    current style of an element
  63. DIM SHARED text$(maxmenuitems) '                    non-editable text in front of input
  64. DIM SHARED trigger(maxmenuitems) '                  it's used, but idk what it does anymore :'D
  65. DIM SHARED type$(maxmenuitems) '                    type of menu element
  66. DIM SHARED UserInput$(maxmenuitems) '               full input text of input element, for usage after menu is run
  67. DIM SHARED value(maxmenuitems) '                    current value of slider element
  68. DIM SHARED xoffset(maxmenuitems) '                  positioning on x-axis
  69. DIM SHARED yoffset(maxmenuitems) '                  positioning on y-axis
  70. 'dropdown triangles :D (ascii chars could work maybe?)
  71. DIM SHARED p1x(maxmenuitems)
  72. DIM SHARED p1y(maxmenuitems)
  73. DIM SHARED p2x(maxmenuitems)
  74. DIM SHARED p2y(maxmenuitems)
  75. DIM SHARED p3x(maxmenuitems)
  76. DIM SHARED p3y(maxmenuitems)
  77.  
  78. 'color definitions
  79. maxcolors = 5
  80. DIM SHARED r(maxcolors): DIM SHARED g(maxcolors): DIM SHARED b(maxcolors): DIM SHARED a(maxcolors)
  81. r(1) = 237: g(1) = r(1): b(1) = r(1): a(1) = 255 '_RGBA(237, 237, 237, 255)     - white
  82. r(2) = 15: g(2) = r(2): b(2) = r(2): a(2) = 255 '_RGBA(15, 15, 15, 255)         - black
  83. r(3) = 28: g(3) = 166: b(3) = 28: a(3) = 255 '_RGBA(28, 166, 28, 255)           - green
  84. r(4) = 244: g(4) = 188: b(4) = 67: a(4) = 255 '_RGBA(244, 188, 67, 255)         - orange/yellow
  85. r(5) = 216: g(5) = 33: b(5) = 17: a(5) = 255 ' _RGBA(216, 33, 17, 255)          - red
  86. COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  87.  
  88. 'load the allowed input characters, feel free to change these :)
  89. OPEN "AC.txt" FOR INPUT AS #1
  90. ac = 0
  91.     ac = ac + 1
  92.     INPUT #1, ac$(ac)
  93.     ac$(ac) = _INFLATE$(ac$(ac))
  94. LOOP UNTIL EOF(1) = -1
  95. alch = ac
  96.  
  97. 'change these to your liking!
  98. firstline = 2
  99. firstchar = 5
  100.  
  101. '================================================= PROGRAM AREA =================================================
  102.  
  103. ClearMenu
  104. 'add your elements here
  105. NewText 1, 0, "Test", 0
  106.  
  107. NewToggle 2, 0, "ToggleTest", "lmao"
  108.  
  109. NewSlider 3, 0, 0, 100, "Test Value"
  110.  
  111. NewButton 4, 0, "Button!", 0, "redirection", "nowhere"
  112.  
  113. NewSelector 5, 0, "Select"
  114. arraydata$(5, 1) = "this"
  115. arraydata$(5, 2) = "that"
  116. maxad(5) = 2
  117.  
  118. NewDropdown 6, 0, "Select"
  119. arraydata$(6, 1) = "dis"
  120. arraydata$(6, 2) = "dat"
  121. maxad(6) = 2
  122.  
  123. NewInput 7, 0, "Write here:", "actually, don't"
  124.  
  125. RunMenu
  126.  
  127. '=================================================== SUB AREA ===================================================
  128.  
  129. SUB NewText (yoffset, xoffset, text$, style)
  130.     m = m + 1
  131.     inter(m) = 0
  132.     type$(m) = "text"
  133.     yoffset(m) = yoffset * 2
  134.     xoffset(m) = xoffset
  135.     text$(m) = text$
  136.     style(m) = style
  137.     status$(m) = ""
  138.  
  139. SUB NewToggle (yoffset, xoffset, text$, setting$)
  140.     m = m + 1
  141.     type$(m) = "toggle"
  142.     setting$(m) = setting$
  143.     SELECT CASE setting$(m)
  144.         CASE IS = "YOUR_SETTING_HERE"
  145.             state(m) = SETTING_VALUE 'writes the state of the value used into the menu so it displays properly
  146.     END SELECT
  147.     text$(m) = text$
  148.     yoffset(m) = yoffset * 2
  149.     xoffset(m) = xoffset
  150.     basex(m) = (firstchar + (LEN(text$)) + xoffset(m) + 1) * fontwidth
  151.     basey(m) = (firstline + yoffset(m) - 1) * fontheight - (fontheight / 2)
  152.     endx(m) = basex(m) + 2 * fontheight
  153.     endy(m) = (firstline + yoffset(m)) * fontheight + (fontheight / 3)
  154.  
  155. SUB NewSlider (yoffset, xoffset, minval, maxval, text$)
  156.     m = m + 1
  157.     inter(m) = 1
  158.     maxmi = m
  159.     type$(m) = "slider"
  160.     yoffset(m) = yoffset * 2
  161.     minval(m) = minval
  162.     maxval(m) = maxval
  163.     xoffset(m) = xoffset
  164.     text$(m) = text$
  165.     basex(m) = (firstchar + xoffset(m) + LEN(text$(m))) * fontwidth + (fontwidth / 2) 'change this to fit your setup
  166.     value(m) = maxval(m)
  167.     endx(m) = basex(m) + (maxx / 4) + 4
  168.     status$(m) = ""
  169.  
  170. SUB NewButton (yoffset, xoffset, text$, style, kind$, destination$)
  171.     m = m + 1
  172.     maxmi = m
  173.     inter(m) = 1
  174.     type$(m) = "button"
  175.     yoffset(m) = yoffset * 2
  176.     xoffset(m) = xoffset
  177.     borderoffsetx(m) = 0
  178.     borderoffsety(m) = 0
  179.     text$(m) = text$
  180.     basex(m) = (firstchar + xoffset(m) - 1) * fontwidth - (fontwidth / 2) + borderoffsetx(m)
  181.     endx(m) = basex(m) + (LEN(text$(m)) + 1) * fontwidth + (fontwidth / 2)
  182.     basey(m) = (firstline + yoffset(m) - 1) * fontheight - (fontheight / 2) + borderoffsety(m)
  183.     endy(m) = (firstline + yoffset(m)) * fontheight + (fontheight / 3) + borderoffsety(m)
  184.     kind$(m) = kind$
  185.     destination$(m) = destination$
  186.     style(m) = style
  187.     defaultstyle(m) = style
  188.     status$(m) = ""
  189.  
  190. SUB NewSelector (yoffset, xoffset, text$)
  191.     m = m + 1
  192.     inter(m) = 1
  193.     maxmi = m
  194.     type$(m) = "selector"
  195.     selected(m) = 1
  196.     text$(m) = text$
  197.     yoffset(m) = yoffset * 2
  198.     xoffset(m) = xoffset
  199.     basex(m) = (firstchar + xoffset(m) - 1) * fontwidth - (fontwidth / 2)
  200.     basey(m) = (firstline + yoffset(m) - 1) * fontheight - (fontheight / 2)
  201.     endx(m) = basex(m) + (LEN(text$) + 1) * fontwidth + (fontwidth / 2)
  202.     endy(m) = (firstline + yoffset(m)) * fontheight + (fontheight / 3)
  203.  
  204. SUB NewDropdown (yoffset, xoffset, text$)
  205.     m = m + 1
  206.     inter(m) = 1
  207.     maxmi = m
  208.     type$(m) = "dropdown"
  209.     yoffset(m) = yoffset * 2
  210.     xoffset(m) = xoffset
  211.     borderoffsetx(m) = 0
  212.     borderoffsety(m) = -2
  213.     text$(m) = text$
  214.     basex(m) = (firstchar + xoffset(m) + LEN(text$(m)) + 1) * fontwidth - (fontwidth / 2) + borderoffsetx(m) 'left end of dropdown box
  215.     basey(m) = (firstline + yoffset(m) - 1) * fontheight - (fontheight / 2) + borderoffsety(m)
  216.     endy(m) = (firstline + yoffset(m)) * fontheight + (fontheight / 3) + borderoffsety(m)
  217.     status$(m) = ""
  218.  
  219. SUB NewInput (yoffset, xoffset, text$, fill$)
  220.     m = m + 1
  221.     inter(m) = 1
  222.     maxmi = m
  223.     IF maxc(m) > 0 THEN
  224.         c(m) = 0
  225.         DO
  226.             c(m) = c(m) + 1
  227.             char$(m, c(m)) = ""
  228.         LOOP UNTIL c(m) = maxg(m)
  229.         c(m) = 0
  230.         maxc(m) = 0
  231.     END IF
  232.     type$(m) = "input"
  233.     yoffset(m) = yoffset * 2
  234.     fill$(m) = fill$
  235.     text$(m) = text$
  236.     xoffset(m) = xoffset
  237.     status$(m) = ""
  238.  
  239. SUB ClearMenu
  240.     m = 0
  241.     'ERASE c, cbf, char$, firstprint, type$, UserInput$, status$, destination$, style, defaultstyle, basex, endx, basey, endy
  242.     maxm = 0
  243.     activem = 1
  244.     maxmi = 0
  245.  
  246. SUB RunMenu
  247.     COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  248.     CLS
  249.     'add more background elements here if you want! you can just add a parameter to RunMenu to get the info which BG should be used
  250.     endparameter$ = ""
  251.     maxm = m
  252.     activem = 1
  253.     DO
  254.         '_LIMIT 120
  255.         Taste$ = INKEY$
  256.         SELECT CASE Taste$
  257.             CASE IS = CHR$(13)
  258.                 IF activem < maxmm AND inter(activem) = 1 THEN
  259.                     status$(activem) = "finished"
  260.                     activem = activem + 1
  261.                 END IF
  262.             CASE IS = CHR$(0) + CHR$(80) 'arrow down
  263.                 IF activem < maxm THEN
  264.                     activem = activem + 1
  265.                 ELSE
  266.                     activem = 1
  267.                 END IF
  268.             CASE IS = CHR$(0) + CHR$(72) 'arrow up
  269.                 IF activem > 1 THEN
  270.                     activem = activem - 1
  271.                 ELSE
  272.                     activem = maxm
  273.                 END IF
  274.             CASE IS = CHR$(0) + CHR$(60) 'F2
  275.                 IF activem < maxm THEN
  276.                     activem = activem + 1
  277.                 ELSE
  278.                     activem = 1
  279.                 END IF
  280.             CASE IS = CHR$(0) + CHR$(59) 'F1
  281.                 IF activem > 1 THEN
  282.                     activem = activem - 1
  283.                 ELSE
  284.                     activem = maxm
  285.                 END IF
  286.             CASE IS = CHR$(0) + CHR$(77) 'arrow right
  287.                 IF selected(activem) < maxad(activem) THEN
  288.                     selected(activem) = selected(activem) + 1
  289.                 ELSE
  290.                     selected(activem) = 1
  291.                 END IF
  292.             CASE IS = CHR$(0) + CHR$(75) 'arrow left
  293.                 IF selected(activem) > 1 THEN
  294.                     selected(activem) = selected(activem) - 1
  295.                 ELSE
  296.                     selected(activem) = maxad(activem)
  297.                 END IF
  298.         END SELECT
  299.         m = 0
  300.         DO
  301.             m = m + 1
  302.             SELECT CASE type$(m)
  303.                 CASE IS = "text"
  304.                     checkm = 0
  305.                     DO
  306.                         checkm = checkm + 1
  307.                         IF overlaptrigger(checkm) = 1 AND checkm < m THEN
  308.                             overlaptrigger(checkm) = 0
  309.                             firstprint(m) = 0
  310.                         END IF
  311.                     LOOP UNTIL checkm = maxm
  312.                     IF firstprint(m) = 0 THEN
  313.                         firstprint(m) = 1
  314.                         LOCATE firstline + yoffset(m), firstchar + xoffset(m)
  315.                         SELECT CASE style(m)
  316.                             CASE IS = 0
  317.                                 COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  318.                             CASE IS = 1
  319.                                 COLOR _RGBA(r(3), g(3), b(3), a(3)), _RGBA(r(1), g(1), b(1), a(1)) 'green
  320.                             CASE IS = 2
  321.                                 COLOR _RGBA(r(5), g(5), b(5), a(5)), _RGBA(r(1), g(1), b(1), a(1)) 'red
  322.                         END SELECT
  323.                         PRINT text$(m)
  324.                     END IF
  325.                 CASE IS = "toggle"
  326.                     IF _MOUSEINPUT = -1 THEN
  327.                         IF mouseclicked = 0 THEN
  328.                             IF _MOUSEBUTTON(1) = -1 THEN
  329.                                 IF _MOUSEX > basex(m) AND _MOUSEX < endx(m) THEN
  330.                                     IF _MOUSEY > basey(m) AND _MOUSEY < endy(m) THEN
  331.                                         mouseclicked = 1
  332.                                         IF state(m) = 1 THEN
  333.                                             state(m) = 0
  334.                                         ELSE
  335.                                             state(m) = 1
  336.                                         END IF
  337.                                         GOTO printtoggle
  338.                                     END IF
  339.                                 END IF
  340.                             END IF
  341.                         END IF
  342.                     ELSE
  343.                         mouseclicked = 0
  344.                     END IF
  345.                     IF firstprint(m) = 0 THEN
  346.                         firstprint(m) = 1
  347.                         printtoggle:
  348.                         SELECT CASE state(m)
  349.                             CASE IS = 0
  350.                                 LINE (basex(m), basey(m))-(endx(m), endy(m)), _RGBA(r(1), g(1), b(1), a(1)), BF
  351.                                 LINE (basex(m), basey(m))-(endx(m), endy(m)), _RGBA(r(2), g(2), b(2), a(2)), B
  352.                                 LINE (basex(m) + 2, basey(m) + 2)-(endx(m) - (endx(m) - basex(m)) / 2 - 2, endy(m) - 2), _RGBA(r(2), g(2), b(2), a(2)), BF
  353.                             CASE IS = 1
  354.                                 LINE (basex(m), basey(m))-(endx(m), endy(m)), _RGBA(r(2), g(2), b(2), a(2)), BF
  355.                                 LINE (basex(m) + (endx(m) - basex(m)) / 2 + 2, basey(m) + 2)-(endx(m) - 2, endy(m) - 2), _RGBA(r(4), g(4), b(4), a(4)), BF
  356.                         END SELECT
  357.                         COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  358.                         LOCATE firstline + yoffset(m), firstchar + xoffset(m)
  359.                         PRINT text$(m)
  360.                     END IF
  361.                 CASE IS = "button"
  362.                     checkm = 0
  363.                     DO
  364.                         checkm = checkm + 1
  365.                         IF overlaptrigger(checkm) = 1 AND checkm < m THEN
  366.                             overlaptrigger(checkm) = 0
  367.                             firstprint(m) = 0
  368.                         END IF
  369.                     LOOP UNTIL checkm = maxm
  370.                     IF firstprint(m) = 0 THEN
  371.                         firstprint(m) = 1
  372.                         SELECT CASE style(m)
  373.                             CASE IS = 0 'default
  374.                                 LINE (basex(m), basey(m))-(endx(m), endy(m)), _RGBA(r(1), g(1), b(1), a(1)), BF
  375.                                 LINE (basex(m), basey(m))-(endx(m), endy(m)), _RGBA(r(2), g(2), b(2), a(2)), B
  376.                                 COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  377.                             CASE IS = 1 'filled
  378.                                 LINE (basex(m), basey(m))-(endx(m), endy(m)), _RGBA(r(2), g(2), b(2), a(2)), BF
  379.                                 COLOR _RGBA(r(1), g(1), b(1), a(1)), _RGBA(r(2), g(2), b(2), a(2))
  380.                             CASE IS = 2 'colored (color index 3)
  381.                                 LINE (basex(m), basey(m))-(endx(m), endy(m)), _RGBA(r(3), g(3), b(3), a(3)), BF
  382.                                 COLOR _RGBA(r(1), g(1), b(1), a(1)), _RGBA(r(3), g(3), b(3), a(3))
  383.                             CASE IS = 3 'color border (color index 3)
  384.                                 LINE (basex(m), basey(m))-(endx(m), endy(m)), _RGBA(r(1), g(1), b(1), a(1)), B
  385.                                 LINE (basex(m), basey(m))-(endx(m), endy(m)), _RGBA(r(3), g(3), b(3), a(3)), B
  386.                                 COLOR _RGBA(r(3), g(3), b(3), a(3)), _RGBA(r(1), g(1), b(1), a(1))
  387.                         END SELECT
  388.                         LOCATE firstline + yoffset(m), firstchar + xoffset(m)
  389.                         PRINT text$(m)
  390.                     END IF
  391.                     IF _MOUSEINPUT = -1 THEN
  392.                         IF _MOUSEX > basex(m) AND _MOUSEX < endx(m) THEN
  393.                             IF _MOUSEY > basey(m) AND _MOUSEY < endy(m) THEN
  394.                                 SELECT CASE defaultstyle(m)
  395.                                     CASE IS = 0
  396.                                         style(m) = 1
  397.                                     CASE IS = 1
  398.                                         style(m) = 0
  399.                                     CASE IS = 2
  400.                                         style(m) = 3
  401.                                     CASE IS = 3
  402.                                         style(m) = 2
  403.                                 END SELECT
  404.                                 IF firstprint(m) = 1 THEN firstprint(m) = 0
  405.                                 IF _MOUSEBUTTON(1) = -1 THEN
  406.                                     SELECT CASE kind$(m)
  407.                                         CASE IS = "confirmation"
  408.                                             endparameter$ = "true"
  409.                                             status$(maxmi) = "finished"
  410.                                         CASE IS = "redirect" 'used for going to another marker, menu or similar
  411.                                             SELECT CASE destination$(m)
  412.                                                 CASE IS = "end menu"
  413.                                                     status$(maxmi) = "finished"
  414.                                             END SELECT
  415.                                             IF MID$(destination$(m), LEN(destination$(m)), 1) = ":" THEN 'if destination$ has : at the end, it will end the menu because it interprets it as going to another place
  416.                                                 status$(maxmi) = "finished"
  417.                                                 endparameter$ = destination$(m)
  418.                                             END IF
  419.                                     END SELECT
  420.                                 END IF
  421.                             ELSE
  422.                                 IF defaultstyle(m) <> style(m) THEN style(m) = defaultstyle(m): firstprint(m) = 0
  423.                             END IF
  424.                         ELSE
  425.                             IF defaultstyle(m) <> style(m) THEN style(m) = defaultstyle(m): firstprint(m) = 0
  426.                         END IF
  427.                     END IF
  428.                 CASE IS = "slider"
  429.                     checkm = 0
  430.                     DO
  431.                         checkm = checkm + 1
  432.                         IF overlaptrigger(checkm) = 1 AND checkm < m THEN
  433.                             overlaptrigger(checkm) = 0
  434.                             firstprint(m) = 0
  435.                         END IF
  436.                     LOOP UNTIL checkm = maxm
  437.                     IF firstprint(m) = 0 THEN
  438.                         firstprint(m) = 1
  439.                         LOCATE firstline + yoffset(m), firstchar + xoffset(m)
  440.                         COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  441.                         PRINT text$(m)
  442.                         'horizontal
  443.                         LINE (basex(m), (firstline + yoffset(m) - 1) * fontheight + (fontheight / 2))-(basex(m) + (maxx / 4), (firstline + yoffset(m) - 1) * fontheight + (fontheight / 2) + 1), _RGBA(r(2), g(2), b(2), a(2)), BF
  444.                         'vertical
  445.                         LINE (basex(m) + (value(m) / maxval(m) * (maxx / 4)), (firstline + yoffset(m) - 1) * fontheight + 1)-(basex(m) + 4 + (value(m) / maxval(m) * (maxx / 4)), (firstline + yoffset(m)) * fontheight - 1), _RGBA(r(2), g(2), b(2), a(2)), BF
  446.                         xvalue = firstchar + xoffset(m) + LEN(text$(m)) + ((maxx / 4) / fontwidth) + 2
  447.                         LOCATE firstline + yoffset(m), xvalue
  448.                         PRINT value(m); "   "
  449.                     END IF
  450.                     IF _MOUSEINPUT = -1 THEN
  451.                         IF _MOUSEBUTTON(1) = -1 THEN
  452.                             IF _MOUSEY > (firstline + yoffset(m) - 1) * fontheight + 1 AND _MOUSEY < (firstline + yoffset(m)) * fontheight - 1 THEN
  453.                                 DO
  454.                                     IF _MOUSEINPUT = -1 AND _MOUSEX > basex(m) AND _MOUSEX < endx(m) THEN
  455.                                         value(m) = _MOUSEX - (basex(m))
  456.                                         value(m) = INT(value(m) / (maxx / 4) * 100)
  457.                                         printslider:
  458.                                         'cleanup
  459.                                         LINE (basex(m), (firstline + yoffset(m) - 1) * fontheight + 1)-(endx(m), (firstline + yoffset(m)) * fontheight - 1), _RGBA(r(1), g(1), b(1), a(1)), BF
  460.  
  461.                                         'horizontal
  462.                                         LINE (basex(m), (firstline + yoffset(m) - 1) * fontheight + (fontheight / 2))-(endx(m), (firstline + yoffset(m) - 1) * fontheight + (fontheight / 2) + 1), _RGBA(r(2), g(2), b(2), a(2)), BF
  463.                                         'vertical
  464.                                         LINE (basex(m) + (value(m) / maxval(m) * (maxx / 4)), (firstline + yoffset(m) - 1) * fontheight + 1)-(basex(m) + 4 + (value(m) / maxval(m) * (maxx / 4)), (firstline + yoffset(m)) * fontheight - 1), _RGBA(r(2), g(2), b(2), a(2)), BF
  465.                                         xvalue = firstchar + xoffset(m) + LEN(text$(m)) + ((maxx / 4) / fontwidth) + 2
  466.                                         LOCATE firstline + yoffset(m), xvalue
  467.                                         COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  468.                                         PRINT value(m); "   "
  469.                                     ELSEIF _MOUSEINPUT = -1 AND _MOUSEX < basex(m) OR _MOUSEX > basex(m) + 4 + (maxx / 4) THEN
  470.                                         IF _MOUSEX < basex(m) THEN
  471.                                             value(m) = minval(m)
  472.                                         ELSE
  473.                                             value(m) = maxval(m)
  474.                                         END IF
  475.                                         GOTO printslider
  476.                                     END IF
  477.                                 LOOP UNTIL _MOUSEBUTTON(1) = 0
  478.                             END IF
  479.                         END IF
  480.                     END IF
  481.                 CASE IS = "selector" 'simpler and in-line version of dropdown
  482.                     IF _MOUSEINPUT = -1 THEN
  483.                         IF _MOUSEBUTTON(1) = -1 THEN
  484.                             IF _MOUSEX > (firstchar + xoffset(m)) * fontwidth + (fontwidth / 2) AND _MOUSEX < (firstchar + xoffset(m) + LEN(text$(m)) + LEN(arraydata$(m, selected(m))) + 5) * fontwidth + (fontwidth / 2) THEN
  485.                                 IF _MOUSEY > (firstline + yoffset(m) - 1) * fontheight AND _MOUSEY < (firstline + yoffset(m)) * fontheight THEN
  486.                                     checkm = 0: dontgoactive = 0
  487.                                     DO
  488.                                         checkm = checkm + 1
  489.                                         IF expanded(checkm) = 1 THEN dontgoactive = 1 ELSE dontgoactive = 0
  490.                                     LOOP UNTIL checkm = maxm
  491.                                     IF dontgoactive = 0 THEN activem = m
  492.                                 END IF
  493.                             END IF
  494.                         END IF
  495.                     END IF
  496.                     'shows non-editable text
  497.                     COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  498.                     LOCATE firstline + yoffset(m), firstchar + xoffset(m)
  499.                     PRINT text$(m);
  500.  
  501.                     'shows editable text
  502.                     IF activem <> m THEN
  503.                         COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  504.                     ELSE
  505.                         COLOR _RGBA(r(4), g(4), b(4), a(4)), _RGBA(r(1), g(1), b(1), a(1))
  506.                     END IF
  507.                     PRINT " < ";
  508.                     PRINT arraydata$(m, selected(m));
  509.                     PRINT " >   "
  510.                 CASE IS = "dropdown"
  511.                     IF activem = m THEN 'only enables keys if dropdown menu is active
  512.                         SELECT CASE Taste$
  513.                             CASE IS = CHR$(9)
  514.                                 IF expanded(m) = 1 THEN
  515.                                     expanded(m) = 0
  516.                                     overlaptrigger(m) = 1
  517.                                     GOTO reprint
  518.                                 ELSE
  519.                                     expanded(m) = 1
  520.                                     GOTO reprint
  521.                                 END IF
  522.                             CASE IS = CHR$(0) + CHR$(77) 'arrow right
  523.                                 IF selected(m) > 1 THEN
  524.                                     selected(m) = selected(m) - 1
  525.                                 ELSE
  526.                                     selected(m) = maxad(m)
  527.                                 END IF
  528.                                 GOTO reprint
  529.                             CASE IS = CHR$(0) + CHR$(75) 'arrow left
  530.                                 IF selected(m) < maxad(m) THEN
  531.                                     selected(m) = selected(m) + 1
  532.                                 ELSE
  533.                                     selected(m) = 1
  534.                                 END IF
  535.                                 GOTO reprint
  536.                         END SELECT
  537.                     END IF
  538.                     IF firstprint(m) = 0 THEN 'only prints menu once and sets variables, loads menu etc..
  539.                         firstprint(m) = 1
  540.                         ad = 0
  541.                         DO
  542.                             ad = ad + 1
  543.                             IF maxadlength(m) < LEN(arraydata$(m, ad)) THEN maxadlength(m) = LEN(arraydata$(m, ad))
  544.                         LOOP UNTIL ad = maxad(m)
  545.                         endx(m) = (firstchar + xoffset(m) + LEN(text$(m)) + maxadlength(m) + 3) * fontwidth + (fontwidth / 2) + borderoffsetx(m) 'right end of dropdown box
  546.                         selected(m) = 1
  547.  
  548.                         reprint: 'triggered when a change occurs
  549.                         'prints text in front of dropdown
  550.                         LOCATE firstline + yoffset(m), firstchar + xoffset(m)
  551.                         COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  552.                         PRINT text$(m)
  553.  
  554.                         'activem = m
  555.                         IF expanded(m) = 0 THEN
  556.                             LINE (basex(m), (firstline + yoffset(m) - 1) * fontheight - (fontheight / 3) + borderoffsety(m))-(endx(m), (firstline + yoffset(m)) * fontheight + (fontheight / 2) + borderoffsety(m)), _RGBA(r(1), g(1), b(1), a(1)), BF
  557.                             LINE (basex(m), (firstline + yoffset(m) - 1) * fontheight - (fontheight / 3) + borderoffsety(m))-(endx(m), (firstline + yoffset(m)) * fontheight + (fontheight / 2) + borderoffsety(m)), _RGBA(r(2), g(2), b(2), a(2)), B
  558.                             IF activem <> m THEN
  559.                                 COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  560.                             ELSE
  561.                                 COLOR _RGBA(r(4), g(4), b(4), a(4)), _RGBA(r(1), g(1), b(1), a(1))
  562.                             END IF
  563.                             LOCATE firstline + yoffset(m), firstchar + xoffset(m) + LEN(text$(m)) + 2
  564.                             PRINT arraydata$(m, selected(m))
  565.                         ELSE
  566.                             LINE (basex(m), (firstline + yoffset(m) - 1) * fontheight - (fontheight / 3) + borderoffsety(m))-(endx(m), (firstline + yoffset(m) + (maxad(m) * 2) - 1) * fontheight + (fontheight / 2) + borderoffsety(m)), _RGBA(r(1), g(1), b(1), a(1)), BF
  567.                             ad = 0
  568.                             DO
  569.                                 ad = ad + 1
  570.                                 IF ad = selected(m) THEN
  571.                                     COLOR _RGBA(r(1), g(1), b(1), a(1)), _RGBA(r(4), g(4), b(4), a(4))
  572.                                 ELSE
  573.                                     COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  574.                                 END IF
  575.                                 LOCATE firstline + yoffset(m) + (ad * 2) - 2, firstchar + xoffset(m) + LEN(text$(m)) + 2
  576.                                 PRINT arraydata$(m, ad)
  577.                             LOOP UNTIL ad = maxad(m)
  578.                             LINE (basex(m), (firstline + yoffset(m) - 1) * fontheight - (fontheight / 3) + borderoffsety(m))-(endx(m), (firstline + yoffset(m) + (maxad(m) * 2) - 1) * fontheight + (fontheight / 2) + borderoffsety(m)), _RGBA(r(2), g(2), b(2), a(2)), B
  579.                         END IF
  580.  
  581.                         'variables for dropdown triangle (right side, you know?)
  582.                         p1x(m) = (firstchar + xoffset(m) + LEN(text$(m)) + maxadlength(m) + 2) * fontwidth
  583.                         p1y(m) = (firstline + yoffset(m) - 1) * fontheight + (fontheight / 3) + borderoffsety - 3
  584.                         p2x(m) = p1x(m) + fontwidth
  585.                         p2y(m) = p1y(m)
  586.                         p3x(m) = p1x(m) + ((p2x(m) - p1x(m)) / 2)
  587.                         p3y(m) = p1y(m) + SQR(((fontwidth / 2) * (fontwidth / 2)) + (fontwidth * fontwidth)) - (fontheight / 4)
  588.  
  589.                         'triangle
  590.                         LINE (p1x(m), p1y(m))-(p2x(m), p2y(m)), _RGBA(r(2), g(2), b(2), a(2))
  591.                         LINE (p1x(m), p1y(m))-(p3x(m), p3y(m)), _RGBA(r(2), g(2), b(2), a(2))
  592.                         LINE (p2x(m), p2y(m))-(p3x(m), p3y(m)), _RGBA(r(2), g(2), b(2), a(2))
  593.                         PAINT (p1x(m) + ((p2x(m) - p1x(m)) / 2), p1y(m) + ((p3y(m) - p1y(m)) / 2)), _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(2), g(2), b(2), a(2))
  594.                     END IF
  595.                     IF _MOUSEINPUT = -1 THEN
  596.                         selline = INT(_MOUSEY / (fontheight)) + 1
  597.                         IF selline > (firstline + yoffset(m) - 1) AND selline < (firstline + yoffset(m) + (maxad(m) * 2) - 1) THEN
  598.                             mouseselected = INT((selline - (firstline + yoffset(m) - 1)) / 2) + 1
  599.                             IF mouseselected <> selected(m) AND expanded(m) = 1 THEN
  600.                                 selected(m) = mouseselected
  601.                                 GOTO reprint
  602.                             END IF
  603.                         END IF
  604.                         IF _MOUSEBUTTON(1) = -1 AND mouseclicked = 0 THEN
  605.                             IF _MOUSEX > basex(m) AND _MOUSEX < endx(m) THEN
  606.                                 mouseclicked = 1
  607.                                 IF expanded(m) = 1 THEN
  608.                                     endy(m) = (firstline + yoffset(m) + maxad(m)) * fontheight + (fontheight / 3) + borderoffsety(m)
  609.                                     IF _MOUSEY > basey(m) AND _MOUSEY < endy(m) THEN
  610.                                         expanded(m) = 0
  611.                                         LINE (basex(m), (firstline + yoffset(m) - 1) * fontheight - (fontheight / 3) + borderoffsety(m))-(endx(m), (firstline + yoffset(m) + (maxad(m) * 2) - 1) * fontheight + (fontheight / 2) + borderoffsety(m)), _RGBA(r(1), g(1), b(1), a(1)), BF
  612.                                         overlaptrigger(m) = 1
  613.                                         GOTO reprint
  614.                                     END IF
  615.                                 ELSE
  616.                                     endy(m) = (firstline + yoffset(m)) * fontheight + (fontheight / 3) + borderoffsety(m)
  617.                                     IF _MOUSEY > basey(m) AND _MOUSEY < endy(m) THEN
  618.                                         expanded(m) = 1
  619.                                         GOTO reprint
  620.                                     END IF
  621.                                 END IF
  622.                             END IF
  623.                         ELSE
  624.                             mouseclicked = 0
  625.                         END IF
  626.                     END IF
  627.                 CASE IS = "input"
  628.                     checkm = 0
  629.                     DO
  630.                         checkm = checkm + 1
  631.                         IF overlaptrigger(checkm) = 1 AND checkm < m THEN
  632.                             overlaptrigger(checkm) = 0
  633.                             firstprint(m) = 0
  634.                             selectedall = 0
  635.                         END IF
  636.                     LOOP UNTIL checkm = maxm
  637.                     COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  638.                     IF firstprint(m) = 0 THEN
  639.                         firstprint(m) = 1
  640.                         IF fill$(m) <> "" AND c(m) = 0 THEN
  641.                             DO
  642.                                 c(m) = c(m) + 1
  643.                                 char$(m, c(m)) = MID$(fill$(m), c(m), 1)
  644.                             LOOP UNTIL c(m) = LEN(fill$(m))
  645.                             cbf(m) = c(m)
  646.                             LOCATE firstline + yoffset(m), firstchar + xoffset(m)
  647.                             PRINT text$(m) + " ";
  648.                             IF selectedall = 0 THEN
  649.                                 COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  650.                             ELSE
  651.                                 COLOR _RGBA(r(1), g(1), b(1), a(1)), _RGBA(r(2), g(2), b(2), a(2))
  652.                             END IF
  653.                             PRINT fill$(m);
  654.                         END IF
  655.                         printback:
  656.                         IF backspace(m) = 1 AND c(m) > 0 AND selectedall = 0 THEN
  657.                             IF TIMER MOD 2 = 0 THEN LINE ((firstchar + xoffset(m) + LEN(text$(m)) + editpos(m)) * fontwidth + (fontwidth / 2), (firstline + yoffset(m) - 1) * fontheight + 1)-((firstchar + xoffset(m) + LEN(text$(m)) + editpos(m)) * fontwidth + (fontwidth / 2) + 2, (firstline + yoffset(m)) * fontheight - 1), _RGBA(r(1), g(1), b(1), a(1)), BF
  658.                             backspace(m) = 0
  659.                             COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  660.                             LOCATE firstline + yoffset(m), firstchar + xoffset(m)
  661.                             PRINT text$(m) + " ";
  662.                             cbf(m) = 0
  663.                             trigger(m) = 0
  664.                             DO
  665.                                 cbf(m) = cbf(m) + 1
  666.                                 IF cbf(m) <> editpos(m) THEN
  667.                                     IF trigger(m) = 1 THEN
  668.                                         char$(m, cbf(m)) = char$(m, cbf(m) + 1)
  669.                                     END IF
  670.                                     PRINT char$(m, cbf(m));
  671.                                 ELSE
  672.                                     char$(m, cbf(m)) = char$(m, cbf(m) + 1)
  673.                                     PRINT char$(m, cbf(m));
  674.                                     trigger(m) = 1
  675.                                 END IF
  676.                             LOOP UNTIL cbf(m) >= c(m) - 1
  677.                             PRINT "  "
  678.                             char$(m, c(m)) = ""
  679.                             c(m) = c(m) - 1
  680.                         ELSEIF backspace(m) = 1 AND c(m) > 0 AND selectedall = 1 THEN
  681.                             IF TIMER MOD 2 = 0 THEN LINE ((firstchar + xoffset(m) + LEN(text$(m)) + editpos(m)) * fontwidth + (fontwidth / 2), (firstline + yoffset(m) - 1) * fontheight + 1)-((firstchar + xoffset(m) + LEN(text$(m)) + editpos(m)) * fontwidth + (fontwidth / 2) + 2, (firstline + yoffset(m)) * fontheight - 1), _RGBA(r(1), g(1), b(1), a(1)), BF
  682.                             backspace(m) = 0
  683.                             COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  684.                             LOCATE firstline + yoffset(m), firstchar + xoffset(m)
  685.                             PRINT text$(m) + " ";
  686.                             selectedall = 0
  687.                             cbf(m) = 0
  688.                             DO
  689.                                 cbf(m) = cbf(m) + 1
  690.                                 char$(m, cbf(m)) = "" ' clears text array
  691.                                 PRINT " ";
  692.                             LOOP UNTIL cbf(m) = c(m)
  693.                             cbf(m) = c(m)
  694.                             c(m) = 0
  695.                             IF fill$(m) <> "" THEN
  696.                                 DO
  697.                                     c(m) = c(m) + 1
  698.                                     char$(m, c(m)) = MID$(fill$(m), c(m), 1)
  699.                                 LOOP UNTIL c(m) = LEN(fill$(m))
  700.                                 cbf(m) = c(m)
  701.                                 PRINT fill$(m);
  702.                             END IF
  703.                         ELSE
  704.                             LOCATE firstline + yoffset(m), firstchar + xoffset(m)
  705.                             COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  706.                             PRINT text$(m) + " ";
  707.                             IF c(m) > 0 THEN
  708.                                 cbf(m) = 0
  709.                                 DO
  710.                                     cbf(m) = cbf(m) + 1
  711.                                     PRINT char$(m, cbf(m));
  712.                                 LOOP UNTIL cbf(m) = c(m)
  713.                             END IF
  714.                         END IF
  715.                         Taste$ = ""
  716.                     END IF
  717.                     IF activem = m THEN 'only checks keys if input is active
  718.                         loopback:
  719.                         IF Taste$ <> "" THEN
  720.                             ac = 0
  721.                             DO
  722.                                 ac = ac + 1
  723.                                 IF ac$(ac) = Taste$ THEN
  724.                                     c(m) = c(m) + 1
  725.                                     char$(m, c(m)) = Taste$
  726.                                 END IF
  727.                             LOOP UNTIL ac = alch
  728.                         END IF
  729.                         editpos(m) = c(m)
  730.  
  731.                         'prints the new character if g has changed
  732.                         IF cbf(m) <> c(m) OR selectedall <> colorbf THEN
  733.                             IF cbf(m) < c(m) OR selectedall <> colorbf THEN
  734.                                 LOCATE firstline + yoffset(m), firstchar + xoffset(m)
  735.                                 COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  736.                                 PRINT text$(m);
  737.                                 IF selectedall = 0 THEN
  738.                                     COLOR _RGBA(r(2), g(2), b(2), a(2)), _RGBA(r(1), g(1), b(1), a(1))
  739.                                 ELSE
  740.                                     COLOR _RGBA(r(1), g(1), b(1), a(1)), _RGBA(r(2), g(2), b(2), a(2))
  741.                                 END IF
  742.                                 IF c(m) > 0 THEN
  743.                                     cbf(m) = 0
  744.                                     DO
  745.                                         cbf(m) = cbf(m) + 1
  746.                                         PRINT char$(m, cbf(m));
  747.                                     LOOP UNTIL cbf(m) = c(m)
  748.                                 END IF
  749.                             END IF
  750.                         END IF
  751.                         cbf(m) = c(m)
  752.  
  753.                         'blinking line after text
  754.                         IF TIMER MOD 2 = 0 THEN
  755.                             LINE ((firstchar + xoffset(m) + LEN(text$(m)) + editpos(m)) * fontwidth + (fontwidth / 2), (firstline + yoffset(m) - 1) * fontheight + 1)-((firstchar + xoffset(m) + LEN(text$(m)) + editpos(m)) * fontwidth + (fontwidth / 2) + 2, (firstline + yoffset(m)) * fontheight - 1), _RGBA(r(2), g(2), b(2), a(2)), BF
  756.                         ELSE
  757.                             LINE ((firstchar + xoffset(m) + LEN(text$(m)) + editpos(m)) * fontwidth + (fontwidth / 2), (firstline + yoffset(m) - 1) * fontheight + 1)-((firstchar + xoffset(m) + LEN(text$(m)) + editpos(m)) * fontwidth + (fontwidth / 2) + 2, (firstline + yoffset(m)) * fontheight - 1), _RGBA(r(1), g(1), b(1), a(1)), BF
  758.                         END IF
  759.  
  760.                         'key cases
  761.                         SELECT CASE Taste$
  762.                             CASE IS = CHR$(8)
  763.                                 backspace(m) = 1
  764.                                 GOTO printback
  765.                             CASE IS = CHR$(3) 'ctrl + c input data
  766.                                 _CLIPBOARD$ = ""
  767.                                 p = 0
  768.                                 DO
  769.                                     p = p + 1
  770.                                     _CLIPBOARD$ = _CLIPBOARD$ + char$(m, p)
  771.                                 LOOP UNTIL p = c(m)
  772.                             CASE IS = CHR$(22) 'ctrl + v into active input
  773.                                 IF _CLIPBOARD$ <> "" THEN
  774.                                     p = 0
  775.                                     DO
  776.                                         p = p + 1
  777.                                         c(m) = c(m) + 1
  778.                                         char$(m, c(m)) = MID$(_CLIPBOARD$, p, 1)
  779.                                     LOOP UNTIL p = LEN(_CLIPBOARD$)
  780.                                 END IF
  781.                             CASE IS = CHR$(0) + CHR$(75)
  782.                                 IF editpos(m) > 1 THEN
  783.                                     editpos(m) = editpos(m) - 1
  784.                                 END IF
  785.                             CASE IS = CHR$(0) + CHR$(77)
  786.                                 IF editpos(m) < c(m) THEN
  787.                                     editpos(m) = editpos(m) + 1
  788.                                 END IF
  789.                             CASE IS = CHR$(13)
  790.                                 IF activem = maxm THEN
  791.                                     status$(activem) = "finished"
  792.                                 ELSE
  793.                                     activem = activem + 1
  794.                                 END IF
  795.                             CASE IS = CHR$(0) + CHR$(59)
  796.                                 colorbf = selectedall
  797.                                 IF selectedall = 1 THEN
  798.                                     selectedall = 0
  799.                                 ELSE
  800.                                     selectedall = 1
  801.                                 END IF
  802.                                 firstprint(m) = 1
  803.                         END SELECT
  804.                     ELSE
  805.                         IF _MOUSEINPUT = -1 THEN
  806.                             IF _MOUSEBUTTON(1) = -1 THEN
  807.                                 IF _MOUSEX > (firstchar + xoffset(m)) * fontwidth + (fontwidth / 2) AND _MOUSEX < (firstchar + xoffset(m) + LEN(text$(m)) + c(m)) * fontwidth + (fontwidth / 2) THEN
  808.                                     IF _MOUSEY > (firstline + yoffset(m) - 1) * fontheight + 1 AND _MOUSEY < (firstline + yoffset(m)) * fontheight - 1 THEN
  809.                                         checkm = 0: dontgoactive = 0
  810.                                         DO
  811.                                             checkm = checkm + 1
  812.                                             IF expanded(checkm) = 1 THEN dontgoactive = 1 ELSE dontgoactive = 0
  813.                                         LOOP UNTIL checkm = maxm
  814.                                         IF dontgoactive = 0 THEN activem = m
  815.                                     END IF
  816.                                 END IF
  817.                             END IF
  818.                             'deletes blinking line after text
  819.                             editpos(m) = c(m)
  820.                             IF TIMER MOD 2 = 0 THEN LINE ((firstchar + xoffset(m) + LEN(text$(m)) + editpos(m)) * fontwidth + (fontwidth / 2), (firstline + yoffset(m) - 1) * fontheight + 1)-((firstchar + xoffset(m) + LEN(text$(m)) + editpos(m)) * fontwidth + (fontwidth / 2) + 2, (firstline + yoffset(m)) * fontheight - 1), _RGBA(r(1), g(1), b(1), a(1)), BF
  821.  
  822.                         END IF
  823.                     END IF
  824.             END SELECT
  825.         LOOP UNTIL m = maxm
  826.     LOOP UNTIL status$(maxmi) = "finished" OR maxmi = 0 OR Taste$ = CHR$(27)
  827.     IF Taste$ = CHR$(27) THEN endparameter$ = "aborted"
  828.     ERASE status$
  829.     m = 0
  830.     DO
  831.         m = m + 1
  832.         SELECT CASE type$(m)
  833.             CASE IS = "input"
  834.                 IF c(m) > 0 THEN
  835.                     maxg(m) = c(m)
  836.                     c(m) = 0
  837.                     DO
  838.                         c(m) = c(m) + 1
  839.                         UserInput$(m) = UserInput$(m) + char$(m, c(m))
  840.                     LOOP UNTIL c(m) = maxg(m)
  841.                     c(m) = 0
  842.                     f = 0
  843.                     DO
  844.                         f = f + 1
  845.                         char$(m, f) = ""
  846.                     LOOP UNTIL char$(m, f + 1) = ""
  847.                 ELSE
  848.                     UserInput$(m) = ""
  849.                 END IF
  850.         END SELECT
  851.     LOOP UNTIL m = maxm

This is what you should see:
d116aa399bc88f8ce97b0878c72a011e-png.jpg
« Last Edit: May 20, 2020, 10:39:09 pm by loudar »
Check out what I do besides coding: http://loudar.myportfolio.com/

Offline Virtusoroca

  • Newbie
  • Posts: 24
    • View Profile
Re: Build yourself a fancy menu!
« Reply #1 on: May 20, 2020, 10:43:59 pm »
Very ellegant and compact. I have plans for that already. <3 How should I mention you on credits?Thanks very much for the effort.

Offline loudar

  • Newbie
  • Posts: 73
  • improve it bit by bit.
    • View Profile
Re: Build yourself a fancy menu!
« Reply #2 on: May 20, 2020, 10:46:20 pm »
Very ellegant and compact. I have plans for that already. <3 How should I mention you on credits?Thanks very much for the effort.
If you're building a bigger program, somewhere in an "Info" menu or something like that, otherwise I'm absolutely fine with a mention in a text regarding the program you're writing :D I appreciate it a lot! <3
Check out what I do besides coding: http://loudar.myportfolio.com/

Offline Virtusoroca

  • Newbie
  • Posts: 24
    • View Profile
Re: Build yourself a fancy menu!
« Reply #3 on: May 20, 2020, 11:28:07 pm »
Deal! Thanks again for sharing this. <3

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Build yourself a fancy menu!
« Reply #4 on: May 21, 2020, 08:48:14 am »
Hey that's pretty cool!
Shuwatch!