{"action":"created","comment":{"url":"https://api.github.com/repos/tgstation/-tg-station/pulls/comments/34098623","id":34098623,"diff_hunk":"@@ -0,0 +1,206 @@\n+/atom/var/smooth = 0\n+/atom/var/datum/tile_smoother/smoother = null\n+/atom/var/list/canSmoothWith=list() // TYPE PATHS I CAN SMOOTH WITH~~~~~\n+\n+//generic (by snowflake) tile smoothing datum; smooth your icons with this!\n+/*\n+\tEach tile is divided in 4 corners, each corner has an image associated to it; the tile is then overlayed by these 4 images\n+\tTo use this, just set your atom's 'smooth' var to 1. If your atom can't be moved/unanchored, set its 'can_be_unanchored' var to 0.\n+\tIf you don't want your atom's icon to smooth with anything but atoms of the same type, set the list 'canSmoothWith' to null;\n+\tOtherwise, put all types you want the atom icon to smooth with in 'canSmoothWith' INCLUDING THE TYPE OF THE ATOM ITSELF.\n+\n+\tEach atom has its own icon file with all the possible corner states. See 'smooth_wall.dmi' for a template.\n+*/\n+/datum/tile_smoother\n+\tvar/image/top_right\n+\tvar/image/top_left\n+\tvar/image/bottom_left\n+\tvar/image/bottom_right\n+\tvar/atom/holder\n+\tvar/cardinal_adj\n+\tvar/list/diagonal_adj\n+\tvar/list/siblings\n+\tvar/movable\n+\tvar/enabled = 1\n+\n+/datum/tile_smoother/New(var/a_holder, var/list/s_list=null, movable_b = 0)\n+\tholder = a_holder\n+\ttop_left = image(holder.icon, \"1-i\")\n+\ttop_right = image(holder.icon, \"2-i\")\n+\tbottom_left = image(holder.icon, \"3-i\")\n+\tbottom_right = image(holder.icon, \"4-i\")\n+\tif(s_list && s_list.len == 0)\n+\t\tsiblings = null\n+\telse\n+\t\tsiblings = s_list\n+\tmovable = movable_b\n+\n+/datum/tile_smoother/proc/update_adjacencies()\n+\tcardinal_adj = 0\n+\tdiagonal_adj = list()\n+\tif(movable)\n+\t\tvar/atom/movable/A = holder\n+\t\tif(!A.anchored)\n+\t\t\tcardinal_adj = 0\n+\t\t\tdiagonal_adj = list()\n+\t\t\treturn\n+\t\tfor(var/direction in cardinal)\n+\t\t\tvar/atom/movable/AM = find_type_in_direction(holder, direction, siblings)\n+\t\t\tif(AM)\n+\t\t\t\tif(AM.anchored)\n+\t\t\t\t\tcardinal_adj |= direction\n+\t\tfor(var/direction in diagonals)\n+\t\t\tif(find_type_in_direction(holder, direction, siblings))\n+\t\t\t\tdiagonal_adj |= direction\n+\telse\n+\t\tfor(var/direction in cardinal)\n+\t\t\tif(find_type_in_direction(holder, direction, siblings))\n+\t\t\t\tcardinal_adj |= direction\n+\t\tfor(var/direction in diagonals)\n+\t\t\tif(find_type_in_direction(holder, direction, siblings))\n+\t\t\t\tdiagonal_adj |= direction\n+\n+/datum/tile_smoother/proc/smooth()\n+\tif(!enabled)\treturn\n+\tspawn(2)\n+\t\tif(holder && holder.smooth)\n+\t\t\tholder.overlays -= top_left\n+\t\t\tholder.overlays -= top_right\n+\t\t\tholder.overlays -= bottom_right\n+\t\t\tholder.overlays -= bottom_left\n+\n+\t\t\tupdate_adjacencies()\n+\t\t\tmake_nw_corner()\n+\t\t\tmake_ne_corner()\n+\t\t\tmake_sw_corner()\n+\t\t\tmake_se_corner()\n+\n+\t\t\tholder.overlays += top_left\n+\t\t\tholder.overlays += top_right\n+\t\t\tholder.overlays += bottom_right\n+\t\t\tholder.overlays += bottom_left\n+\n+\n+/datum/tile_smoother/proc/make_nw_corner()\n+\tvar/sdir = \"\"\n+\tif((cardinal_adj & NORTH) && (cardinal_adj & WEST))\n+\t\tif(NORTHWEST in diagonal_adj)\n+\t\t\tsdir = \"f\"\n+\t\telse\n+\t\t\tsdir = \"nw\"\n+\telse\n+\t\tif(cardinal_adj & NORTH)\n+\t\t\tsdir = \"n\"\n+\t\telse if(cardinal_adj & WEST)\n+\t\t\tsdir = \"w\"\n+\t\telse\n+\t\t\tsdir = \"i\"\n+\ttop_left = image(holder.icon, \"1-[sdir]\")","path":"code/datums/smooth.dm","position":98,"original_position":98,"commit_id":"5a5372ed964d2ac01d3518a2602649d168291f34","original_commit_id":"5a5372ed964d2ac01d3518a2602649d168291f34","user":{"login":"optimumtact","id":2544323,"avatar_url":"https://avatars.githubusercontent.com/u/2544323?v=3","gravatar_id":"","url":"https://api.github.com/users/optimumtact","html_url":"https://github.com/optimumtact","followers_url":"https://api.github.com/users/optimumtact/followers","following_url":"https://api.github.com/users/optimumtact/following{/other_user}","gists_url":"https://api.github.com/users/optimumtact/gists{/gist_id}","starred_url":"https://api.github.com/users/optimumtact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optimumtact/subscriptions","organizations_url":"https://api.github.com/users/optimumtact/orgs","repos_url":"https://api.github.com/users/optimumtact/repos","events_url":"https://api.github.com/users/optimumtact/events{/privacy}","received_events_url":"https://api.github.com/users/optimumtact/received_events","type":"User","site_admin":false},"body":"I've just realised you can generate the images at the time they are needed once\r\ni.e the flow is\r\ncheck if image stored in global list:\r\nif yes - use\r\nelse - generate and store in global list","created_at":"2015-07-07T22:25:44Z","updated_at":"2015-07-07T22:25:44Z","html_url":"https://github.com/tgstation/-tg-station/pull/10459#discussion_r34098623","pull_request_url":"https://api.github.com/repos/tgstation/-tg-station/pulls/10459","_links":{"self":{"href":"https://api.github.com/repos/tgstation/-tg-station/pulls/comments/34098623"},"html":{"href":"https://github.com/tgstation/-tg-station/pull/10459#discussion_r34098623"},"pull_request":{"href":"https://api.github.com/repos/tgstation/-tg-station/pulls/10459"}}},"pull_request":{"url":"https://api.github.com/repos/tgstation/-tg-station/pulls/10459","id":39422110,"html_url":"https://github.com/tgstation/-tg-station/pull/10459","diff_url":"https://github.com/tgstation/-tg-station/pull/10459.diff","patch_url":"https://github.com/tgstation/-tg-station/pull/10459.patch","issue_url":"https://api.github.com/repos/tgstation/-tg-station/issues/10459","number":10459,"state":"open","locked":false,"title":"Tile smoothing datum","user":{"login":"xxalpha","id":4951579,"avatar_url":"https://avatars.githubusercontent.com/u/4951579?v=3","gravatar_id":"","url":"https://api.github.com/users/xxalpha","html_url":"https://github.com/xxalpha","followers_url":"https://api.github.com/users/xxalpha/followers","following_url":"https://api.github.com/users/xxalpha/following{/other_user}","gists_url":"https://api.github.com/users/xxalpha/gists{/gist_id}","starred_url":"https://api.github.com/users/xxalpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xxalpha/subscriptions","organizations_url":"https://api.github.com/users/xxalpha/orgs","repos_url":"https://api.github.com/users/xxalpha/repos","events_url":"https://api.github.com/users/xxalpha/events{/privacy}","received_events_url":"https://api.github.com/users/xxalpha/received_events","type":"User","site_admin":false},"body":"For all your smoothing needs\r\n\r\n - One datum to smooth them all\r\n - Everything that should icon smooth uses this\r\n - Removed grass icon smoothing\r\n\r\nAll sprite work done by @WJohn also doing this was his idea.\r\n\r\nNow please tell me how my code is shit, I don't care anymore. :speedboat:\r\n\r\nFixes https://github.com/tgstation/-tg-station/issues/10320 \r\nFixes https://github.com/tgstation/-tg-station/issues/10243 \r\nFixes https://github.com/tgstation/-tg-station/issues/10240 \r\nFixes https://github.com/tgstation/-tg-station/issues/10140","created_at":"2015-07-07T22:05:33Z","updated_at":"2015-07-07T22:25:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tgstation/-tg-station/pulls/10459/commits","review_comments_url":"https://api.github.com/repos/tgstation/-tg-station/pulls/10459/comments","review_comment_url":"https://api.github.com/repos/tgstation/-tg-station/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tgstation/-tg-station/issues/10459/comments","statuses_url":"https://api.github.com/repos/tgstation/-tg-station/statuses/5a5372ed964d2ac01d3518a2602649d168291f34","head":{"label":"xxalpha:smoothballs","ref":"smoothballs","sha":"5a5372ed964d2ac01d3518a2602649d168291f34","user":{"login":"xxalpha","id":4951579,"avatar_url":"https://avatars.githubusercontent.com/u/4951579?v=3","gravatar_id":"","url":"https://api.github.com/users/xxalpha","html_url":"https://github.com/xxalpha","followers_url":"https://api.github.com/users/xxalpha/followers","following_url":"https://api.github.com/users/xxalpha/following{/other_user}","gists_url":"https://api.github.com/users/xxalpha/gists{/gist_id}","starred_url":"https://api.github.com/users/xxalpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xxalpha/subscriptions","organizations_url":"https://api.github.com/users/xxalpha/orgs","repos_url":"https://api.github.com/users/xxalpha/repos","events_url":"https://api.github.com/users/xxalpha/events{/privacy}","received_events_url":"https://api.github.com/users/xxalpha/received_events","type":"User","site_admin":false},"repo":{"id":25555172,"name":"-tg-station","full_name":"xxalpha/-tg-station","owner":{"login":"xxalpha","id":4951579,"avatar_url":"https://avatars.githubusercontent.com/u/4951579?v=3","gravatar_id":"","url":"https://api.github.com/users/xxalpha","html_url":"https://github.com/xxalpha","followers_url":"https://api.github.com/users/xxalpha/followers","following_url":"https://api.github.com/users/xxalpha/following{/other_user}","gists_url":"https://api.github.com/users/xxalpha/gists{/gist_id}","starred_url":"https://api.github.com/users/xxalpha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xxalpha/subscriptions","organizations_url":"https://api.github.com/users/xxalpha/orgs","repos_url":"https://api.github.com/users/xxalpha/repos","events_url":"https://api.github.com/users/xxalpha/events{/privacy}","received_events_url":"https://api.github.com/users/xxalpha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xxalpha/-tg-station","description":"/tg/'s SS13 branch","fork":true,"url":"https://api.github.com/repos/xxalpha/-tg-station","forks_url":"https://api.github.com/repos/xxalpha/-tg-station/forks","keys_url":"https://api.github.com/repos/xxalpha/-tg-station/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xxalpha/-tg-station/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xxalpha/-tg-station/teams","hooks_url":"https://api.github.com/repos/xxalpha/-tg-station/hooks","issue_events_url":"https://api.github.com/repos/xxalpha/-tg-station/issues/events{/number}","events_url":"https://api.github.com/repos/xxalpha/-tg-station/events","assignees_url":"https://api.github.com/repos/xxalpha/-tg-station/assignees{/user}","branches_url":"https://api.github.com/repos/xxalpha/-tg-station/branches{/branch}","tags_url":"https://api.github.com/repos/xxalpha/-tg-station/tags","blobs_url":"https://api.github.com/repos/xxalpha/-tg-station/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xxalpha/-tg-station/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xxalpha/-tg-station/git/refs{/sha}","trees_url":"https://api.github.com/repos/xxalpha/-tg-station/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xxalpha/-tg-station/statuses/{sha}","languages_url":"https://api.github.com/repos/xxalpha/-tg-station/languages","stargazers_url":"https://api.github.com/repos/xxalpha/-tg-station/stargazers","contributors_url":"https://api.github.com/repos/xxalpha/-tg-station/contributors","subscribers_url":"https://api.github.com/repos/xxalpha/-tg-station/subscribers","subscription_url":"https://api.github.com/repos/xxalpha/-tg-station/subscription","commits_url":"https://api.github.com/repos/xxalpha/-tg-station/commits{/sha}","git_commits_url":"https://api.github.com/repos/xxalpha/-tg-station/git/commits{/sha}","comments_url":"https://api.github.com/repos/xxalpha/-tg-station/comments{/number}","issue_comment_url":"https://api.github.com/repos/xxalpha/-tg-station/issues/comments{/number}","contents_url":"https://api.github.com/repos/xxalpha/-tg-station/contents/{+path}","compare_url":"https://api.github.com/repos/xxalpha/-tg-station/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xxalpha/-tg-station/merges","archive_url":"https://api.github.com/repos/xxalpha/-tg-station/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xxalpha/-tg-station/downloads","issues_url":"https://api.github.com/repos/xxalpha/-tg-station/issues{/number}","pulls_url":"https://api.github.com/repos/xxalpha/-tg-station/pulls{/number}","milestones_url":"https://api.github.com/repos/xxalpha/-tg-station/milestones{/number}","notifications_url":"https://api.github.com/repos/xxalpha/-tg-station/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xxalpha/-tg-station/labels{/name}","releases_url":"https://api.github.com/repos/xxalpha/-tg-station/releases{/id}","created_at":"2014-10-22T01:27:31Z","updated_at":"2015-05-04T19:53:39Z","pushed_at":"2015-07-07T22:01:55Z","git_url":"git://github.com/xxalpha/-tg-station.git","ssh_url":"git@github.com:xxalpha/-tg-station.git","clone_url":"https://github.com/xxalpha/-tg-station.git","svn_url":"https://github.com/xxalpha/-tg-station","homepage":"http://www.tgstation13.org/","size":517575,"stargazers_count":0,"watchers_count":0,"language":"DM","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tgstation:master","ref":"master","sha":"1a0f0469e9b1a31663a2fefecfb5e4886debfa53","user":{"login":"tgstation","id":1363778,"avatar_url":"https://avatars.githubusercontent.com/u/1363778?v=3","gravatar_id":"","url":"https://api.github.com/users/tgstation","html_url":"https://github.com/tgstation","followers_url":"https://api.github.com/users/tgstation/followers","following_url":"https://api.github.com/users/tgstation/following{/other_user}","gists_url":"https://api.github.com/users/tgstation/gists{/gist_id}","starred_url":"https://api.github.com/users/tgstation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgstation/subscriptions","organizations_url":"https://api.github.com/users/tgstation/orgs","repos_url":"https://api.github.com/users/tgstation/repos","events_url":"https://api.github.com/users/tgstation/events{/privacy}","received_events_url":"https://api.github.com/users/tgstation/received_events","type":"Organization","site_admin":false},"repo":{"id":3234987,"name":"-tg-station","full_name":"tgstation/-tg-station","owner":{"login":"tgstation","id":1363778,"avatar_url":"https://avatars.githubusercontent.com/u/1363778?v=3","gravatar_id":"","url":"https://api.github.com/users/tgstation","html_url":"https://github.com/tgstation","followers_url":"https://api.github.com/users/tgstation/followers","following_url":"https://api.github.com/users/tgstation/following{/other_user}","gists_url":"https://api.github.com/users/tgstation/gists{/gist_id}","starred_url":"https://api.github.com/users/tgstation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgstation/subscriptions","organizations_url":"https://api.github.com/users/tgstation/orgs","repos_url":"https://api.github.com/users/tgstation/repos","events_url":"https://api.github.com/users/tgstation/events{/privacy}","received_events_url":"https://api.github.com/users/tgstation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tgstation/-tg-station","description":"the /tg/station branch of SS13","fork":false,"url":"https://api.github.com/repos/tgstation/-tg-station","forks_url":"https://api.github.com/repos/tgstation/-tg-station/forks","keys_url":"https://api.github.com/repos/tgstation/-tg-station/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tgstation/-tg-station/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tgstation/-tg-station/teams","hooks_url":"https://api.github.com/repos/tgstation/-tg-station/hooks","issue_events_url":"https://api.github.com/repos/tgstation/-tg-station/issues/events{/number}","events_url":"https://api.github.com/repos/tgstation/-tg-station/events","assignees_url":"https://api.github.com/repos/tgstation/-tg-station/assignees{/user}","branches_url":"https://api.github.com/repos/tgstation/-tg-station/branches{/branch}","tags_url":"https://api.github.com/repos/tgstation/-tg-station/tags","blobs_url":"https://api.github.com/repos/tgstation/-tg-station/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tgstation/-tg-station/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tgstation/-tg-station/git/refs{/sha}","trees_url":"https://api.github.com/repos/tgstation/-tg-station/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tgstation/-tg-station/statuses/{sha}","languages_url":"https://api.github.com/repos/tgstation/-tg-station/languages","stargazers_url":"https://api.github.com/repos/tgstation/-tg-station/stargazers","contributors_url":"https://api.github.com/repos/tgstation/-tg-station/contributors","subscribers_url":"https://api.github.com/repos/tgstation/-tg-station/subscribers","subscription_url":"https://api.github.com/repos/tgstation/-tg-station/subscription","commits_url":"https://api.github.com/repos/tgstation/-tg-station/commits{/sha}","git_commits_url":"https://api.github.com/repos/tgstation/-tg-station/git/commits{/sha}","comments_url":"https://api.github.com/repos/tgstation/-tg-station/comments{/number}","issue_comment_url":"https://api.github.com/repos/tgstation/-tg-station/issues/comments{/number}","contents_url":"https://api.github.com/repos/tgstation/-tg-station/contents/{+path}","compare_url":"https://api.github.com/repos/tgstation/-tg-station/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tgstation/-tg-station/merges","archive_url":"https://api.github.com/repos/tgstation/-tg-station/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tgstation/-tg-station/downloads","issues_url":"https://api.github.com/repos/tgstation/-tg-station/issues{/number}","pulls_url":"https://api.github.com/repos/tgstation/-tg-station/pulls{/number}","milestones_url":"https://api.github.com/repos/tgstation/-tg-station/milestones{/number}","notifications_url":"https://api.github.com/repos/tgstation/-tg-station/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tgstation/-tg-station/labels{/name}","releases_url":"https://api.github.com/repos/tgstation/-tg-station/releases{/id}","created_at":"2012-01-21T17:32:47Z","updated_at":"2015-07-03T03:09:54Z","pushed_at":"2015-07-07T22:23:53Z","git_url":"git://github.com/tgstation/-tg-station.git","ssh_url":"git@github.com:tgstation/-tg-station.git","clone_url":"https://github.com/tgstation/-tg-station.git","svn_url":"https://github.com/tgstation/-tg-station","homepage":"http://www.tgstation13.org/","size":707610,"stargazers_count":230,"watchers_count":230,"language":"DM","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":774,"mirror_url":null,"open_issues_count":860,"forks":774,"open_issues":860,"watchers":230,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tgstation/-tg-station/pulls/10459"},"html":{"href":"https://github.com/tgstation/-tg-station/pull/10459"},"issue":{"href":"https://api.github.com/repos/tgstation/-tg-station/issues/10459"},"comments":{"href":"https://api.github.com/repos/tgstation/-tg-station/issues/10459/comments"},"review_comments":{"href":"https://api.github.com/repos/tgstation/-tg-station/pulls/10459/comments"},"review_comment":{"href":"https://api.github.com/repos/tgstation/-tg-station/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tgstation/-tg-station/pulls/10459/commits"},"statuses":{"href":"https://api.github.com/repos/tgstation/-tg-station/statuses/5a5372ed964d2ac01d3518a2602649d168291f34"}}}}