diff options
Diffstat (limited to 'TemplePushing.c4s/Misc.c4d/SetupMenu.c4d')
| -rw-r--r-- | TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/DefCore.txt | 10 | ||||
| -rw-r--r-- | TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/DescDE.txt | 1 | ||||
| -rw-r--r-- | TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/DescUS.txt | 1 | ||||
| -rw-r--r-- | TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Graphics.png | bin | 0 -> 4315 bytes | |||
| -rw-r--r-- | TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Names.txt | 2 | ||||
| -rw-r--r-- | TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Script.c | 243 | ||||
| -rw-r--r-- | TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/StringTblDE.txt | 14 | ||||
| -rw-r--r-- | TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/StringTblUS.txt | 14 |
8 files changed, 285 insertions, 0 deletions
diff --git a/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/DefCore.txt b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/DefCore.txt new file mode 100644 index 0000000..01a88ad --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/DefCore.txt @@ -0,0 +1,10 @@ +[DefCore] +id=SPMU +Name=Setup Menu +Version=4,9,5 +Category=C4D_StaticBack +Width=1 +Height=1 +Picture=0,0,64,64 +Timer=1 +TimerCall=KeepMenuOpen diff --git a/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/DescDE.txt b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/DescDE.txt new file mode 100644 index 0000000..aa1c8e5 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/DescDE.txt @@ -0,0 +1 @@ +Einstellungsmenü das beim Start des Szenarios angezeigt wird.
\ No newline at end of file diff --git a/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/DescUS.txt b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/DescUS.txt new file mode 100644 index 0000000..e694245 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/DescUS.txt @@ -0,0 +1 @@ +Setup menu shown at the beginning of the scenario.
\ No newline at end of file diff --git a/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Graphics.png b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Graphics.png Binary files differnew file mode 100644 index 0000000..638c255 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Graphics.png diff --git a/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Names.txt b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Names.txt new file mode 100644 index 0000000..568f093 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Names.txt @@ -0,0 +1,2 @@ +DE:Einstellungsmenü +US:Setup Menu
\ No newline at end of file diff --git a/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Script.c b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Script.c new file mode 100644 index 0000000..0577e73 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/Script.c @@ -0,0 +1,243 @@ +/*-- Setup Menu --*/ + +#strict 2 + +static const + SETTING_Deathmatch = 0, SETTING_Extinguisher = 1, SETTING_FriendlyPushing = 2, SETTING_RotateInJump = 3, + SETTING_RelaunchesInc = 4, SETTING_RelaunchesDec = 5, + SETTING_DeathmatchScoreInc = 6, SETTING_DeathmatchScoreDec = 7, + SETTING_Ambience = 8; + +local Sections, Modes; +local clonk, setupPlayer; + +// Selected values +local section, mode; +local extinguisherEnabled, friendlyPushingEnabled, rotateInJumpEnabled; +local ambienceEnabled; +local numRelaunches; +local deathmatchEnabled, deathmatchWinScore; + +protected func Initialize() +{ + Sections = []; + for (var i = 0, def; def = GetDefinition(i, C4D_StaticBack); ++i) + { + if (DefinitionCall(def, "SectionName")) Sections[GetLength(Sections)] = def; + } + section = Sections[0]; + + Modes = [ + [MODE_Classic, "$ModeClassic$", ROCK], + [MODE_SuddenDeath, "$ModeSuddenDeath$", SDDT], + [MODE_Magic, "$ModeMagic$", SMGC], + [MODE_Apocalyptic, "$ModeApocalyptic$", APCE]]; +} + +private func ShowSetup() +{ + ShowMessage(); + ShowSectionMenu(); +} + +private func ShowSectionMenu() +{ + CreateMenu(GetID(), clonk, 0, C4MN_Extra_None, 0, 0, C4MN_Style_Context); + + for (var i = 0; i < GetLength(Sections); ++i) + { + clonk->AddMenuItem(GetName(0, Sections[i]), Format("SelectSection(%i)", Sections[i]), Sections[i]); + CheckPreselect(Sections[i] == section, i); + } +} + +private func SelectSection(id selectedSection) +{ + section = selectedSection; + ShowMessage(); + + ShowModeMenu(); +} + +private func ShowModeMenu() +{ + CreateMenu(GetID(), clonk, 0, C4MN_Extra_None, 0, 0, C4MN_Style_Context); + + var menuItemIndex = 0; + for (var m in Modes) + { + clonk->AddMenuItem(m[1], Format("SelectMode(%d)", m[0]), m[2]); + CheckPreselect(m[0] == mode, menuItemIndex++); + } + + clonk->AddMenuItem("$Back$", "ShowSectionMenu()", ROCK); +} + +private func SelectMode(int selectedMode) +{ + mode = selectedMode; + if (mode == MODE_SuddenDeath) deathmatchEnabled = false; + ShowMessage(); + + ShowSettingsMenu(); +} + +private func ShowSettingsMenu(bool preselect, int selectedSetting) +{ + CreateMenu(GetID(), clonk, 0, C4MN_Extra_None, 0, 0, C4MN_Style_Context); + + var menuItemIndex = 0; + + // Deathmatch entry + if (mode != MODE_SuddenDeath) + { + AddOptionMenuItem(GetName(0, DTHM), deathmatchEnabled, "SelectSetting(SETTING_Deathmatch)", DTHM); + CheckPreselect(preselect && selectedSetting == SETTING_Deathmatch, menuItemIndex++); + } + + // Extinguisher entry + AddOptionMenuItem(GetName(0, _ETG), extinguisherEnabled, "SelectSetting(SETTING_Extinguisher)", _ETG); + CheckPreselect(preselect && selectedSetting == SETTING_Extinguisher, menuItemIndex++); + + // "Friendly Pushing" entry + AddOptionMenuItem(GetName(0, FYPG), friendlyPushingEnabled, "SelectSetting(SETTING_FriendlyPushing)", FYPG); + CheckPreselect(preselect && selectedSetting == SETTING_FriendlyPushing, menuItemIndex++); + + // "Turn in jump" entry + AddOptionMenuItem(GetName(0, RIJP), rotateInJumpEnabled, "SelectSetting(SETTING_RotateInJump)", RIJP); + CheckPreselect(preselect && selectedSetting == SETTING_RotateInJump, menuItemIndex++); + + // Ambience entry + AddOptionMenuItem("$Ambience$", ambienceEnabled, "SelectSetting(SETTING_Ambience)", SABC); + CheckPreselect(preselect && selectedSetting == SETTING_Ambience, menuItemIndex++); + + if (!deathmatchEnabled) + { + clonk->AddMenuItem("$Relaunches$ +", "SelectSetting(SETTING_RelaunchesInc)", SKUL); + CheckPreselect(preselect && selectedSetting == SETTING_RelaunchesInc, menuItemIndex++); + clonk->AddMenuItem("$Relaunches$ -", "SelectSetting(SETTING_RelaunchesDec)", SKUL); + CheckPreselect(preselect && selectedSetting == SETTING_RelaunchesDec, menuItemIndex++); + } + else + { + clonk->AddMenuItem("$Kills$ +", "SelectSetting(SETTING_DeathmatchScoreInc)", SWOR); + CheckPreselect(preselect && selectedSetting == SETTING_DeathmatchScoreInc, menuItemIndex++); + clonk->AddMenuItem("$Kills$ -", "SelectSetting(SETTING_DeathmatchScoreDec)", SWOR); + CheckPreselect(preselect && selectedSetting == SETTING_DeathmatchScoreDec, menuItemIndex++); + } + + clonk->AddMenuItem("$Done$", "SetupDone()", GOLD); + CheckPreselect(!preselect, menuItemIndex++); + clonk->AddMenuItem("$Back$", "ShowModeMenu()", ROCK); +} + +private func SelectSetting(int selectedSetting) +{ + if (selectedSetting == SETTING_Deathmatch) + { + deathmatchEnabled = !deathmatchEnabled; + } + else if (selectedSetting == SETTING_Extinguisher) + { + extinguisherEnabled = !extinguisherEnabled; + } + else if (selectedSetting == SETTING_FriendlyPushing) + { + friendlyPushingEnabled = !friendlyPushingEnabled; + } + else if (selectedSetting == SETTING_RotateInJump) + { + rotateInJumpEnabled = !rotateInJumpEnabled; + } + else if (selectedSetting == SETTING_Ambience) + { + ambienceEnabled = !ambienceEnabled; + } + else if (selectedSetting == SETTING_RelaunchesInc) + { + ++numRelaunches; + } + else if (selectedSetting == SETTING_RelaunchesDec) + { + numRelaunches = Max(numRelaunches - 1, 0); + } + else if (selectedSetting == SETTING_DeathmatchScoreInc) + { + ++deathmatchWinScore; + } + else if (selectedSetting == SETTING_DeathmatchScoreDec) + { + deathmatchWinScore = Max(deathmatchWinScore - 1, 1); + } + + ShowMessage(); + + ShowSettingsMenu(true, selectedSetting); +} + +private func SetupDone() +{ + ShowMessage(); + GameCall("StartGame", this, GetMessage()); +} + +private func AddOptionMenuItem(string caption, bool enabled, string command, id idItem) +{ + clonk->AddMenuItem(IIf(enabled, caption, Format("<c a0a0a0>%s</c>", caption)), command, idItem); +} + +private func CheckPreselect(bool preselect, int menuItemIndex) +{ + if (preselect) clonk->SelectMenuItem(menuItemIndex); +} + +private func KeepMenuOpen() +{ + // Find new player? + if (!GetPlayerID(setupPlayer)) + { + clonk = 0; + if (GetPlayerCount() == 0) return; + setupPlayer = GetPlayerByIndex(0); + } + + // Find clonk + if (!clonk || !clonk->GetAlive()) clonk = GetCrew(setupPlayer); + + // (Re)open menu + if (clonk && !clonk->GetMenu()) ShowSetup(); +} + +private func ShowMessage() { Message("@%s", 0, GetMessage()); } + +private func GetMessage() +{ + var msgSection = Format("$Landscape$: %s", GetName(0, section)); + + var msgMode; + for (var m in Modes) + { + if (m[0] == mode) + { + msgMode = Format("$Mode$: {{%i}} %s", m[2], m[1]); + break; + } + } + + var msgWinScore; + if (!deathmatchEnabled) + { + msgWinScore = Format("{{SKUL}} $Relaunches$: %d", numRelaunches); + } + else + { + msgWinScore = Format("{{SWOR}} %s: %d $Kills$", GetName(0, DTHM), deathmatchWinScore); + } + + var msgExtinguisher = Format("{{_ETG}} %s: %s", GetName(0, _ETG), IIf(extinguisherEnabled, "$Enabled$", "$Disabled$")); + var msgFriendlyPushing = Format("{{FYPG}} %s: %s", GetName(0, FYPG), IIf(friendlyPushingEnabled, "$Enabled$", "$Disabled$")); + var msgRotateInJump = Format("{{RIJP}} %s: %s", GetName(0, RIJP), IIf(rotateInJumpEnabled, "$Enabled$", "$Disabled$")); + var msgAmbience = Format("{{SABC}} $Ambience$: %s", IIf(ambienceEnabled, "$Enabled$", "$Disabled$")); + + return Format("%s|%s|%s|%s|%s|%s|%s", msgSection, msgMode, msgWinScore, msgExtinguisher, msgFriendlyPushing, msgRotateInJump, msgAmbience); +}
\ No newline at end of file diff --git a/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/StringTblDE.txt b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/StringTblDE.txt new file mode 100644 index 0000000..bd28a61 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/StringTblDE.txt @@ -0,0 +1,14 @@ +ModeClassic=Klassisches Schubsen +ModeSuddenDeath=<c ffff00>Sudden Death</c> +ModeMagic=<c 0000ff>Magisches Schubsen</c> +ModeApocalyptic=<c ff0000>Apokalyptisches Schubsen</c> +Back=Zurück +Done=Fertig +Relaunches=Relaunches +Kills=Kills +SectionClassic=Klassisch +Landscape=Landschaft +Mode=Modus +Enabled=Aktiviert +Disabled=Deaktiviert +Ambience=Ambiente diff --git a/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/StringTblUS.txt b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/StringTblUS.txt new file mode 100644 index 0000000..cd1f9c1 --- /dev/null +++ b/TemplePushing.c4s/Misc.c4d/SetupMenu.c4d/StringTblUS.txt @@ -0,0 +1,14 @@ +ModeClassic=Classic Pushing +ModeSuddenDeath=<c ffff00>Sudden Death</c> +ModeMagic=<c 0000ff>Magical Pushing</c> +ModeApocalyptic=<c ff0000>Apocalyptical Pushing</c> +Back=Back +Done=Done +Relaunches=Relaunches +Kills=Kills +SectionClassic=Classic +Landscape=Landscape +Mode=Mode +Enabled=Enabled +Disabled=Disabled +Ambience=Ambience |
