Skip to content

Commit

Permalink
Updated the map presentation format for maps saved with the editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Aug 23, 2022
1 parent 652cccd commit 8dd04b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions interface/menus/LoadMapMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ MenuBase {
FileDialog {
id: select_map_dialog
title: qsTr("Select Map")
defaultSuffix: ".smp.gz"
defaultSuffix: ".wmp"
folder: "file:" + wyrmgus.user_maps_path
nameFilters: ["Stratagus Map Presentation Files (*.smp.gz *.smp)"]
nameFilters: ["Wyrmsun Map Presentation Files (*.wmp *.wmp.gz *.smp.gz *.smp)"]
selectExisting: true
sidebarVisible: false

Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ https://github.com/Andrettin/Wyrmsun
- The Alamanni, Chatti, Chauci, Hermunduri, Quadi, Ubii and Varini Tribes are now polities instead.
- Removed the Driftwood faction.

* Map Editor
- Updated the map presentation format for maps saved with the editor (old maps can still be loaded). The map presentation file extension is now ".wmp" instead of ".smp".

* Maps
- Added the "Gallic Fields" (256x256, 3 players) and "Gallic Highlands" custom maps (256x256, 2 players), based on maps from 0 A.D. (which are licensed under an open-source license).
- Removed the Annwn, Ulfdalir and Random Dungeon custom maps.
Expand Down
10 changes: 5 additions & 5 deletions scripts/menus/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ function RunEditorSaveMenu()

local t
local browser
t = menu:addTextInputField("map.smp",
t = menu:addTextInputField("map.wmp",
(384 - 300 - 18) / 2 * get_scale_factor(), (11 + 24) * get_scale_factor(), 318 * get_scale_factor())

browser = menu:addBrowser(get_user_maps_path(), ".smp$",
browser = menu:addBrowser(get_user_maps_path(), ".wmp$",
(384 - 300 - 18) / 2 * get_scale_factor(), (11 + 24 + 22) * get_scale_factor(), 318 * get_scale_factor(), 126 * get_scale_factor())

local function cb(s)
Expand All @@ -57,9 +57,9 @@ function RunEditorSaveMenu()
if (string.len(name) == 0) then
return
end
-- append .smp
if (string.find(name, ".smp$") == nil) then
name = name .. ".smp"
-- append .wmp
if (string.find(name, ".wmp$") == nil) then
name = name .. ".wmp"
end

-- replace invalid chars with underscore
Expand Down

0 comments on commit 8dd04b7

Please sign in to comment.