RaweTrip
  • Welcome
  • Official Discord
  • Useful information
    • πŸ”ŒFor beginners
    • β™ŸοΈCommon knowledge
    • πŸ“šExamples
      • βš™οΈTab system
      • βš™οΈUI Interaction
      • βš™οΈClantag
      • βš™οΈWireframe smoke
  • documentation
    • ⛓️Common
      • πŸ“žCallbacks list
    • βš™οΈVariables
      • πŸ‘€esp
      • πŸ“œplist
      • πŸ”«weapon
      • ⚑vector
      • 🎨color
      • πŸŽ“cheat
      • πŸ’»ui
      • πŸ™οΈrender
      • πŸšΆβ€β™‚οΈentity
      • 🌎globalvars
      • πŸ› οΈengine
      • πŸ”©utils
      • πŸ–₯️console
      • πŸ”‘base64
      • πŸ“ bit
      • πŸ—ƒοΈfile
      • πŸ“Άhttp
      • βœ‰οΈchat
      • 〽️animate
      • 🧱materials
      • πŸ”§steam
      • ✈️trace
      • πŸ”—interfaces
        • πŸ’‘ieffects
        • 🧬precache
        • πŸ’³model_info
    • πŸ”’Enumerations
      • 🎞️enum_frames
Powered by GitBook
On this page
  1. Useful information
  2. Examples

Tab system

Simple tab system

To do something like this, you can refer to the ui

--> Main table
local example = {}

--> Combobox with tab names
local tabs = ui.add_combobox("tabs", { "first", "second", "third" })

--> First tab
example.first_tab = {}

--> Second tab
example.second_tab = {}

--> Elements in first tab
example.first_tab.checkbox = ui.add_checkbox("Checkbox")
example.first_tab.slider = ui.add_sliderint("Slider", 0, 100)

--> Elements in second tab
example.second_tab.combobox = ui.add_combobox("Combo", { "1", "2", "3" })
example.second_tab.button = ui.add_button("Button")

cheat.push_callback("on_paint", function()
    --> Parsing first tab
    for key, val in pairs(example.first_tab) do
        val:set_visible(tabs:get() == 0 and true or false)
    end

    --> Parsing second tab
    for key, val in pairs(example.second_tab) do
        val:set_visible(tabs:get() == 1 and true or false)
    end
end)
PreviousExamplesNextUI Interaction

Last updated 2 years ago

πŸ“š
βš™οΈ