<commit_before>UI = {}

UI.captionOFF = "Hoverboard OFF"
UI.captionON = "Hoverboard ON"

function UI.initialize(index)
  local gui = game.players[index].gui
  if gui.top.hoverboard ~= nil then
    gui.top.hoverboard.destroy()
  end
  gui.top.add{type="frame", name="hoverboard"}
  gui.top.hoverboard.add{type="button",name="mode", caption = UI.captionOFF}
  gui.top.hoverboard.add{type="label",name="charge"}
end

function UI.destroy(index)
  local gui = game.players[index].gui
  if gui.top.hoverboard ~= nil then
    gui.top.hoverboard.destroy()
  else
    print("WARNING: DESTROYING non-existent MagneticFloor UI")
  end
end

function UI.updateStatus(index)
  game.players[index].gui.top.hoverboard.charge.caption = "Charge: "..global.hoverboard[index].charge
end

function UI.switchMode(active,index)
  local gui = game.players[index].gui
  if active == true then
    gui.top.hoverboard.mode.caption = UI.captionON
  elseif active == false then
    gui.top.hoverboard.mode.caption = UI.captionOFF
  end
end

InputUI = {}<commit_msg>add test code<commit_after>UI = {}

UI.captionOFF = "Hoverboard OFF"
UI.captionON = "Hoverboard ON"

function UI.initialize(index)
  local gui = game.players[index].gui
  if gui.top.hoverboard ~= nil then
    gui.top.hoverboard.destroy()
  end
  gui.top.add{type="frame", name="hoverboard"}
  gui.top.hoverboard.add{type="button",name="mode", caption = UI.captionOFF}
  gui.top.hoverboard.add{type="label",name="charge"}
end

function UI.destroy(index)
  local gui = game.players[index].gui
  if gui.top.hoverboard ~= nil then
    gui.top.hoverboard.destroy()
  else
    print("WARNING: DESTROYING non-existent MagneticFloor UI")
  end
end

function UI.updateStatus(index)
  game.players[index].gui.top.hoverboard.charge.caption = "Charge: "..global.hoverboard[index].charge
end

function UI.switchMode(active,index)
  local gui = game.players[index].gui
  if active == true then
    gui.top.hoverboard.mode.caption = UI.captionON
  elseif active == false then
    gui.top.hoverboard.mode.caption = UI.captionOFF
  end
end

function test()
  print("test")
end

Gui.Event.register (defines.events.on_player_armor_inventory_changed, "top", test)
{'fraction_non_alphanumeric': 0.135383203304268, 'fraction_numerical': 0.0, 'mean_word_length': 4.43640897755611, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6381881', 'n_tokens_mistral': 770, 'n_tokens_neox': 753, 'n_words': 147}