{"action":"closed","issue":{"url":"https://api.github.com/repos/brunosxs/SMRT-Godot/issues/15","repository_url":"https://api.github.com/repos/brunosxs/SMRT-Godot","labels_url":"https://api.github.com/repos/brunosxs/SMRT-Godot/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/brunosxs/SMRT-Godot/issues/15/comments","events_url":"https://api.github.com/repos/brunosxs/SMRT-Godot/issues/15/events","html_url":"https://github.com/brunosxs/SMRT-Godot/issues/15","id":372678412,"node_id":"MDU6SXNzdWUzNzI2Nzg0MTI=","number":15,"title":"Dialogue not working properly","user":{"login":"zenogears","id":1252337,"node_id":"MDQ6VXNlcjEyNTIzMzc=","avatar_url":"https://avatars3.githubusercontent.com/u/1252337?v=4","gravatar_id":"","url":"https://api.github.com/users/zenogears","html_url":"https://github.com/zenogears","followers_url":"https://api.github.com/users/zenogears/followers","following_url":"https://api.github.com/users/zenogears/following{/other_user}","gists_url":"https://api.github.com/users/zenogears/gists{/gist_id}","starred_url":"https://api.github.com/users/zenogears/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zenogears/subscriptions","organizations_url":"https://api.github.com/users/zenogears/orgs","repos_url":"https://api.github.com/users/zenogears/repos","events_url":"https://api.github.com/users/zenogears/events{/privacy}","received_events_url":"https://api.github.com/users/zenogears/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-22T20:08:26Z","updated_at":"2018-12-13T10:43:07Z","closed_at":"2018-12-13T10:43:07Z","author_association":"NONE","body":"Hi!\r\nWhen you choose answer, it always is '0' because of:\r\nfunc question:\r\n```\r\n\tvar index = 0\r\n\tfor answer in answer_array:\r\n\t\tvar b = Button.new()\r\n\t\tb.set_text(answer)\r\n\t\tb.add_font_override(\"font\", font)\r\n\t\tb.set_flat(true)\r\n\t\tb.add_stylebox_override(\"normal\", StyleBox)\r\n\t\tb.add_stylebox_override(\"selected\", StyleBox)\r\n\t\tb.add_stylebox_override(\"pressed\", StyleBox)\r\n\t\tb.add_stylebox_override(\"hover\", StyleBox)\r\n\t\tb.add_font_override(\"font_selected\", font)\r\n\t\tbtn_answers.add_child(b)\r\n\t\tb.connect(\"pressed\",self,\"selected_answer\",[index])\r\n\t\tif index > 0:\r\n\t\t\tvar last_child = btn_answers.get_child(index-1)\r\n\t\t\tb.set_focus_neighbour(MARGIN_TOP,last_child.get_path())\r\n\t\t\tbtn_answers.rect_size.y += b.rect_size\r\n\t\t\tindex+=1\r\n```\r\nHow index can be >0 if it is 0?\r\nWorks only like that:\r\n```\r\n\tvar index = 0\r\n\tfor answer in answer_array:\r\n\t\tvar b = Button.new()\r\n\t\tb.set_text(answer)\r\n\t\tb.add_font_override(\"font\", font)\r\n\t\tb.set_flat(true)\r\n\t\tb.add_stylebox_override(\"normal\", StyleBox)\r\n\t\tb.add_stylebox_override(\"selected\", StyleBox)\r\n\t\tb.add_stylebox_override(\"pressed\", StyleBox)\r\n\t\tb.add_stylebox_override(\"hover\", StyleBox)\r\n\t\tb.add_font_override(\"font_selected\", font)\r\n\t\tbtn_answers.add_child(b)\r\n\t\tb.connect(\"pressed\",self,\"selected_answer\",[index])\r\n\t\tindex+=1\r\n```\r\nI can't understand, for what need index >0\r\nAnd I do some changes in editor:\r\n[https://i.imgur.com/Ew1urpl.png](https://i.imgur.com/Ew1urpl.png)"}}
{"actor":{"display_login":"brunosxs"}}