Skip to content

Commit

Permalink
Replaced the Lua diplomacy dialog with the new QML one
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Sep 11, 2021
1 parent fb221f4 commit 219cb49
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 136 deletions.
5 changes: 5 additions & 0 deletions interface/MapView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ Item {
preferences_dialog.open()
}
break
case Qt.Key_F9:
if (!wyrmgus.map_editor.running) {
diplomacy_dialog.open()
}
break
default:
break
}
Expand Down
1 change: 0 additions & 1 deletion interface/dialogs/GameMenuDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ DialogBase {

onClicked: {
options_dialog.open()
game_menu_dialog.opacity = 0
}
}

Expand Down
4 changes: 1 addition & 3 deletions interface/dialogs/OptionsDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ DialogBase {
interface_style: options_dialog.interface_style

onClicked: {
wyrmgus.call_lua_command("RunDiplomacyMenu();")
options_dialog.opacity = 0
diplomacy_dialog.open()
}
}

Expand All @@ -61,7 +60,6 @@ DialogBase {

onClicked: {
options_dialog.close()
game_menu_dialog.opacity = 1
}
}
}
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ https://github.com/Andrettin/Wyrmsun
- Fixed issue which caused dropdowns to gain keyboard focus when clicked.
- Fixed issue which caused text fields to not lose keyboard focus when clicked away from.
- Fixed issue which caused key events to be propagated to buttons even though a text field had focus.
- Reworked the in-game menu to be QML-based.

-----------------------------------------------------------------------
- 5.0.1
Expand Down
20 changes: 5 additions & 15 deletions scripts/commands.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
local function HandleIngameCommandKey(key, ctrl, alt, shift)
if (key == "f9") then
if (not IsNetworkGame()) then SetGamePaused(true) end
RunDiplomacyMenu()
else
return false
end
return true
end

local function HandleIneditorCommandKey(key, ctrl, alt, shift)
if (key == "f5") then -- Map property
RunEditorMapProperties()
Expand All @@ -24,11 +14,11 @@ local function HandleIneditorCommandKey(key, ctrl, alt, shift)
end

function HandlewarCommandKey(key, ctrl, alt, shift)
if (CEditor:get():is_running() == false) then
return HandleIngameCommandKey(key, ctrl, alt, shift)
else
return HandleIneditorCommandKey(key, ctrl, alt, shift)
end
if (CEditor:get():is_running()) then
return HandleIneditorCommandKey(key, ctrl, alt, shift)
else
return false
end
end

HandleCommandKey = HandlewarCommandKey
1 change: 0 additions & 1 deletion scripts/guichan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,6 @@ Load("scripts/menus/editor.lua")
Load("scripts/menus/game.lua")
Load("scripts/menus/help.lua")
Load("scripts/menus/objectives.lua")
Load("scripts/menus/diplomacy.lua")
Load("scripts/menus/results.lua")
Load("scripts/menus/network.lua")
Load("scripts/menus/mods.lua")
Expand Down
116 changes: 0 additions & 116 deletions scripts/menus/diplomacy.lua

This file was deleted.

0 comments on commit 219cb49

Please sign in to comment.