Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Commit

Permalink
Added tech/civic popup and voiceover toggles
Browse files Browse the repository at this point in the history
  • Loading branch information
chaorace committed Oct 30, 2016
1 parent 9f3433e commit ca868ae
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions UI/MinimapPanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,9 @@ function Initialize()
Controls.QUI_ToggleSmartBanner:RegisterCallback( Mouse.eLClick, function() LuaEvents.QUI_Option_ToggleSmartBanner(); end);
-- Controls.QUI_ToggleCowboy:RegisterCallback( Mouse.eLClick, function() LuaEvents.QUI_Option_ToggleCowboy(); end);
-- Controls.QUI_ToggleBadCowboy:RegisterCallback( Mouse.eLClick, function() LuaEvents.QUI_Option_ToggleBadCowboy(); end);

Controls.CQUI_ToggleTechPopup:RegisterCallback( Mouse.eLClick, function() LuaEvents.CQUI_Option_ToggleTechPopup(); end);
Controls.CQUI_ToggleTechVoiceover:RegisterCallback( Mouse.eLClick, function() LuaEvents.CQUI_Option_ToggleTechVoiceover(); end);

-- Make sure the StrategicSwitcherButton has the correct image when the game starts in StrategicView
if UI.GetWorldRenderView() == WorldRenderView.VIEW_2D then
Expand Down
2 changes: 2 additions & 0 deletions UI/MinimapPanel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
<CheckBox ID="QUI_ToggleSmartBanner" IsChecked="1" Offset="10,4" TextOffset="-5,0" String="QUI: Smart Banner" ToolTip="Shows more information on city banners" Style="WhiteSemiBold14" ButtonTexture="Controls_Checkbox.dds" ButtonSize="17,17" CheckTexture="Controls_Checkbox.dds" CheckSize="17,17" CheckTextureOffset="0,17" Anchor="R,T"/>
<CheckBox ID="QUI_ToggleCowboy" IsChecked="0" Offset="10,4" TextOffset="-5,0" String="QUI: Cowboy" ToolTip="Automatically trains horsemen" Style="WhiteSemiBold14" ButtonTexture="Controls_Checkbox.dds" ButtonSize="0,0" CheckTexture="Controls_Checkbox.dds" CheckSize="17,17" CheckTextureOffset="0,17" Anchor="R,T" Hidden="1"/>
<CheckBox ID="QUI_ToggleBadCowboy" IsChecked="0" Offset="10,4" TextOffset="-5,0" String="QUI: Bad Cowboy" ToolTip="Automatically deletes horsemen" Style="WhiteSemiBold14" ButtonTexture="Controls_Checkbox.dds" ButtonSize="0,0" CheckTexture="Controls_Checkbox.dds" CheckSize="17,17" CheckTextureOffset="0,17" Anchor="R,T" Hidden="1"/>
<CheckBox ID="CQUI_ToggleTechPopup" IsChecked="0" Offset="10,4" TextOffset="-5,0" String="CQUI: Popup Visual" ToolTip="Tech/Civic popups display when enabled" Style="WhiteSemiBold14" ButtonTexture="Controls_Checkbox.dds" ButtonSize="17,17" CheckTexture="Controls_Checkbox.dds" CheckSize="17,17" CheckTextureOffset="0,17" Anchor="R,T"/>
<CheckBox ID="CQUI_ToggleTechVoiceover" IsChecked="1" Offset="10,4" TextOffset="-5,0" String="CQUI: Popup Voiceover" ToolTip="Voiceovers from Tech/Civic popups play when enabled, even if the popup visual is disabled" Style="WhiteSemiBold14" ButtonTexture="Controls_Checkbox.dds" ButtonSize="17,17" CheckTexture="Controls_Checkbox.dds" CheckSize="17,17" CheckTextureOffset="0,17" Anchor="R,T"/>
</Stack>
</ScrollPanel>
<Image Texture="Controls_ButtonExtendSmall" TextureOffset="0,60" Size="20,20" Anchor="L,B" Offset="20,10"/>
Expand Down
13 changes: 11 additions & 2 deletions UI/Popups/TechCivicCompletedPopup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ local m_quote_audio;
-- ===========================================================================

-- ===========================================================================
local CQUI_popup = false;
local CQUI_voiceover = true;
function OnTogglePopup() CQUI_popup = not CQUI_popup; end
function OnToggleVoiceover() CQUI_voiceover = not CQUI_voiceover; end
LuaEvents.CQUI_Option_ToggleTechPopup.Add( OnTogglePopup );
LuaEvents.CQUI_Option_ToggleTechVoiceover.Add( OnToggleVoiceover );

function ShowCompletedPopup(completedPopup:table)
do return end;
-- Show the correct popup
if completedPopup.tech ~= nil then
ShowTechCompletedPopup(completedPopup.player, completedPopup.tech, completedPopup.isCanceled);
Expand All @@ -36,6 +42,9 @@ function ShowCompletedPopup(completedPopup:table)
m_isWaitingToShowPopup = true;

RefreshSize();
if(not CQUI_popup) then
Close();
end
end

-- ===========================================================================
Expand Down Expand Up @@ -325,7 +334,7 @@ end
function OnShow( )
UI.PlaySound("Pause_Advisor_Speech");
UI.PlaySound("Resume_TechCivic_Speech");
if(m_quote_audio and #m_quote_audio > 0) then
if(m_quote_audio and #m_quote_audio > 0 and CQUI_voiceover) then
UI.PlaySound(m_quote_audio);
end
end
Expand Down

0 comments on commit ca868ae

Please sign in to comment.