User:Bkiro/sandbox: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
Line 2: Line 2:
Dota 2 Modding Notes / Techniques / My Codes
Dota 2 Modding Notes / Techniques / My Codes


== Check 1 ==
== Displaying Popup Message When Game Starts ==
asdaf
This will Display An ingame Popup Message When The Game Starts ( Pre Game )
=== check 1.1 ===
 
<source lang="lua">
-- First we set up a listener
ListenToGameEvent("game_rules_state_change",show_message,nil)
-- This will run the function "show_message" whenever the event "game_rules_state_change" occurs.
 
function show_message()
g_state=GameRules:State_Get() -- This Line will assign the game state to the variable g_state
if g_state == DOTA_GAMERULES_STATE_PRE_GAME then
ShowGenericPopup( "#popup_title", "#popup_body", "", "", DOTA_SHOWGENERICPOPUP_TINT_SCREEN )
end
</source>
 
== check 2 ==
== check 2 ==
=== check 2.1 ===
=== check 2.1 ===

Revision as of 12:30, 17 September 2014

Useful Notes

Dota 2 Modding Notes / Techniques / My Codes

Displaying Popup Message When Game Starts

This will Display An ingame Popup Message When The Game Starts ( Pre Game )

-- First we set up a listener
ListenToGameEvent("game_rules_state_change",show_message,nil) 
-- This will run the function "show_message" whenever the event "game_rules_state_change" occurs.

function show_message()
g_state=GameRules:State_Get() -- This Line will assign the game state to the variable g_state
if g_state == DOTA_GAMERULES_STATE_PRE_GAME then
ShowGenericPopup( "#popup_title", "#popup_body", "", "", DOTA_SHOWGENERICPOPUP_TINT_SCREEN )
end

check 2

check 2.1