feat(mods): add official map selector mod template and move templates into mod-dev-docs
This commit is contained in:
1 parent
aa952e7cca
commit
6e65cec4c0
19 files changed
+574
-2
No files matched your search
+1
@@ -0,0 +1 @@
|
||||
@import "missions\mapPreferences.css"
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// Register the Custom Map Pool Selector DaGui stylesheet in the root CSS manifest.
|
||||
{
|
||||
"id": "official-map-selector/register-css",
|
||||
"title": "Include wtomapselector.css in gui/css.css",
|
||||
"features": [
|
||||
"Custom Map Pool Selector"
|
||||
],
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"file": "gui/css.css",
|
||||
"edits": [
|
||||
{
|
||||
"find": "find-css.css",
|
||||
"replace": "replace-css.css"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
@import "missions\mapPreferences.css"
|
||||
@import "missions\wtomapselector.css"
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
function updateButtons() {
|
||||
let wikiLinkBtn = showObjById("wiki_link", hasFeature("AllowExternalLink"), this.scene)
|
||||
wikiLinkBtn.link = getCurCircuitOverride("wikiMatchmakerURL", loc("url/wiki_matchmaker"))
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
from "dagor.workcycle" import defer
|
||||
import "%scripts/missions/mapPreferencesModal.nut" as mapPreferencesModal
|
||||
import "%scripts/missions/mapPreferencesParams.nut" as mapPreferencesParams
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// Wire the Custom Map Pool button in GameModeSelect to open the native WtoMapSelectorModal
|
||||
// for the currently selected game mode and display the target mode name on the button.
|
||||
{
|
||||
"id": "official-map-selector/mode-select-button-script",
|
||||
"title": "Wire Custom Map Pool button in GameModeSelect handler",
|
||||
"features": [
|
||||
"Custom Map Pool Selector"
|
||||
],
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"file": "scripts/gamemodes/gamemodeselect.nut",
|
||||
"edits": [
|
||||
{
|
||||
"find": "find-imports.nut",
|
||||
"replace": "replace-imports.nut"
|
||||
},
|
||||
{
|
||||
"find": "find-buttons.nut",
|
||||
"replace": "replace-buttons.nut"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
function updateButtons() {
|
||||
let wikiLinkBtn = showObjById("wiki_link", hasFeature("AllowExternalLink"), this.scene)
|
||||
wikiLinkBtn.link = getCurCircuitOverride("wikiMatchmakerURL", loc("url/wiki_matchmaker"))
|
||||
this.updateWtoMapSelectorButton()
|
||||
}
|
||||
|
||||
function updateWtoMapSelectorButton() {
|
||||
let btnObj = this.scene.findObject("wto_map_selector_button")
|
||||
if (!checkObj(btnObj))
|
||||
return
|
||||
let curGm = getCurrentGameMode()
|
||||
let hasMode = curGm != null
|
||||
btnObj.show(hasMode)
|
||||
btnObj.enable(hasMode)
|
||||
if (!hasMode)
|
||||
return
|
||||
let modeTitle = (curGm?.getText != null) ? curGm.getText() : (curGm?.id ?? "")
|
||||
btnObj.setValue(modeTitle != ""
|
||||
? loc("wto/mapSelector/btnWithMode", { mode = modeTitle })
|
||||
: loc("wto/mapSelector/btnTitle"))
|
||||
btnObj.tooltip = modeTitle != ""
|
||||
? loc("wto/mapSelector/btnTooltipWithMode", { mode = modeTitle })
|
||||
: loc("wto/mapSelector/btnTooltip")
|
||||
}
|
||||
|
||||
function onOpenWtoMapSelector(_obj) {
|
||||
let curGm = getCurrentGameMode()
|
||||
if (curGm == null)
|
||||
return
|
||||
wtoMapSelectorModal.open({ gameMode = curGm })
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
from "dagor.workcycle" import defer
|
||||
import "%scripts/missions/mapPreferencesModal.nut" as mapPreferencesModal
|
||||
import "%scripts/missions/mapPreferencesParams.nut" as mapPreferencesParams
|
||||
import "%scripts/missions/wtomapselectormodal.nut" as wtoMapSelectorModal
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
Button_text {
|
||||
id:t='back_button'
|
||||
text:t = '#mainmenu/btnBack'
|
||||
_on_click:t = 'goBack'
|
||||
btnName:t='B'
|
||||
ButtonImg {}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// Add the Custom Map Pool button on the right side of the Mode Selection footer bar.
|
||||
{
|
||||
"id": "official-map-selector/mode-select-button-tpl",
|
||||
"title": "Add Custom Map Pool button to Mode Selection template",
|
||||
"features": [
|
||||
"Custom Map Pool Selector"
|
||||
],
|
||||
"variants": [
|
||||
{
|
||||
"written_for": "2.61.0.58",
|
||||
"file": "gui/gamemodeselect/gamemodeselect.tpl",
|
||||
"edits": [
|
||||
{
|
||||
"find": "find-nav-right.tpl",
|
||||
"replace": "replace-nav-right.tpl"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
Button_text {
|
||||
id:t='wto_map_selector_button'
|
||||
text:t='#wto/mapSelector/btnTitle'
|
||||
tooltip:t='#wto/mapSelector/btnTooltip'
|
||||
on_click:t='onOpenWtoMapSelector'
|
||||
visualStyle:t='secondary'
|
||||
ButtonImg {}
|
||||
}
|
||||
|
||||
Button_text {
|
||||
id:t='back_button'
|
||||
text:t = '#mainmenu/btnBack'
|
||||
_on_click:t = 'goBack'
|
||||
btnName:t='B'
|
||||
ButtonImg {}
|
||||
}
|
||||
Reference in new issue
Block a user