Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #add static entityties to the list, these entities will always will be in the list
- if newList.find(x) == -1:
- if x.is_in_group("stations") or x.is_in_group("asteroidField") or x.is_in_group("missionSite"):
- newList.append(x)
- go = target_col.instance()
- listParent.add_child(go)
- go.get_node("Sprite").set_texture(icon)
- go.get_node("Sprite").set_scale(Vector2(0.5, 0.5))
- go.get_node("Name").set_text(str(x.name))
- go.set_name("Entity " + x.name)
- var y = -35 + (35 * newList.size())
- #go.set_pos(Vector2(0, y))
- listParent.set_custom_minimum_size(Vector2(0, y + 25))
- go.connect("mouse_enter", self, "_m_enter", [x])
- go.connect("mouse_exit", self, "_m_exit", [x])
- #display distance on list buttons
- for n in range(newList.size()):
- if listParent.get_child_count() > 0:
- if newList.find(x) == n:
- listParent.get_child(n).get_node("Dist").set_text(str(newD))
- newList.sort_custom(self, "sort_dist")
- func sort_dist(node_a, node_b):
- return pplPos.distance_squared_to(node_a.get_global_transform().origin) < pplPos.distance_squared_to(node_b.get_global_transform().origin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement