Skip to content

Commit

Permalink
Update load.py
Browse files Browse the repository at this point in the history
on planet info #36 shows the right numbers now.

ui still looks very meh. gotta build the display as a string and just add it after the number for scans in this system.
  • Loading branch information
Balvald committed May 21, 2023
1 parent 2412dee commit a76a490
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions load.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,10 @@ def dashboard_entry(cmdr: str, is_beta, entry) -> None: # noqa #CCR001
if not plugin.AST_near_planet:
# We just came into range of a planet again.
flag = True
if currentbody not in ["", None, "None"]:
plugin.AST_num_bios_on_planet = plugin.AST_bios_on_planet[currentbody]
if currentbody not in ["", None, "None"]:
logger.debug(plugin.AST_bios_on_planet)
plugin.AST_num_bios_on_planet = plugin.AST_bios_on_planet[
currentbody.replace(plugin.AST_current_system.get(), "")[1:]]
plugin.AST_near_planet = True
plugin.AST_current_radius = entry["PlanetRadius"]
plugin.AST_current_pos_vector[0] = entry["Latitude"]
Expand Down Expand Up @@ -1205,6 +1207,8 @@ def build_sold_bio_ui(plugin, cmdr: str, current_row) -> None: # noqa #CCR001

count = 0
count_from_planet = 0
currentbody = plugin.AST_current_body.get().replace(plugin.AST_current_system.get(), "")[1:]
logger.debug(plugin.AST_num_bios_on_planet)

try:
if plugin.AST_current_system.get() in soldbiodata[cmdr][firstletter].keys():
Expand All @@ -1223,7 +1227,9 @@ def build_sold_bio_ui(plugin, cmdr: str, current_row) -> None: # noqa #CCR001
else:
bodylistofspecies[sold["species"]].append([bodyname, True])

if plugin.AST_current_body.get() == bodyname:
logger.debug(f"{bodyname} checked and this is the current: {currentbody}")

if currentbody == bodyname:
count_from_planet += 1
count += 1
except KeyError:
Expand All @@ -1248,7 +1254,9 @@ def build_sold_bio_ui(plugin, cmdr: str, current_row) -> None: # noqa #CCR001
else:
bodylistofspecies[notsold["species"]].append([bodyname, False])

if plugin.AST_current_body.get() == bodyname:
logger.debug(f"{bodyname} checked and this is the current: {currentbody}")

if currentbody == bodyname:
count_from_planet += 1
count += 1
except KeyError:
Expand Down Expand Up @@ -1300,11 +1308,7 @@ def ask_canonn_nicely(system: str):
for body in data["SAAsignals"]:
if body["hud_category"] != "Biology":
continue
bodyname = body["body"]
if len(body["body"]) < 2 or body["body"][1] == " ":
# we have a standard type name:
bodyname = system + " " + body["body"]
dict_of_biological_counts[bodyname] = body["count"]
dict_of_biological_counts[body["body"]] = body["count"]
except KeyError:
# If there are no SAAsignals to search through
pass
Expand Down

0 comments on commit a76a490

Please sign in to comment.