GitHub PullRequestReviewCommentEvent at 2014-02-11 22:43:02
Repository: unknown-horizons
Actor: nihathrael
Payload: {"comment":{"url":"https://api.github.com/repos/unknown-horizons/unknown-horizons/pulls/comments/9647341","id":9647341,"diff_hunk":"@@ -134,14 +137,53 @@ def _mark(self, *edges):\n \t\t\t\t\tif b is not None:\n \t\t\t\t\t\tif b not in self._hovering_over:\n \t\t\t\t\t\t\tself._hovering_over.append(b)\n+\t\t\t\t\t\t\tself._make_surrounding_transparent(b)\n+\t\t\t\t\t\t\tself._remove_object_transparency(Point(x,y))\n \t\t\t\t\t\tif b.tearable and b.owner is not None and b.owner.is_local_player:\n \t\t\t\t\t\t\tif b not in self.selected:\n+\t\t\t\t\t\t\t\tself._make_surrounding_transparent(b)\n \t\t\t\t\t\t\t\tself.selected.append(b)\n+\t\t\t\t\t\t\t\tself._remove_object_transparency(Point(x,y))\n \t\t\tfor i in self.selected:\n \t\t\t\tself.session.view.renderer['InstanceRenderer'].addColored(i._instance,\n \t\t\t\t                                                          *self.tear_selection_color)\n \t\tself.log.debug(\"TearingTool: mark done\")\n \n+\tdef _remove_object_transparency(self, coords):\n+\t\t\"\"\"helper function, used to remove transparency from object hovered upon,\n+\t\tidentified through its coordinates\"\"\"\n+\t\tget_tile = self.session.world.get_tile\n+\t\ttile = get_tile(coords)\n+\t\tif tile.object is not None and tile.object.buildable_upon:\n+\t\t\tinst = tile.object.fife_instance\n+\t\t\tinst.get2dGfxVisual().setTransparency(0)\n+\n+\tdef _make_surrounding_transparent(self, building):\n+\t\t\"\"\"Makes the surrounding of building_position transparent\"\"\"\n+\t\tworld_contains = self.session.world.map_dimensions.contains_without_border\n+\t\tget_tile = self.session.world.get_tile\n+\t\tfor coord in building.position.get_radius_coordinates(self.nearby_objects_radius, include_self=True):\n+\t\t\tp = Point(*coord)\n+\t\t\tif not world_contains(p):\n+\t\t\t\tcontinue\n+\t\t\ttile = get_tile(p)\n+\t\t\tif tile.object is not None and tile.object.buildable_upon:\n+\t\t\t\tinst = tile.object.fife_instance\n+\t\t\t\tinst.get2dGfxVisual().setTransparency(BUILDINGS.TRANSPARENCY_VALUE)\n+\t\t\t\tself._transparencified_instances.add(weakref.ref(inst))\n+\n+\tdef _restore_transparencified_instances(self):","path":"horizons/gui/mousetools/tearingtool.py","position":75,"original_position":75,"commit_id":"31d8dcee593644ff3083b722b833db40df5783a6","original_commit_id":"31d8dcee593644ff3083b722b833db40df5783a6","user":{"login":"nihathrael","id":150905,"avatar_url":"https://gravatar.com/avatar/415ecdfbc373de79299dfd93f2a9deed?d=https%3A%2F%2Fidenticons.github.com%2F6b118d3442e5a45c6eb8a6f36cc22059.png&r=x","gravatar_id":"415ecdfbc373de79299dfd93f2a9deed","url":"https://api.github.com/users/nihathrael","html_url":"https://github.com/nihathrael","followers_url":"https://api.github.com/users/nihathrael/followers","following_url":"https://api.github.com/users/nihathrael/following{/other_user}","gists_url":"https://api.github.com/users/nihathrael/gists{/gist_id}","starred_url":"https://api.github.com/users/nihathrael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nihathrael/subscriptions","organizations_url":"https://api.github.com/users/nihathrael/orgs","repos_url":"https://api.github.com/users/nihathrael/repos","events_url":"https://api.github.com/users/nihathrael/events{/privacy}","received_events_url":"https://api.github.com/users/nihathrael/received_events","type":"User","site_admin":false},"body":"Same here. Maybe rename to _restore_transparent_instances?","created_at":"2014-02-11T22:43:02Z","updated_at":"2014-02-11T22:43:02Z","html_url":"https://github.com/unknown-horizons/unknown-horizons/pull/2243#discussion_r9647341","pull_request_url":"https://api.github.com/repos/unknown-horizons/unknown-horizons/pulls/2243","_links":{"self":{"href":"https://api.github.com/repos/unknown-horizons/unknown-horizons/pulls/comments/9647341"},"html":{"href":"https://github.com/unknown-horizons/unknown-horizons/pull/2243#discussion_r9647341"},"pull_request":{"href":"https://api.github.com/repos/unknown-horizons/unknown-horizons/pulls/2243"}}}}