From 99ee969f476aaf6951d38ae1ff5d1456473128c6 Mon Sep 17 00:00:00 2001 From: Andrettin Date: Tue, 21 Nov 2017 17:23:37 +0100 Subject: [PATCH] Update to the scenario display --- readme.txt | 2 ++ scripts/civilizations/dwarf/quests.lua | 2 +- scripts/menus/campaign.lua | 11 ++++++++--- scripts/menus/credits.lua | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/readme.txt b/readme.txt index 9f34e8ceba..3dd0b5a344 100644 --- a/readme.txt +++ b/readme.txt @@ -104,6 +104,8 @@ https://github.com/Andrettin/Wyrmsun - Added the Westward Migration scenario, replacing the quest of the same name. - Added the The Settlement of Scandinavia scenario, replacing the Northwards to the Sea and Gylve's Realm quests. - Scenarios that have not been completed yet will now be marked with a highlighted "(!)" in the scenario selection drop-down. +- Scenarios now display the faction the player uses in them in their description. +- Scenarios are now sorted by faction species (so that the dwarven scenarios are grouped together, as are human scenarios). * Units - Workers now use their sack-carrying graphics for when they are carrying furniture. diff --git a/scripts/civilizations/dwarf/quests.lua b/scripts/civilizations/dwarf/quests.lua index 96928b5722..664a10bb66 100644 --- a/scripts/civilizations/dwarf/quests.lua +++ b/scripts/civilizations/dwarf/quests.lua @@ -224,7 +224,7 @@ DefineQuest("the-burner", { -- based on the lay of Alvis from Norse mythology; S Civilization = "dwarf", PlayerColor = "red", Conditions = function(s) - if (GetPlayerData(trigger_player, "RaceName") == "dwarf" and GetPlayerData(trigger_player, "UnitTypesCount", "unit-dwarven-stronghold") > 0 and GetPlayerData(trigger_player, "Allow", "upgrade-dwarven-alchemy") == "A" and CheckDependency(trigger_player, "upgrade-dwarven-alchemy")) then -- should be made to require Alvis in the future, when he is added as a hero and there are more dwarven quests in general + if (GetPlayerData(trigger_player, "RaceName") == "dwarf" and GetPlayerData(trigger_player, "UnitTypesCount", "unit-dwarven-academy") > 0 and GetPlayerData(trigger_player, "Allow", "upgrade-dwarven-alchemy") == "A" and CheckDependency(trigger_player, "upgrade-dwarven-alchemy")) then -- should be made to require Alvis in the future, when he is added as a hero and there are more dwarven quests in general return true end return false diff --git a/scripts/menus/campaign.lua b/scripts/menus/campaign.lua index b479ab18fc..8a48878c29 100644 --- a/scripts/menus/campaign.lua +++ b/scripts/menus/campaign.lua @@ -34,6 +34,7 @@ function RunCampaignMenu() local campaign_description local highest_completed_difficulty + local faction_name local no_randomness local no_time_of_day local menu = WarMenu() @@ -92,7 +93,9 @@ function RunCampaignMenu() end local function compare_campaign(a, b) - if (GetCampaignData(a, "StartYear") ~= GetCampaignData(b, "StartYear")) then + if (GetCivilizationData(GetFactionData(GetCampaignData(a, "Faction"), "Civilization"), "Species") ~= GetCivilizationData(GetFactionData(GetCampaignData(b, "Faction"), "Civilization"), "Species")) then + return GetCivilizationData(GetFactionData(GetCampaignData(a, "Faction"), "Civilization"), "Species") < GetCivilizationData(GetFactionData(GetCampaignData(b, "Faction"), "Civilization"), "Species") + elseif (GetCampaignData(a, "StartYear") ~= GetCampaignData(b, "StartYear")) then return GetCampaignData(a, "StartYear") < GetCampaignData(b, "StartYear") else return a < b @@ -110,6 +113,8 @@ function RunCampaignMenu() end local function UpdateCampaignDescription() + faction_name = "Faction: " .. GetFactionData(GetCampaignData(campaign_ident_list[campaign_dd:getSelected() + 1], "Faction"), "Name") .. " (" .. GetCivilizationData(GetFactionData(GetCampaignData(campaign_ident_list[campaign_dd:getSelected() + 1], "Faction"), "Civilization"), "Display") .. ")" + highest_completed_difficulty = "Highest Completed Difficulty: " if (GetQuestData(campaign_ident_list[campaign_dd:getSelected() + 1], "HighestCompletedDifficulty") == 1) then highest_completed_difficulty = highest_completed_difficulty .. "Easy" @@ -123,7 +128,7 @@ function RunCampaignMenu() highest_completed_difficulty = highest_completed_difficulty .. "None" end - campaign_description:setCaption("Description: " .. GetCampaignData(campaign_ident_list[campaign_dd:getSelected() + 1], "Description") .. "\n\n" .. highest_completed_difficulty) + campaign_description:setCaption(faction_name .. "\n\n" .. "Description: " .. GetCampaignData(campaign_ident_list[campaign_dd:getSelected() + 1], "Description") .. "\n\n" .. highest_completed_difficulty) campaign_description:adjustSize() end @@ -142,7 +147,7 @@ function RunCampaignMenu() SetCurrentCampaign(campaign_ident_list[1]) end - campaign_description = menu:addMultiLineLabel("", ((Video.Width - 640) / 2) + 32, offy + 104 + 36*2, Fonts["game"], false, Video.Width - (Video.Width - 640) - 64) + campaign_description = menu:addMultiLineLabel("", ((Video.Width - 640) / 2) + 32, offy + 104 + 36*1.5, Fonts["game"], false, Video.Width - (Video.Width - 640) - 64) UpdateCampaignDescription() diff --git a/scripts/menus/credits.lua b/scripts/menus/credits.lua index 31f9d397c0..77c30338c1 100644 --- a/scripts/menus/credits.lua +++ b/scripts/menus/credits.lua @@ -38,6 +38,7 @@ function RunShowCreditsMenu() _("Programming and Scripting"), " Andrettin", " cybermind", + " Franco514", " Francois Beerten", " Jimmy Salmon", " Joris Dauphin",