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 1/4] 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 From dcd356d73f68dee0026839be535ee5e178cc3d13 Mon Sep 17 00:00:00 2001 From: EnvyDragon <138727357+EnvyDragon@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:59:44 -0500 Subject: [PATCH 2/4] SC2: Made grid layout spacing consistent --- worlds/sc2/ClientGui.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worlds/sc2/ClientGui.py b/worlds/sc2/ClientGui.py index 81208fa2d88c..a0d09c0c282b 100644 --- a/worlds/sc2/ClientGui.py +++ b/worlds/sc2/ClientGui.py @@ -152,14 +152,14 @@ def build_mission_table(self, dt) -> None: for category in categories: category_name_height = 0 - category_spacing = 5 + category_spacing = 3 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_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=category_name_height, outline_width=1)) From 88ff77fad4e09557b2a410f125765d96a55417d7 Mon Sep 17 00:00:00 2001 From: EnvyDragon <138727357+EnvyDragon@users.noreply.github.com> Date: Sun, 21 Jan 2024 14:02:47 -0500 Subject: [PATCH 3/4] SC2: left-side padding increase for layout screen --- worlds/sc2/Starcraft2.kv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/sc2/Starcraft2.kv b/worlds/sc2/Starcraft2.kv index 5ea393d4aa1e..6b112c2f00a6 100644 --- a/worlds/sc2/Starcraft2.kv +++ b/worlds/sc2/Starcraft2.kv @@ -7,7 +7,7 @@ cols: 1 size_hint_y: None height: self.minimum_height + 15 - padding: [0,0,dp(12),0] + padding: [5,0,dp(12),0] : cols: 1 From d6f0fa181ca63b0998bf0609d46b1ed2ee69a7b5 Mon Sep 17 00:00:00 2001 From: EnvyDragon <138727357+EnvyDragon@users.noreply.github.com> Date: Sun, 21 Jan 2024 14:19:21 -0500 Subject: [PATCH 4/4] SC2: using enum for campaign check --- worlds/sc2/ClientGui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worlds/sc2/ClientGui.py b/worlds/sc2/ClientGui.py index a0d09c0c282b..167583fd1ecb 100644 --- a/worlds/sc2/ClientGui.py +++ b/worlds/sc2/ClientGui.py @@ -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 @@ -144,7 +144,7 @@ def build_mission_table(self, dt) -> None: 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) - if campaign.campaign_name != "Global": + if campaign != SC2Campaign.GLOBAL: campaign_layout.add_widget( Label(text=campaign.campaign_name, size_hint_y=None, height=25, outline_width=1) )