Skip to content

Commit

Permalink
Update to the scenario display
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Nov 21, 2017
1 parent 6adacd0 commit 99ee969
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion scripts/civilizations/dwarf/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions scripts/menus/campaign.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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

Expand All @@ -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()

Expand Down
1 change: 1 addition & 0 deletions scripts/menus/credits.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function RunShowCreditsMenu()
_("Programming and Scripting"),
" Andrettin",
" cybermind",
" Franco514",
" Francois Beerten",
" Jimmy Salmon",
" Joris Dauphin",
Expand Down

0 comments on commit 99ee969

Please sign in to comment.