{"action":"created","issue":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/14079","labels_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/14079/labels{/name}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/14079/comments","events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/14079/events","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/14079","id":117686994,"number":14079,"title":"Basic lua console","user":{"login":"JornVernee","id":5962029,"avatar_url":"https://avatars.githubusercontent.com/u/5962029?v=3","gravatar_id":"","url":"https://api.github.com/users/JornVernee","html_url":"https://github.com/JornVernee","followers_url":"https://api.github.com/users/JornVernee/followers","following_url":"https://api.github.com/users/JornVernee/following{/other_user}","gists_url":"https://api.github.com/users/JornVernee/gists{/gist_id}","starred_url":"https://api.github.com/users/JornVernee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JornVernee/subscriptions","organizations_url":"https://api.github.com/users/JornVernee/orgs","repos_url":"https://api.github.com/users/JornVernee/repos","events_url":"https://api.github.com/users/JornVernee/events{/privacy}","received_events_url":"https://api.github.com/users/JornVernee/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-11-18T21:35:11Z","updated_at":"2015-11-18T22:08:45Z","closed_at":"2015-11-18T22:08:45Z","pull_request":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/14079","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/14079","diff_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/14079.diff","patch_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/14079.patch"},"body":"I decided to add a basic lua console, instead of the existing string input pop up.\r\n\r\nThe advantage of a console over the pop up is that you don't have to keep opening it through the debug menu if you want to do multiple things, or if you get a syntax error.\r\n\r\nI also piped the error reporting and lua's standard 'print' function into the console. Errors will show up red.\r\n\r\nThe console can be opened the same way the pop up would. You can also scroll up/down using page up/down.\r\n\r\nTo implement this page up/down functionality I had to modify the string input window function, to take an optional list of callbacks mapped to different key codes. The function previously 'outed' the last key code pressed before closing the window, but that would mean that, to page up or down, we would have to press return every time, so that's why I had to change it. I guess this new functionality could exploited by other people too."},"comment":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/comments/157880440","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/14079#issuecomment-157880440","issue_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/14079","id":157880440,"user":{"login":"JornVernee","id":5962029,"avatar_url":"https://avatars.githubusercontent.com/u/5962029?v=3","gravatar_id":"","url":"https://api.github.com/users/JornVernee","html_url":"https://github.com/JornVernee","followers_url":"https://api.github.com/users/JornVernee/followers","following_url":"https://api.github.com/users/JornVernee/following{/other_user}","gists_url":"https://api.github.com/users/JornVernee/gists{/gist_id}","starred_url":"https://api.github.com/users/JornVernee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JornVernee/subscriptions","organizations_url":"https://api.github.com/users/JornVernee/orgs","repos_url":"https://api.github.com/users/JornVernee/repos","events_url":"https://api.github.com/users/JornVernee/events{/privacy}","received_events_url":"https://api.github.com/users/JornVernee/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T22:08:45Z","updated_at":"2015-11-18T22:08:45Z","body":"some why would it work if we initialize them in the class then? I would assume that's done before calling the constructor."}}