Toggle search
Search
Toggle menu
Toggle personal menu
Editing
Modding/Templates/Map Settings
(section)
From Desynced Wiki
Read
Edit
Edit source
View history
Page
Discussion
More actions
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== entry.lua === Content<syntaxhighlight lang="lua"> local package = ... function MapMsg.OnSettingChanged(key_name, old_value, new_value) local notify_name, notify_value if key_name == 'mymod_foo' then notify_name, notify_value = "Foo Amount", string.format("%.0f%%", (new_value * 100)) -- Perhaps do other stuff when foo changed in-game elseif key_name == 'mymod_bar' then notify_name, notify_value = "Bar Amount", string.format("%.0f%%", (new_value * 100)) -- Perhaps do other stuff when bar changed in-game end if notify_name then UI.Run(function() if Game.IsHostPlayer() then return end Notification.Add("mapsettings_" .. key_name, "info", "Game Settings", L("%s was changed to %s", notify_name, notify_value)) end) end end </syntaxhighlight> {{ModdingNav}}
Summary:
Please note that all contributions to Desynced Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Desynced Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)