Skip to content

Commit

Permalink
Merge pull request Ziktofel#139 from EnvyDragon/sc2-next
Browse files Browse the repository at this point in the history
SC2: Fine-tuning mission gui
  • Loading branch information
Ziktofel authored Jan 21, 2024
2 parents d344228 + d6f0fa1 commit b69ccbe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
22 changes: 15 additions & 7 deletions worlds/sc2/ClientGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from worlds.sc2.Client import SC2Context, calc_unfinished_missions, parse_unlock
from worlds.sc2.MissionTables import lookup_id_to_mission, lookup_name_to_mission, campaign_race_exceptions, \
SC2Mission, SC2Race
SC2Mission, SC2Race, SC2Campaign
from worlds.sc2.Locations import LocationType, lookup_location_id_to_type
from worlds.sc2.Options import LocationInclusion
from worlds.sc2 import SC2World, get_first_mission
Expand Down Expand Up @@ -138,22 +138,30 @@ def build_mission_table(self, dt) -> None:
categories[mission_info.category].append(mission_index)

max_mission_count = max(len(categories[category]) for category in categories)
campaign_layout_height = (max_mission_count + 2) * 50
if max_mission_count == 1:
campaign_layout_height = 115
else:
campaign_layout_height = (max_mission_count + 2) * 50
multi_campaign_layout_height += campaign_layout_height
campaign_layout = CampaignLayout(size_hint_y=None, height=campaign_layout_height)
campaign_layout.add_widget(
Label(text=campaign.campaign_name, size_hint_y=None, height=25, outline_width=1)
)
if campaign != SC2Campaign.GLOBAL:
campaign_layout.add_widget(
Label(text=campaign.campaign_name, size_hint_y=None, height=25, outline_width=1)
)
mission_layout = MissionLayout()

for category in categories:
category_panel = MissionCategory()
category_name_height = 0
category_spacing = 3
if category.startswith('_'):
category_display_name = ''
else:
category_display_name = category
category_name_height += 25
category_spacing = 10
category_panel = MissionCategory(padding=[category_spacing,6,category_spacing,6])
category_panel.add_widget(
Label(text=category_display_name, size_hint_y=None, height=25, outline_width=1))
Label(text=category_display_name, size_hint_y=None, height=category_name_height, outline_width=1))

for mission in categories[category]:
text: str = mission
Expand Down
3 changes: 1 addition & 2 deletions worlds/sc2/Starcraft2.kv
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
cols: 1
size_hint_y: None
height: self.minimum_height + 15
padding: [5,0,dp(12),0]

<CampaignLayout>:
cols: 1
Expand All @@ -16,7 +17,6 @@

<MissionCategory>:
cols: 1
padding: [10,5,10,5]
spacing: [0,5]

<MissionButton>:
Expand All @@ -25,5 +25,4 @@
halign: 'center'
valign: 'middle'
padding: [5,0,5,0]
markup: True
outline_width: 1

0 comments on commit b69ccbe

Please sign in to comment.