From ec5bae2bbb033b91c3431953c8aba4fecf1da1ad Mon Sep 17 00:00:00 2001 From: sparrow Date: Wed, 22 Apr 2020 15:48:03 +0100 Subject: [PATCH] Removed MAster for 2 new branches --- Advanced Cheat Menu | 1 - CheatMenuPanel.modinfo | 76 ------ README.md | 4 +- UI/Panels/Cheat_Menu_Panel_Functions.lua | 281 ----------------------- UI/Panels/Cheat_Panel_World_Tracker.lua | 150 ------------ UI/Panels/Cheat_Panel_World_Tracker.xml | 117 ---------- UI/Popups/Raze_City_Reminder_Popup.lua | 123 ---------- UI/Popups/Raze_City_Reminder_Popup.xml | 54 ----- UI/Script/Cheat_Menu_Panel_Script.lua | 220 ------------------ UI/Text/Input_Config.xml | 57 ----- UI/Text/Localisation.sql | 192 ---------------- UI/Text/Options_Text.xml | 69 ------ 12 files changed, 2 insertions(+), 1342 deletions(-) delete mode 100644 Advanced Cheat Menu delete mode 100644 CheatMenuPanel.modinfo delete mode 100644 UI/Panels/Cheat_Menu_Panel_Functions.lua delete mode 100644 UI/Panels/Cheat_Panel_World_Tracker.lua delete mode 100644 UI/Panels/Cheat_Panel_World_Tracker.xml delete mode 100644 UI/Popups/Raze_City_Reminder_Popup.lua delete mode 100644 UI/Popups/Raze_City_Reminder_Popup.xml delete mode 100644 UI/Script/Cheat_Menu_Panel_Script.lua delete mode 100644 UI/Text/Input_Config.xml delete mode 100644 UI/Text/Localisation.sql delete mode 100644 UI/Text/Options_Text.xml diff --git a/Advanced Cheat Menu b/Advanced Cheat Menu deleted file mode 100644 index f3229c5..0000000 --- a/Advanced Cheat Menu +++ /dev/null @@ -1 +0,0 @@ -.. diff --git a/CheatMenuPanel.modinfo b/CheatMenuPanel.modinfo deleted file mode 100644 index 6df84e3..0000000 --- a/CheatMenuPanel.modinfo +++ /dev/null @@ -1,76 +0,0 @@ - - - - [COLOR_LIGHTBLUE]Advanced Cheat Menu (Light)[ENDCOLOR] - LOC_MOD_ADVANCED_CHEAT_MENU_DESCRIPTION - LOC_MOD_ADVANCED_CHEAT_MENU_TEASER - Sparrow - 0 - 0 - 1 - 1.2,2.0 - - - - Adds A Menu With Selected Cheat Options For InGame.[NEWLINE][NEWLINE][NEWLINE]Add +1000 [ICON_Faith][NEWLINE]Add +1000 [ICON_Gold][NEWLINE]Complete Production in Selected City[NEWLINE]Complete Current Reaserching Civic[NEWLINE]Complete Current Reaserching Tech[NEWLINE]Add +5 Envoy[NEWLINE]Add +10 Era Points[NEWLINE]Add +1 Governor Title Point[NEWLINE]Restore Selected Unit Movement + Attack[NEWLINE]Restore Selected Unit Health[NEWLINE]Give +1 Promotion to Selected Unit[NEWLINE]Add +5 Movement to Selected Unit[NEWLINE]Duplicate Selected Unit (NOT for Great Persons and Religious Units)[NEWLINE]Add +1 Population to Selected City[NEWLINE]Add FULL Loyalty to Selected City [NEWLINE]Complete All Tech Research[NEWLINE]Complete All Civic Research[NEWLINE]Raze Selected City[NEWLINE]Toggle Map Observer - Aggiunge un menu con le opzioni cheat selezionate per InGame.[NEWLINE][NEWLINE][NEWLINE]Add +1000 [ICON_Faith][NEWLINE]Add +1000 [ICON_Gold][NEWLINE]Complete Production in Selected City[NEWLINE]Complete Current Reaserching Civic[NEWLINE]Complete Current Reaserching Tech[NEWLINE]Add +5 Envoy[NEWLINE]Add +10 Era Points[NEWLINE]Add +1 Governor Title Point[NEWLINE]Restore Selected Unit Movement + Attack[NEWLINE]Restore Selected Unit Health[NEWLINE]Give +1 Promotion to Selected Unit[NEWLINE]Add +5 Movement to Selected Unit[NEWLINE]Duplicate Selected Unit (NOT for Great Persons and Religious Units)[NEWLINE]Add +1 Population to Selected City[NEWLINE]Add FULL Loyalty to Selected City [NEWLINE]Complete All Tech Research[NEWLINE]Complete All Civic Research[NEWLINE]Raze Selected City[NEWLINE]Toggle Map Observer - ゲーム内にチートオプションを選択するメニューを追加します。[NEWLINE][NEWLINE][NEWLINE]信仰を追加 +1000 [ICON_Faith][NEWLINE]ゴールドを追加 +1000 [ICON_Gold][NEWLINE]選択中の都市の生産完了[NEWLINE]社会制度完了[NEWLINE]研究完了[NEWLINE]代表団を追加 +5[NEWLINE]時代スコアを加算 +10[NEWLINE]総督の称号を追加 +1[NEWLINE]選択中のユニットを行動可能にします[NEWLINE]選択中のユニットの体力を回復[NEWLINE]選択中のユニットをレベルアップ +1[NEWLINE]選択中のユニットの移動力を追加 +5[NEWLINE]選択中のユニットを複製 (偉人や宗教ユニットを除く)[NEWLINE]選択中の都市の人口を追加 +1[NEWLINE]選択中の都市の忠誠心を追加[NEWLINE]全ての研究完了[NEWLINE]全ての社会制度完了[NEWLINE]選択中の都市を完全に破壊[NEWLINE]「戦場の霧」の表示切り替え - 在游戏内增加了一个作弊面板[NEWLINE][NEWLINE][NEWLINE]+1000 [ICON_Faith][NEWLINE]+1000 [ICON_Gold][NEWLINE]完成所选城市当前的生产[NEWLINE]完成当前科技研究[NEWLINE]完成当前市政研究[NEWLINE]+5使者[NEWLINE]+10时代得分[NEWLINE]+1总督头衔[NEWLINE]恢复所选单位的移动力[NEWLINE]治疗所选单位[NEWLINE]升级所选单位[NEWLINE]所选单位加+5移动力[NEWLINE]复制所选单位(不适用于伟人和宗教单位)[NEWLINE]所选城市+1人口[NEWLINE]所选城市加满忠诚度[NEWLINE]完成所有科研[NEWLINE]完成所有市政[NEWLINE]摧毁城市[NEWLINE]切换到地图观察模式 - - - Adds A Menu With Selected Cheat Options For InGame. - Aggiunge un menu con le opzioni cheat selezionate per InGame. - ゲーム内にチートオプションを選択するメニューを追加します - 在游戏内增加了一个作弊面板 - - - - - UI/Text/Input_Config.xml - - - UI/Text/Options_Text.xml - - - - - - 900 - - UI/Script/Cheat_Menu_Panel_Script.lua - - - - InGame - - - UI/Popups/Raze_City_Reminder_Popup.xml - UI/Panels/Cheat_Panel_World_Tracker.xml - - - - - 900 - - UI/Script/Cheat_Menu_Panel_Script.lua - UI/Popups/Raze_City_Reminder_Popup.lua - UI/Panels/Cheat_Panel_World_Tracker.lua - UI/Panels/Cheat_Menu_Panel_Functions.lua - - - UI/Text/Options_Text.xml - UI/Text/Localisation.sql - - - - UI/Script/Cheat_Menu_Panel_Script.lua - UI/Popups/Raze_City_Reminder_Popup.lua - UI/Popups/Raze_City_Reminder_Popup.xml - UI/Panels/Cheat_Panel_World_Tracker.xml - UI/Panels/Cheat_Panel_World_Tracker.lua - UI/Panels/Cheat_Menu_Panel_Functions.lua - UI/Text/Options_Text.xml - UI/Text/Localisation.sql - UI/Text/Input_Config.xml - - \ No newline at end of file diff --git a/README.md b/README.md index 435f121..8207e75 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Advanced-Cheat-Menu +# Cheat Menu Advanced -This Mod Adds A Menu Panel With Selected Cheat Options For InGame. +# Cheat Menu Light ## Key Features diff --git a/UI/Panels/Cheat_Menu_Panel_Functions.lua b/UI/Panels/Cheat_Menu_Panel_Functions.lua deleted file mode 100644 index c8454b2..0000000 --- a/UI/Panels/Cheat_Menu_Panel_Functions.lua +++ /dev/null @@ -1,281 +0,0 @@ --- // ---------------------------------------------------------------------------------------------- --- // Author: Sparrow --- // DateCreated: 01/24/2019 2:27:04 PM --- // ---------------------------------------------------------------------------------------------- -include("Civ6Common"); -include("InstanceManager"); -include("SupportFunctions"); -include("PopupDialog"); -include("AnimSidePanelSupport"); - -local playerID = Game.GetLocalPlayer(); -local pPlayer = Players[playerID]; -local pTreasury = pPlayer:GetTreasury(); -local pReligion = pPlayer:GetReligion(); -local pEnvoy = pPlayer:GetInfluence(); -local pVis = PlayersVisibility[playerID]; -local pNewGP = 1; -local pNewEnvoy = 5; -local pNewReligion = 1000; -local pNewFavor = 100; -local m_hideCheatPanel = false; -local m_IsLoading:boolean = false; -local m_IsAttached:boolean = false; - --- // ---------------------------------------------------------------------------------------------- --- // MENU BUTTON FUNCTIONS --- // ---------------------------------------------------------------------------------------------- -function ChangeEraScore() - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.ChangeEraScore(playerID); - end - RefreshActionPanel(); -end -function ChangeEraScoreBack() - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.ChangeEraScoreBack(playerID); - end - RefreshActionPanel(); -end -function ChangeGold() - local pNewGold = 1000 - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.ChangeGold(playerID, pNewGold); - end -end -function ChangeGoldMore() - local pNewGold = 100000; - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.ChangeGold(playerID, pNewGold); - end -end -function CompleteProduction() - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.CompleteProduction(playerID); - end -end -function CompleteAllResearch() - local pTechs = pPlayer:GetTechs() - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.CompleteAllResearch(playerID); - end -end -function CompleteAllCivic() - local pTechs = pPlayer:GetCulture() - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.CompleteAllCivic(playerID); - end -end -function CompleteResearch() - local pTechs = pPlayer:GetTechs() - local pRTech = pTechs:GetResearchingTech() - if pRTech >= 0 then - local pCost = pTechs:GetResearchCost(pRTech) - local pProgress = pTechs:GetResearchProgress(pRTech) - local pResearchComplete = (pCost - pProgress) - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.CompleteResearch(playerID, pResearchComplete); - end - end -end -function CompleteCivic() - local pCivics = pPlayer:GetCulture() - local pRCivic = pCivics:GetProgressingCivic() - if pRCivic >= 0 then - local pCost = pCivics:GetCultureCost(pRCivic) - local pProgress = pCivics:GetCulturalProgress(pRCivic) - local pCivicComplete = (pCost - pProgress) - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.CompleteCivic(playerID, pCivicComplete); - end - end -end -function ChangeFaith() - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.ChangeFaith(playerID, pNewReligion); - end -end -function ChangePopulation() - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.ChangePopulation(playerID); - end -end -function RestoreCityHealth() - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.RestoreCityHealth(playerID); - end -end -function ChangeCityLoyalty() - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.ChangeCityLoyalty(playerID); - end -end -function DestroyCity() - local pCity = UI.GetHeadSelectedCity(); - if pCity ~= nil and pPlayer:IsHuman() then - local pCityName:string = Locale.Lookup(pCity:GetName()); - local pCityPop:string = Locale.Lookup(pCity:GetPopulation()); - ExposedMembers.MOD_CheatMenu.DestroyCity(playerID); - end -end ---function FreeCity() --- if pCity ~= nil and pPlayer:IsHuman() then --- ExposedMembers.MOD_CheatMenu.FreeCity(playerID); --- end ---end -function UnitPromote() - local pUnit = UI.GetHeadSelectedUnit(); - if pUnit ~= nil and pPlayer:IsHuman() then - local unitID = pUnit:GetID(); - ExposedMembers.MOD_CheatMenu.UnitPromote(playerID, unitID); - UI:DeselectUnitID(unitID); - UI:SelectUnitID(unitID); - end -end -function UnitMovementChange() - local pUnit = UI.GetHeadSelectedUnit(); - if pUnit ~= nil and pPlayer:IsHuman() then - local unitID = pUnit:GetID(); - ExposedMembers.MOD_CheatMenu.UnitMovementChange(playerID, unitID); - UI:DeselectUnitID(unitID); - UI:SelectUnitID(unitID); - end -end -function UnitAddMovement() - local pUnit = UI.GetHeadSelectedUnit(); - if pUnit ~= nil and pPlayer:IsHuman() then - local unitID = pUnit:GetID(); - ExposedMembers.MOD_CheatMenu.UnitAddMovement(playerID, unitID); - UI:DeselectUnitID(unitID); - UI:SelectUnitID(unitID); - end -end -function OnDuplicate() - local pUnit = UI.GetHeadSelectedUnit(); - if pUnit ~= nil and pPlayer:IsHuman() then - local unitID = pUnit:GetID(); - local unitType:string = GameInfo.Units[pUnit:GetUnitType()].UnitType; - ExposedMembers.MOD_CheatMenu.OnDuplicate(playerID, unitID, unitType); - end -end -function UnitHealChange() - local pUnit = UI.GetHeadSelectedUnit(); - if pUnit ~= nil and pPlayer:IsHuman() then - local unitID = pUnit:GetID(); - ExposedMembers.MOD_CheatMenu.UnitHealChange(playerID, unitID); - UI:DeselectUnitID(unitID); - UI:SelectUnitID(unitID); - end -end -function UnitFormCorps() - local pUnit = UI.GetHeadSelectedUnit(); - if pUnit ~= nil and pPlayer:IsHuman() then - local unitID = pUnit:GetID(); - ExposedMembers.MOD_CheatMenu.UnitFormCorps(playerID, unitID); - UI:DeselectUnitID(unitID); - UI:SelectUnitID(unitID); - end -end -function UnitFormArmy() - local pUnit = UI.GetHeadSelectedUnit(); - if pUnit ~= nil and pPlayer:IsHuman() then - local unitID = pUnit:GetID(); - ExposedMembers.MOD_CheatMenu.UnitFormArmy(playerID, unitID); - UI:DeselectUnitID(unitID); - UI:SelectUnitID(unitID); - end -end -function ChangeEnvoy() - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.ChangeEnvoy(playerID, pNewEnvoy); - end -end -function ChangeDiplomaticFavor() - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.ChangeDiplomaticFavor(playerID, pNewFavor); - end -end -function ChangeGovPoints() - if pPlayer:IsHuman() then - ExposedMembers.MOD_CheatMenu.ChangeGovPoints(playerID, pNewGP); - end -end -function RevealAll() - if pPlayer:IsHuman() then - LuaEvents.ChangeFOW(playerID) - ExposedMembers.MOD_CheatMenu.RevealAll(playerID); - end -end - -function RefreshActionPanel() - if pPlayer:IsHuman() then - local UPContextPtr :table = ContextPtr:LookUpControl("/InGame/ActionPanel"); - if UPContextPtr ~= nil then - UPContextPtr:RequestRefresh(); - end - end - ContextPtr:RequestRefresh(); -end - --- // ---------------------------------------------------------------------------------------------- --- // HOTKEYS --- // ---------------------------------------------------------------------------------------------- -function OnInputActionTriggered( actionId ) - if ( actionId == Input.GetActionId("ToggleGold") ) then - ChangeGold(); - end - if ( actionId == Input.GetActionId("ToggleGoldMore") ) then - ChangeGoldMore(); - end - if ( actionId == Input.GetActionId("ToggleFaith") ) then - ChangeFaith(); - end - if ( actionId == Input.GetActionId("ToggleCProduction") ) then - CompleteProduction(); - end - if ( actionId == Input.GetActionId("ToggleCCivic") ) then - CompleteCivic(); - end - if ( actionId == Input.GetActionId("ToggleCResearch") ) then - CompleteResearch(); - end - if ( actionId == Input.GetActionId("ToggleEnvoy") ) then - ChangeEnvoy(); - end - if ( actionId == Input.GetActionId("ToggleEra") ) then - ChangeEraScore(); - end - if ( actionId == Input.GetActionId("ToggleObs") ) then - RevealAll(); - end - if ( actionId == Input.GetActionId("ToggleUnitMovementChange") ) then - UnitMovementChange(); - end - if ( actionId == Input.GetActionId("ToggleUnitHealChange") ) then - UnitHealChange(); - end - if ( actionId == Input.GetActionId("ToggleUnitPromote") ) then - UnitPromote(); - end - if ( actionId == Input.GetActionId("ToggleDuplicate") ) then - OnDuplicateUnit(); - end - if ( actionId == Input.GetActionId("ToggleChangePopulation") ) then - ChangePopulation(); - end - if ( actionId == Input.GetActionId("ToggleChangeCityLoyalty") ) then - ChangeCityLoyalty(); - end - if ( actionId == Input.GetActionId("ToggleCompleteAllResearch") ) then - CompleteAllResearch(); - end - if ( actionId == Input.GetActionId("ToggleCompleteAllCivic") ) then - CompleteAllCivic(); - end - if ( actionId == Input.GetActionId("ToggleMenu") ) then - OnMenuButtonToggle(); - end - if ( actionId == Input.GetActionId("ToggleDiplomaticFavor") ) then - ChangeDiplomaticFavor(); - end -end \ No newline at end of file diff --git a/UI/Panels/Cheat_Panel_World_Tracker.lua b/UI/Panels/Cheat_Panel_World_Tracker.lua deleted file mode 100644 index 681dbad..0000000 --- a/UI/Panels/Cheat_Panel_World_Tracker.lua +++ /dev/null @@ -1,150 +0,0 @@ --- // ---------------------------------------------------------------------------------------------- --- // Author: Sparrow --- // DateCreated: 01/24/2019 2:27:04 PM --- // ---------------------------------------------------------------------------------------------- -include("Cheat_Menu_Panel_Functions"); - -local m_CheatPanelState:number = 0; - -function AttachPanelToWorldTracker() - if (m_IsLoading) then - return; - end - if (not m_IsAttached) then - local worldTrackerPanel:table = ContextPtr:LookUpControl("/InGame/WorldTracker/PanelStack"); - if (worldTrackerPanel ~= nil) then - Controls.CheatPanel:ChangeParent(worldTrackerPanel); - worldTrackerPanel:AddChildAtIndex(Controls.CheatPanel, 1); - worldTrackerPanel:CalculateSize(); - worldTrackerPanel:ReprocessAnchoring(); - m_IsAttached = true; - end - end -end - --- // ---------------------------------------------------------------------------------------------- --- // Attach Panel To WorldTracker --- // ---------------------------------------------------------------------------------------------- -function OnLoadGameViewStateDone() - AttachPanelToWorldTracker(); -end - --- // ---------------------------------------------------------------------------------------------- --- // Panel Control and Checkbox Attach --- // ---------------------------------------------------------------------------------------------- -function UpdateCheatPanel(hideCheatPanel:boolean) - m_hideCheatPanel = hideCheatPanel; - Controls.CheatPanel:SetHide(m_hideCheatPanel); - Controls.ToggleCheatPanel:SetCheck(not m_hideCheatPanel); -end -function InitDropdown() - local parent = ContextPtr:LookUpControl("/InGame/WorldTracker/CivicsCheckButton", Controls.PanelStack ); - if parent == nil then return end; - Controls.CheatPanelStack:ChangeParent(parent); - parent.ReprocessAnchoring(); - Events.LoadGameViewStateDone.Remove(InitDropdown); -end -function OnPanelTitleClicked() - if(m_CheatPanelState == 0) then - UI.PlaySound("Tech_Tray_Slide_Open"); - Controls.CheatPanel:SetSizeY(225); - Controls.ButtonStackMIN:SetHide(false); - Controls.ButtonSep:SetHide(false); - m_CheatPanelState = 1; - - else - UI.PlaySound("Tech_Tray_Slide_Closed"); - Controls.CheatPanel:SetSizeY(25); - Controls.ButtonStackMIN:SetHide(true); - Controls.ButtonSep:SetHide(true); - m_CheatPanelState = 0; - end -end -function KeyHandler( key:number ) - if key == Keys.VK_ESCAPE then - Hide(); - return true; - end - return false; -end -function OnInputHandler( pInputStruct:table ) - local uiMsg = pInputStruct:GetMessageType(); - if uiMsg == KeyEvents.KeyUp then - return KeyHandler( pInputStruct:GetKey() ); - end - return false; -end - -local function InitializeControls() - Controls.HeaderTitle:RegisterCallback(Mouse.eLClick, OnPanelTitleClicked); - --Controls.CheatButtonFreeCity:RegisterCallback(Mouse.eLClick, FreeCity); - Controls.CheatButtonCityHeal:RegisterCallback(Mouse.eLClick, RestoreCityHealth); - Controls.CheatButtonEra2:RegisterCallback(Mouse.eLClick, ChangeEraScoreBack); - Controls.CheatButtonGov:RegisterCallback(Mouse.eLClick, ChangeGovPoints); - Controls.CheatButtonEra:RegisterCallback(Mouse.eLClick, ChangeEraScore); - Controls.CheatButtonGold:RegisterCallback(Mouse.eLClick, ChangeGold); - Controls.CheatButtonProduction:RegisterCallback(Mouse.eLClick, CompleteProduction); - Controls.CheatButtonAllTech:RegisterCallback(Mouse.eLClick, CompleteAllResearch); - Controls.CheatButtonAllCivic:RegisterCallback(Mouse.eLClick, CompleteAllCivic); - Controls.CheatButtonScience:RegisterCallback(Mouse.eLClick, CompleteResearch); - Controls.CheatButtonCulture:RegisterCallback(Mouse.eLClick, CompleteCivic); - Controls.CheatButtonDuplicate:RegisterCallback(Mouse.eLClick, OnDuplicate); - Controls.CheatButtonFaith:RegisterCallback(Mouse.eLClick, ChangeFaith); - Controls.CheatButtonPopulation:RegisterCallback(Mouse.eLClick, ChangePopulation); - Controls.CheatButtonLoyalty:RegisterCallback(Mouse.eLClick, ChangeCityLoyalty); - Controls.CheatButtonDestroy:RegisterCallback(Mouse.eLClick, DestroyCity); - Controls.CheatButtonPromote:RegisterCallback(Mouse.eLClick, UnitPromote); - Controls.CheatButtonUnitMV:RegisterCallback(Mouse.eLClick, UnitMovementChange); - Controls.CheatButtonAddMovement:RegisterCallback(Mouse.eLClick, UnitAddMovement); - Controls.CheatButtonHeal:RegisterCallback(Mouse.eLClick, UnitHealChange); - Controls.CheatButtonEnvoy:RegisterCallback(Mouse.eLClick, ChangeEnvoy); - Controls.CheatButtonObs:RegisterCallback(Mouse.eLClick, RevealAll); - Controls.CheatButtonCorps:RegisterCallback(Mouse.eLClick, UnitFormCorps); - Controls.CheatButtonArmy:RegisterCallback(Mouse.eLClick, UnitFormArmy); - Controls.CheatButtonDiplo:RegisterCallback(Mouse.eLClick, ChangeDiplomaticFavor); - Controls.CheatButtonCityHeal:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonEra2:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonDuplicate:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonEra:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonGold:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonProduction:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonAllTech:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonAllCivic:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonScience:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonCulture:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonFaith:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonPopulation:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonLoyalty:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonDestroy:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonPromote:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonUnitMV:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonAddMovement:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonHeal:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonEnvoy:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonObs:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over") end); - Controls.CheatButtonGov:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); - Controls.CheatButtonDiplo:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); - Controls.ToggleCheatPanel:RegisterCheckHandler(function() UpdateCheatPanel(not m_hideCheatPanel); end); - Controls.ToggleCheatPanel:SetCheck(true); - UpdateCheatPanel(true); -end - --- // ---------------------------------------------------------------------------------------------- --- // Init --- // ---------------------------------------------------------------------------------------------- -function Initialize() - m_IsLoading = true; - Events.LoadGameViewStateDone.Add(OnLoadGameViewStateDone); - Events.LoadGameViewStateDone.Add(InitDropdown); - Events.InputActionTriggered.Add( OnInputActionTriggered ); - ContextPtr:SetInputHandler( OnInputHandler, true ); - InitializeControls(); - if GameConfiguration.IsNetworkMultiplayer() then - UpdateCheatPanel(true); - Controls.ToggleCheatPanel:SetHide(true); - else - UpdateCheatPanel(false); - end - m_IsLoading = false; -end -Initialize(); \ No newline at end of file diff --git a/UI/Panels/Cheat_Panel_World_Tracker.xml b/UI/Panels/Cheat_Panel_World_Tracker.xml deleted file mode 100644 index 4e35952..0000000 --- a/UI/Panels/Cheat_Panel_World_Tracker.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/UI/Popups/Raze_City_Reminder_Popup.lua b/UI/Popups/Raze_City_Reminder_Popup.lua deleted file mode 100644 index 538b7b1..0000000 --- a/UI/Popups/Raze_City_Reminder_Popup.lua +++ /dev/null @@ -1,123 +0,0 @@ -local g_pSelectedCity; - -function OnButton1() - local tParameters = {}; - tParameters[UnitOperationTypes.PARAM_FLAGS] = 0; - if (CityManager.CanStartCommand( g_pSelectedCity, CityCommandTypes.DESTROY, tParameters)) then - UI.DeselectAllCities(); - CityManager.RequestCommand( g_pSelectedCity, CityCommandTypes.DESTROY, tParameters); - end - OnClose(); -end -function OnButton2() - local tParameters = {}; - tParameters[UnitOperationTypes.PARAM_FLAGS] = 1; - if (CityManager.CanStartCommand( g_pSelectedCity, CityCommandTypes.DESTROY, tParameters)) then - UI.DeselectAllCities(); - CityManager.RequestCommand( g_pSelectedCity, CityCommandTypes.DESTROY, tParameters); - end - OnClose(); -end -function OnButton3() - local tParameters = {}; - tParameters[UnitOperationTypes.PARAM_FLAGS] = 2; - if (CityManager.CanStartCommand( g_pSelectedCity, CityCommandTypes.DESTROY, tParameters)) then - CityManager.RequestCommand( g_pSelectedCity, CityCommandTypes.DESTROY, tParameters); - end - OnClose(); -end -function OnButton4() - local tParameters = {}; - tParameters[UnitOperationTypes.PARAM_FLAGS] = 3; - if (CityManager.CanStartCommand( g_pSelectedCity, CityCommandTypes.DESTROY, tParameters)) then - UI.DeselectAllCities(); - CityManager.RequestCommand( g_pSelectedCity, CityCommandTypes.DESTROY, tParameters); - UI.PlaySound("RAZE_CITY"); - end - OnClose(); -end -function OnClose() - UIManager:DequeuePopup( ContextPtr ); - ContextPtr:SetHide(true); -end - -function ShowRazeCityReminderPopup(player:number) - local localPlayerID = Game.GetLocalPlayer(); - local localPlayer = Players[localPlayerID]; - if (localPlayer == nil) then - return; - end - g_pSelectedCity = UI.GetHeadSelectedCity(); - Controls.PanelHeader:LocalizeAndSetText("LOC_DESTROY_CITY_HEADER"); - Controls.CityHeader:LocalizeAndSetText("LOC_RAZE_CITY_NAME_LABEL"); - Controls.CityName:LocalizeAndSetText(g_pSelectedCity:GetName()); - Controls.CityPopulation:LocalizeAndSetText("LOC_RAZE_CITY_POPULATION_LABEL"); - Controls.NumPeople:SetText(tostring(g_pSelectedCity:GetPopulation())); - Controls.CityDistricts:LocalizeAndSetText("LOC_DESTROY_CITY_DISTRICTS_LABEL"); - local iNumDistricts = g_pSelectedCity:GetDistricts():GetNumZonedDistrictsRequiringPopulation(); - Controls.NumDistricts:SetText(tostring(iNumDistricts)); - local szWarmongerString; - local eOriginalOwner = g_pSelectedCity:GetOriginalOwner(); - local originalOwnerPlayer = Players[eOriginalOwner]; - local eOwnerBeforeOccupation = g_pSelectedCity:GetOwnerBeforeOccupation(); - local bWipedOut = (originalOwnerPlayer:GetCities():GetCount() < 1); - local eLastTransferType = g_pSelectedCity:GetLastTransferType(); - if (localPlayer:GetDiplomacy():CanLiberateCityTo(eOwnerBeforeOccupation)) then - Controls.Button2:LocalizeAndSetText("LOC_RAZE_CITY_LIBERATE_FOUNDER_BUTTON_LABEL", PlayerConfigurations[eOwnerBeforeOccupation]:GetCivilizationShortDescription()); - Controls.Button2:LocalizeAndSetToolTip("LOC_DESTROY_CITY_LIBERATE_EXPLANATION"); - Controls.Button2:SetHide(false); - else - Controls.Button2:SetHide(true); - end - Controls.Button3:LocalizeAndSetText("LOC_RAZE_CITY_KEEP_BUTTON_LABEL"); - if (eLastTransferType == CityTransferTypes.BY_GIFT) then - Controls.Button3:LocalizeAndSetToolTip("LOC_KEEP_CITY_EXPLANATION"); - elseif (bWipedOut ~= true) then - Controls.Button3:LocalizeAndSetToolTip("LOC_KEEP_CITY_EXPLANATION"); - else - Controls.Button3:LocalizeAndSetToolTip("LOC_KEEP_CITY_EXPLANATION"); - end - Controls.Button4:LocalizeAndSetText("LOC_RAZE_CITY_RAZE_BUTTON_LABEL"); - if g_pSelectedCity:IsCapital() then - Controls.Button4:LocalizeAndSetToolTip("LOC_RAZE_CITY_RAZE_DISABLED_EXPLANATION"); - Controls.Button4:SetDisabled(true); - else - Controls.Button4:LocalizeAndSetToolTip("LOC_RAZE_CITY_EXPLANATION"); - Controls.Button4:SetDisabled(false); - end - Controls.PopupStack:CalculateSize(); - Controls.PopupStack:ReprocessAnchoring(); - Controls.RazeCityPanel:ReprocessAnchoring(); - ContextPtr:SetHide(false); - ContextPtr:SetInputHandler(OnInputHandler); -end -function OnInputHandler( uiMsg, wParam, lParam ) - if uiMsg == KeyEvents.KeyUp then - if wParam == Keys.VK_ESCAPE then - OnClose(); - end - end - return true; -end -function OnShowRazeCityReminderPopup( player:number, civic:number) - if player == Game.GetLocalPlayer() then - ShowRazeCityReminderPopup(player); - UIManager:QueuePopup( ContextPtr, PopupPriority.Current); - end -end - -function Initialize() - ContextPtr:SetHide(true) - ContextPtr:SetInputHandler( OnInputHandler, true ); - Controls.Button1:RegisterCallback(Mouse.eLClick, OnButton1); - Controls.Button2:RegisterCallback(Mouse.eLClick, OnButton2); - Controls.Button3:RegisterCallback(Mouse.eLClick, OnButton3); - Controls.Button4:RegisterCallback(Mouse.eLClick, OnButton4); - LuaEvents.NotificationPanel_OpenRazeCityChooser.Add(OnShowRazeCityReminderPopup); - Controls.ModalScreenClose:RegisterCallback(Mouse.eLClick, OnClose); - LuaEvents.ShowRazeCityReminderPopup.Add(OnShowRazeCityReminderPopup); - if ( not ExposedMembers.MOD_CheatMenu) then ExposedMembers.MOD_CheatMenu = {}; end - ExposedMembers.MOD_CheatMenu.DestroyCity = OnShowRazeCityReminderPopup; - ExposedMembers.MOD_CheatMenu_Initialized = true; -end -Initialize(); diff --git a/UI/Popups/Raze_City_Reminder_Popup.xml b/UI/Popups/Raze_City_Reminder_Popup.xml deleted file mode 100644 index 3d2ecef..0000000 --- a/UI/Popups/Raze_City_Reminder_Popup.xml +++ /dev/null @@ -1,54 +0,0 @@ - -