smd111

display old

Apr 19th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 20.37 KB | None | 0 0
  1. menu.text = {}
  2. menu.text.font = 'Segoe UI Symbol'
  3. menu.text.size = 9
  4. menu.bg = {}
  5. menu.bg.alpha = 200
  6. menu.flags = {}
  7. menu.flags.draggable = true
  8. min_window = {}
  9. min_window.text = {}
  10. min_window.text.font = 'Segoe UI Symbol'
  11. min_window.text.size = 9
  12. min_window.bg = {}
  13. min_window.bg.alpha = 200
  14. min_window.flags = {}
  15. min_window.flags.draggable = false
  16. min_window.pos = {}
  17. min_window.pos.x = 0
  18. min_window.pos.y = 400
  19. auto_hide_cycle = 0
  20. skill_select = {}
  21. skill_select.pos = {}
  22. skill_select.pos.x = (menu.pos.x - 120)
  23. skill_select.pos.y = (menu.pos.y - 209)
  24. skill_select.text = {}
  25. skill_select.text.font = 'Segoe UI Symbol'
  26. skill_select.text.size = 9
  27. skill_select.bg = {}
  28. skill_select.bg.alpha = 200
  29. skill_select.flags = {}
  30. skill_select.flags.draggable = false
  31. skillwatch = false
  32. lvlwatch = false
  33. --display functions---------------------------------------------------------------------------------------------------------------
  34. --Display Creator
  35. if not tswap then
  36.     tswap = false
  37. end
  38. if not debugmod then
  39.     debugmod = false
  40. end
  41. menu_set = 1
  42. window = texts.new(menu)
  43. button = texts.new(min_window)
  44. function initialize(text, settings, a)
  45.     if a == 'window' then
  46.         local properties = L{}
  47.         properties:append('${listm}')
  48.         properties:append('Gearswap   \\cs(255,255,0)HIDE\\cr')
  49.         if menu_set == 1 then -- job menu
  50.             properties:append('--Job Settings--')
  51.             if (windower.ffxi.get_player().main_job == 'DNC' and MJi) or (windower.ffxi.get_player().sub_job == 'DNC' and SJi) then
  52.                 properties:append('-Steps-')
  53.                 properties:append('   Max Step = ${stepm}')
  54.                 properties:append('   Stop Steps   ${ssteps}')
  55.             end
  56.             if lvlwatch then
  57.                 properties:append('${mjob}cr')
  58.                 properties:append('   lvl = ${mjob_lvl}')
  59.             end
  60.             if skillwatch and Registered_Events then
  61.                 properties:append('${skill}')
  62.                 properties:append('   lvl = ${skill_lvl}')
  63.             end
  64.         elseif menu_set == 2 then -- armor menu
  65.             properties:append('--Armor Settings--')
  66.             properties:append('Mode = \\cs(255,255,0)${amode}\\cr')
  67.             if table.contains(jobs.magic, player.main_job) and WSi then
  68.                 properties:append('-Mage Staves-')
  69.                 properties:append('   Auto Change   ${cstaff}')
  70.                 properties:append('   Type \\cs(255,255,0)${ustaff}\\cr')
  71.             end
  72.             if Conquest_Gear then
  73.                 properties:append('-Conquest Gear-')
  74.                 properties:append('  Change Neck   ${cneckc}')
  75.                 properties:append('  Neck Type = \\cs(255,255,0)${cneck}\\cr')
  76.                 properties:append('  Change Ring   ${cringc}')
  77.                 properties:append('  Ring Type = \\cs(255,255,0)${cring}\\cr')
  78.             end
  79.         elseif menu_set == 3 then -- system menu
  80.             properties:append('--System Settings--')
  81.             if autolock and Registered_Events then
  82.                 properties:append('Auto Lock')
  83.                 properties:append('  \\cs(255,255,0)Enabled\\cr')
  84.             end
  85.             if autotarget then
  86.                 properties:append('Auto Self Target')
  87.                 properties:append('After Battle \\cs(255,255,0)Enabled\\cr')
  88.             end
  89.             if stoponskillcap and Registered_Events then
  90.                 properties:append('Auto Stop On')
  91.                 properties:append('  \\cs(255,255,0)'..string.gsub(stopskilltyp[stopskill_count], "_", " ")..'\\cr Cap')
  92.                 if lvl then
  93.                     properties:append('Current Skill')
  94.                     properties:append('  Level = \\cs(255,255,0)'..lvl[stopskilltyp[stopskill_count]]..'\\cr')
  95.                 end
  96.             end
  97.             properties:append('Display Main Job')
  98.             properties:append('and LVL   ${tmjl}')
  99.             properties:append('Show Current ')
  100.             properties:append('Skill Level   ${tskill}')
  101.             properties:append('Show Swaps   ${tswap}')
  102.             properties:append('Debug Mode   ${debugm}')
  103.             if File_Write then
  104.                 properties:append('Force File Write')
  105.             end
  106.             properties:append('Gearswap Export')
  107.             properties:append('Reload Gearswap')
  108.         elseif menu_set == 4 then -- include menu
  109.             properties:append('--Include Settings--')
  110.             properties:append('Ammo   ${tammo}')
  111.             properties:append('Conquest Gear   ${tcgi}')
  112.             properties:append('Debug   ${tdebug}')
  113.             properties:append('File Write   ${tfwi}')
  114.             properties:append('Main Job   ${tmji}')
  115.             properties:append('Mage Stave   ${tmsi}')
  116.             properties:append('Registered Events   ${trei}')
  117.             properties:append('Special Weapons   ${tswi}')
  118.             properties:append('Sub Job   ${tsji}')
  119.             properties:append('Weapon Skill   ${twsi}')
  120.         elseif menu_set == 5 then --custom menu
  121.             properties:append('Custom Menu')
  122.             for i,v in pairs(custom_menu()) do
  123.                 if type(v) == 'string' then
  124.                     properties:append(v)
  125.                 end
  126.             end
  127.         end
  128.         text:clear()
  129.         text:append(properties:concat('\n'))
  130.         grab_switches(properties)
  131.     end
  132.     if a == 'button' then
  133.         local properties_button = L{}
  134.         if lvlwatch then
  135.             properties_button:append('${mjob}   lvl = ${mjob_lvl}')
  136.         end
  137.         if skillwatch and Registered_Events then
  138.             properties_button:append('${skill}   lvl = ${skill_lvl}')
  139.         end
  140.         if not skillwatch and not lvlwatch then
  141.             properties_button:append('\n > \n ')
  142.         end
  143.         text:clear()
  144.         text:append(properties_button:concat('\n'))
  145.     end
  146.     if a == 'skill_select_window' then
  147.         local properties = L{}
  148.         properties:append('Select Skill')
  149.         properties:append('${ax|Axe}')
  150.         properties:append('${cl|Club}')
  151.         properties:append('${dg|Dagger}')
  152.         properties:append('${ga|Great Axe}')
  153.         properties:append('${gk|Great Katana}')
  154.         properties:append('${gs|Great Sword}')
  155.         properties:append('${hh|Hand-to-Hand}')
  156.         properties:append('${kt|Katana}')
  157.         properties:append('${pl|Polearm}')
  158.         properties:append('${sc|Scythe}')
  159.         properties:append('${st|Staff}')
  160.         properties:append('${sw|Sword}')
  161.         properties:append('${ar|Archery}')
  162.         properties:append('${mk|Marksmanship}')
  163.         properties:append('${th|Throwing}')
  164.         properties:append('${ev|Evasion}')
  165.         properties:append('${gr|Guard}')
  166.         properties:append('${pa|Parrying}')
  167.         properties:append('${sh|Shield}')
  168.         properties:append('${bm|Blue Magic}')
  169.         properties:append('${dm|Dark Magic}')
  170.         properties:append('${dvm|Divine Magic}')
  171.         properties:append('${em|Elemental Magic}')
  172.         properties:append('${efm|Enfeebling Magic}')
  173.         properties:append('${ehm|Enhancing Magic}')
  174.         properties:append('${go|Geomancy}')
  175.         properties:append('${hb|Handbell}')
  176.         properties:append('${hm|Healing Magic}')
  177.         properties:append('${nin|Ninjutsu}')
  178.         properties:append('${so|Singing}')
  179.         properties:append('${sti|Stringed Instrument}')
  180.         properties:append('${smm|Summoning Magic}')
  181.         properties:append('${wi|Wind Instrument}')
  182.         properties:append('${aa|Automaton Archery}')
  183.         properties:append('${amg|Automaton Magic}')
  184.         properties:append('${am|Automaton Melee}')
  185.         text:clear()
  186.         text:append(properties:concat('\n'))
  187.         my_table_skill = properties
  188.         for i,v in pairs(my_table_skill) do
  189.             for w in string.gmatch (v, '%a+%d') do
  190.                 if type(my_table_skill[i]) ~= 'table' then
  191.                     my_table_skill[i] = T{}
  192.                 end
  193.                 my_table_skill[i]:append(w)
  194.             end
  195.         end
  196.     end
  197. end
  198. function grab_switches(a)
  199.     my_table = a
  200.     for i,v in pairs(my_table) do
  201.         for w in string.gmatch (v, '{.-}') do
  202.             if type(my_table[i]) ~= 'table' then
  203.                 my_table[i] = T{}
  204.             end
  205.             my_table[i]:append(w)
  206.         end
  207.     end
  208. end
  209. initialize(window, menu, 'window')
  210. initialize(button, min_window, 'button')
  211. --Display Updater
  212. function update_display()
  213.     windower.prim.create('window_button')
  214.     windower.prim.set_color('window_button', 200, 255, 255, 255)
  215.     windower.prim.set_visibility('window_button', false)
  216.     updatedisplay()
  217. end
  218. function updatedisplay()
  219.     local menu_list ={'[J]  A  S1  S2  C','J  [A]  S1  S2  C','J  A  [S1]  S2  C','J  A  S1  [S2]  C','J  A  S1  S2  [C]'}
  220.     initialize(window, menu, 'window')
  221.     initialize(button, min_window, 'button')
  222.     local info = {}
  223.     if SJi then
  224.         info.stepm = Stepmax
  225.         info.ssteps = Stopsteps and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  226.     end
  227.     if WSi then
  228.         info.cstaff = Changestaff and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  229.         info.ustaff = Usestaff
  230.     end
  231.     if Conquest_Gear then
  232.         info.cneckc = Conquest.neck.change and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  233.         info.cringc = Conquest.ring.change and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  234.         info.cneck = Conquest.neck.case[Conquest.neck.case_id]
  235.         info.cring = Conquest.ring.case[Conquest.ring.case_id]
  236.     end
  237.     info.mjob = windower.ffxi.get_player().main_job_full
  238.     info.mjob_lvl = windower.ffxi.get_player().main_job_level
  239.     info.amode = gear_mode[gear_mode_count]
  240.     if menu_set == 5 then
  241.         info = custom_rules()
  242.     end
  243.     info.listm = menu_list[menu_set]
  244.     info.tmji = MJi and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  245.     info.tsji = SJi and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  246.     info.tmsi = MSi and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  247.     info.twsi = WSi and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  248.     info.tammo = Ammo and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  249.     info.tfwi = File_Write and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  250.     info.tswi = Special_Weapons and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  251.     info.tcgi = Conquest_Gear and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  252.     info.trei = Registered_Events and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  253.     info.tdebug = Debug and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  254.     info.tmjl = lvlwatch and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  255.     info.skill = skill_type[skill_count]
  256.     info.skill_lvl = (skill[skill_type[skill_count]..' Capped'] and "Capped" or skill[skill_type[skill_count]..' Level'])
  257.     info.tskill = skillwatch and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  258.     info.tswap = tswap and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  259.     info.debugm = debugmod and '\\cs(0,255,0)☑\\cr' or '\\cs(255,255,0)☐\\cr'
  260.     window:update(info)
  261.     button:update(info)
  262.     if not window_hidden then
  263.         window:show()
  264.     else
  265.         button:show()
  266.     end
  267. end
  268. function mouse(mtype, x, y, delta, blocked)
  269.     local hide_button = {'{mjob}','{mjob_lvl}','{skill_lvl}'}
  270.     local mx, my = windower.text.get_extents(window._name)
  271.     local button_lines = window:text():count('\n') + 1
  272.     local hx = (x - menu.pos.x)
  273.     local hy = (y - menu.pos.y)
  274.     local bmx, bmy = windower.text.get_extents(button._name)
  275.     if skillwatch and skill_select_window:hover(x, y) then
  276.         mx, my = windower.text.get_extents(skill_select_window._name)
  277.         button_lines = skill_select_window:text():count('\n') + 1
  278.         hx = (x - skill_select.pos.x)
  279.         hy = (y - skill_select.pos.y)
  280.     end
  281.     local first_pos = 99
  282.     local last_pos = 0
  283.     local location = {}
  284.     location.offset = my / button_lines
  285.     location[1] = {}
  286.     location[1].ya = 1
  287.     location[1].yb = location.offset
  288.     local count = 2
  289.     while count  <= button_lines do
  290.          location[count] = {}
  291.          location[count].ya = location[count - 1].yb
  292.          location[count].yb = location[count - 1].yb + location.offset
  293.          count = count + 1
  294.     end
  295.     if (window:hover(x, y) and window:visible()) or (button:hover(x, y) and button:visible()) or (skillwatch and skill_select_window:hover(x, y) and skill_select_window:visible()) then
  296.         windower.prim.set_visibility('window_button', true)
  297.     else
  298.         windower.prim.set_visibility('window_button', false)
  299.     end
  300.     if mtype == 0 then
  301.         if window:hover(x, y) and window:visible() then
  302.             if (hy > location[2].ya and hy < location[2].yb) then
  303.                 windower.prim.set_position('window_button', menu.pos.x, (menu.pos.y + location[2].ya))
  304.                 windower.prim.set_size('window_button', mx, (location[2].yb - location[2].ya))
  305.             elseif (hy > location[(button_lines - 2)].ya and hy < location[(button_lines - 2)].yb) and menu_set == 3 and File_Write then
  306.                 windower.prim.set_position('window_button', menu.pos.x, (menu.pos.y + location[(button_lines - 2)].ya))
  307.                 windower.prim.set_size('window_button', mx, (location[(button_lines - 2)].yb - location[(button_lines - 2)].ya))
  308.             elseif (hy > location[(button_lines - 1)].ya and hy < location[(button_lines - 1)].yb) and menu_set == 3 then
  309.                 windower.prim.set_position('window_button', menu.pos.x, (menu.pos.y + location[(button_lines - 1)].ya))
  310.                 windower.prim.set_size('window_button', mx, (location[(button_lines - 1)].yb - location[(button_lines - 1)].ya))
  311.             elseif (hy > location[(button_lines)].ya and hy < location[(button_lines)].yb) and menu_set == 3 then
  312.                 windower.prim.set_position('window_button', menu.pos.x, (menu.pos.y + location[(button_lines)].ya))
  313.                 windower.prim.set_size('window_button', mx, (location[(button_lines)].yb - location[(button_lines)].ya))
  314.             else
  315.                 for i, v in ipairs(location) do
  316.                     if (hy > location[i].ya and hy < location[i].yb) then
  317.                         if type(my_table[i]) == 'table' and not table.contains(hide_button, my_table[i][1]) then
  318.                             if not table.contains(hide_button, my_table[i][1]) then
  319.                                 windower.prim.set_position('window_button', menu.pos.x, (menu.pos.y + location[i].ya))
  320.                                 windower.prim.set_size('window_button', mx, (location[i].yb - location[i].ya))
  321.                             else
  322.                                 windower.prim.set_visibility('window_button', false)
  323.                             end
  324.                         else
  325.                             windower.prim.set_visibility('window_button', false)
  326.                         end
  327.                     end
  328.                 end
  329.             end
  330.         elseif button:hover(x, y) and button:visible() then
  331.             windower.prim.set_position('window_button', min_window.pos.x, min_window.pos.y)
  332.             windower.prim.set_size('window_button', bmx, bmy)
  333.         elseif skillwatch and skill_select_window:hover(x, y) and skill_select_window:visible() then
  334.             for i, v in ipairs(location) do
  335.                 if (hy > location[i].ya and hy < location[i].yb) then
  336.                     if not table.contains(hide_button, my_table_skill[i][1]) then
  337.                         windower.prim.set_position('window_button', skill_select.pos.x, (skill_select.pos.y + location[i].ya))
  338.                         windower.prim.set_size('window_button', mx, (location[i].yb - location[i].ya))
  339.                     else
  340.                         windower.prim.set_visibility('window_button', false)
  341.                     end
  342.                 end
  343.             end
  344.         else
  345.             windower.prim.set_visibility('window_button', false)
  346.         end
  347.     elseif mtype == 2 then
  348.         if window:hover(x, y) and window:visible() then
  349.             if (hy > location[2].ya and hy < location[2].yb) then
  350.                 window:hide()
  351.                 window_hidden = true
  352.                 button:show()
  353.             elseif (hy > location[(button_lines - 2)].ya and hy < location[(button_lines - 2)].yb) and menu_set == 3  and File_Write then
  354.                 file_write()
  355.             elseif (hy > location[(button_lines - 1)].ya and hy < location[(button_lines - 1)].yb) and menu_set == 3 then
  356.                 send_command('gs export')
  357.             elseif (hy > location[(button_lines)].ya and hy < location[(button_lines)].yb) and menu_set == 3 then
  358.                 send_command('gs r')
  359.             else
  360.                 for i, v in ipairs(location) do
  361.                     if (hy > location[i].ya and hy < location[i].yb) then
  362.                         if type(my_table[i]) == 'table' then
  363.                             if my_table[i][1] then
  364.                                 menu_commands(my_table[i][1])
  365.                                 updatedisplay()
  366.                             end
  367.                         end
  368.                     end
  369.                 end
  370.             end
  371.         end
  372.         if button:hover(x, y) and button:visible() then
  373.             button:hide()
  374.             window_hidden = false
  375.             updatedisplay()
  376.         end
  377.         if skillwatch and skill_select_window:hover(x, y) and skill_select_window:visible() then
  378.             local skill_code = {['${ax|Axe}']=1,['${cl|Club}']=2,['${dg|Dagger}']=3,['${ga|Great Axe}']=4,['${gk|Great Katana}']=5,['${gs|Great Sword}']=6,
  379.                 ['${hh|Hand-to-Hand}']=7,['${kt|Katana}']=8,['${pl|Polearm}']=9,['${sc|Scythe}']=10,['${st|Staff}']=11,['${sw|Sword}']=12,
  380.                 ['${ar|Archery}']=13,['${mk|Marksmanship}']=14,['${th|Throwing}']=15,['${ev|Evasion}']=16,['${gr|Guard}']=17,['${pa|Parrying}']=18,
  381.                 ['${sh|Shield}']=19,['${bm|Blue Magic}']=20,['${dm|Dark Magic}']=21,['${dvm|Divine Magic}']=22,['${em|Elemental Magic}']=23,
  382.                 ['${efm|Enfeebling Magic}']=24,['${ehm|Enhancing Magic}']=25,['${go|Geomancy}']=26,['${hb|Handbell}']=27,['${hm|Healing Magic}']=28,
  383.                 ['${nin|Ninjutsu}']=29,['${so|Singing}']=30,['${sti|Stringed Instrument}']=31,['${smm|Summoning Magic}']=32,['${wi|Wind Instrument}']=33,
  384.                 ['${aa|Automaton Archery}']=34,['${amg|Automaton Magic}']=35,['${am|Automaton Melee}']=36}
  385.             for i, v in ipairs(location) do
  386.                 if (hy > location[i].ya and hy < location[i].yb) then
  387.                     skill_count = skill_code[my_table_skill[i]]
  388.                     skill_select_window:hide()
  389.                     updatedisplay()
  390.                 end
  391.             end
  392.         end
  393.     end
  394. end
  395. function menu_commands(a)
  396.     if a == "{stepm}" then
  397.         Stepmax = (Stepmax % 5) + 1
  398.     elseif a == "{ssteps}" then
  399.         Stopsteps = not Stopsteps
  400.     elseif a == "{cstaff}" then
  401.         Changestaff = not Changestaff
  402.     elseif a == "{ustaff}" then
  403.         Usestaff = (Usestaff=='Atk' and 'Acc' or 'Atk')
  404.     elseif a == "{cneckc}" then
  405.         Conquest.neck.change = not Conquest.neck.change
  406.     elseif a == "{cringc}" then
  407.         Conquest.ring.change = not Conquest.ring.change
  408.     elseif a == "{cneck}" then
  409.         Conquest.neck.case_id = (Conquest.neck.case_id % #Conquest.neck.case) + 1
  410.     elseif a == "{cring}" then
  411.         Conquest.ring.case_id = (Conquest.ring.case_id % #Conquest.ring.case) + 1
  412.     elseif a == "{amode}" then
  413.         gear_mode_count = (gear_mode_count % #gear_mode) + 1
  414.     elseif a == '{tmji}' then
  415.         MJi = not MJi
  416.         if MJi and not Disable_All and gearswap.pathsearch({'includes/mjob/main_job_'..player.main_job..'.lua'}) then
  417.             include('includes/mjob/main_job_'..player.main_job..'.lua')
  418.         else
  419.             remove_functions('MJi')
  420.         end
  421.     elseif a == '{tsji}' then
  422.         SJi = not SJi
  423.         if SJi and not Disable_All and gearswap.pathsearch({'includes/sjob/sub_job_'..player.sub_job..'.lua'}) then
  424.             include('includes/sjob/sub_job_'..player.sub_job..'.lua')
  425.         else
  426.             remove_functions('SJi')
  427.         end
  428.     elseif a == '{tmsi}' then
  429.         MSi = not MSi
  430.         if MSi and not Disable_All and table.contains(jobs.magic, player.main_job) and
  431.                                                         gearswap.pathsearch({'includes/extra_more/MSi.lua'}) then
  432.             include('includes/extra_more/MSi.lua')
  433.         else
  434.             remove_functions('MSi')
  435.         end
  436.     elseif a == '{tfwi}' then
  437.         File_Write = not File_Write
  438.         if file_write then
  439.             file_write()
  440.         end
  441.         if File_Write and not Disable_All and gearswap.pathsearch({'includes/extra_more/File_Write.lua'}) then
  442.             include('includes/extra_more/File_Write.lua')
  443.         else
  444.             remove_functions('File_Write')
  445.         end
  446.     elseif a == '{twsi}' then
  447.         WSi = not WSi
  448.         if WSi and not Disable_All and gearswap.pathsearch({'includes/extra_more/WSi.lua'}) then
  449.             include('includes/extra_more/WSi.lua')
  450.         else
  451.             remove_functions('WSi')
  452.         end
  453.     elseif a == '{tammo}' then
  454.         Ammo = not Ammo
  455.         if Ammo and not Disable_All and table.contains(jobs.ammo, player.main_job) and
  456.                                                             gearswap.pathsearch({'includes/extra_more/Ammo.lua'}) then
  457.             include('includes/extra_more/Ammo.lua')
  458.         else
  459.             remove_functions('Ammo')
  460.         end
  461.     elseif a == '{tswi}' then
  462.         Special_Weapons = not Special_Weapons
  463.         if Special_Weapons and not Disable_All and gearswap.pathsearch({'includes/extra_more/Special_Weapons.lua'}) then
  464.             include('includes/extra_more/Special_Weapons.lua')
  465.         else
  466.             remove_functions('Special_Weapons')
  467.         end
  468.     elseif a == '{tcgi}' then
  469.         Conquest_Gear = not Conquest_Gear
  470.         if Conquest_Gear and not Disable_All and gearswap.pathsearch({'includes/extra_more/Conquest_Gear.lua'}) then
  471.             include('includes/extra_more/Conquest_Gear.lua')
  472.         else
  473.             remove_functions('Conquest_Gear')
  474.         end
  475.     elseif a == '{trei}' then
  476.         Registered_Events = not Registered_Events
  477.         if Registered_Events and not Disable_All and gearswap.pathsearch({'includes/extra_more/Registered_Events.lua'}) then
  478.             include('includes/extra_more/Registered_Events.lua')
  479.         else
  480.             remove_functions('Registered_Events')
  481.         end
  482.     elseif a == '{tdebug}' then
  483.         Debug = not Debug
  484.         if Debug and not Disable_All and gearswap.pathsearch({'includes/extra_more/Debug.lua'}) then
  485.             include('includes/extra_more/Debug.lua')
  486.         else
  487.             remove_functions('Debug')
  488.         end
  489.     elseif a == '{tmjl}' then
  490.         lvlwatch = not lvlwatch
  491.     elseif a == "{listm}" then
  492.         if custom_menu then
  493.             menu_set = (menu_set % 5) + 1
  494.             initialize(window, menu, 'window')
  495.         else
  496.             menu_set = (menu_set % 4) + 1
  497.             initialize(window, menu, 'window')
  498.         end
  499.     elseif a == "{skill}" then
  500.         skill_select_window:show()
  501.     elseif a == "{tskill}" then
  502.         skillwatch = not skillwatch
  503.         if skillwatch then
  504.             skill_select_window = texts.new(skill_select)
  505.             initialize(skill_select_window, skill_select, 'skill_select_window')
  506.         else
  507.             skill_select_window:destroy()
  508.             my_table_skill = nil
  509.         end
  510.     elseif a == "{tswap}" then
  511.         tswap = not tswap
  512.         if tswap then
  513.             show_swaps(true)
  514.         else
  515.             show_swaps(false)
  516.         end
  517.     elseif a == "{debugm}" then
  518.         debugmod = not debugmod
  519.         if debugmod then
  520.             debug_mode(true)
  521.         else
  522.             debug_mode(false)
  523.         end
  524.     end
  525.     if custom_menu_commands then
  526.         custom_menu_commands(a)
  527.     end
  528.     if file_write then
  529.         file_write()
  530.     end
  531. end
  532. mouse_id = windower.raw_register_event('mouse', mouse)
Advertisement
Add Comment
Please, Sign In to add comment