From 4b9e48333c13ae1c17d6204be334837edddd340f Mon Sep 17 00:00:00 2001 From: EnvyDragon <138727357+EnvyDragon@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:44:19 -0500 Subject: [PATCH] SC2: Fine-tuning mission gui --- worlds/sc2/ClientGui.py | 20 ++++++++++++++------ worlds/sc2/Starcraft2.kv | 3 +-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/worlds/sc2/ClientGui.py b/worlds/sc2/ClientGui.py index c2cedf21898e..81208fa2d88c 100644 --- a/worlds/sc2/ClientGui.py +++ b/worlds/sc2/ClientGui.py @@ -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.campaign_name != "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 = 5 if category.startswith('_'): category_display_name = '' else: category_display_name = category + category_name_height += 25 + category_spacing += 5 + category_panel = MissionCategory(padding=[category_spacing,5,category_spacing,5]) 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 diff --git a/worlds/sc2/Starcraft2.kv b/worlds/sc2/Starcraft2.kv index 650ca8191419..5ea393d4aa1e 100644 --- a/worlds/sc2/Starcraft2.kv +++ b/worlds/sc2/Starcraft2.kv @@ -7,6 +7,7 @@ cols: 1 size_hint_y: None height: self.minimum_height + 15 + padding: [0,0,dp(12),0] : cols: 1 @@ -16,7 +17,6 @@ : cols: 1 - padding: [10,5,10,5] spacing: [0,5] : @@ -25,5 +25,4 @@ halign: 'center' valign: 'middle' padding: [5,0,5,0] - markup: True outline_width: 1