Skip to content
Discussion options

You must be logged in to vote

choices[1] is always the initial one. init_nodes in choiceNode.lua hardcodes self.active_choice = self.choices[1], and there's no opt for it. Your rotation is the right call:

local function from(n, choices)
  local out = {}
  for i = 1, #choices do
    out[i] = choices[(n + i - 2) % #choices + 1]
  end
  return out
end

c(2, from(2, my_options))

The enter callback can't get you there anyway. It fires mid-jump, before the node becomes current, and set_choice re-enters the same code path. Even if it landed, the buffer would still show opt1 until you jump to that node.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gregdvd
Comment options

Answer selected by gregdvd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants