Skip to content

Commit

Permalink
Simple_Menu_Options.Write_Option_Value adjusted to support $ prefixed…
Browse files Browse the repository at this point in the history
… ids, to help Extra Game Options initialize traffic density.
  • Loading branch information
Brent committed Jun 14, 2020
1 parent 9a8c897 commit fc053ff
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Support/steam_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sn_interact_collection": "1.1",
"sn_extra_game_options": "1.9",
"sn_better_target_monitor": "2.0",
"sn_mod_support_apis": "1.76",
"sn_mod_support_apis": "1.77",
"sn_remove_dock_glow": "1.2",
"sn_quiet_target_range_clicks": "1.1",
"sn_remove_blinking_lights": "1.3",
Expand Down
4 changes: 3 additions & 1 deletion extensions/sn_mod_support_apis/change_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ Change Log for overall api package.
* 1.75
- Fixing action table error from prior version.
* 1.76
- Added Chat_Window_API.
- Added Chat_Window_API.
* 1.77
- Adjusted Simple_Menu_Options.Write_Option_Value to support ids with and without a $ prefix.
2 changes: 1 addition & 1 deletion extensions/sn_mod_support_apis/content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name="Mod Support APIs"
description=" "
author="SirNukes"
version="176"
version="177"
date="2019-07-23"
save="false"
sync="false">
Expand Down
21 changes: 15 additions & 6 deletions extensions/sn_mod_support_apis/md/Simple_Menu_Options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@
</actions>
</cue>


<!--@doc-cue
User cue to write a new value for an option, overwriting what is
stored in this lib. The callback cue will not be signalled.
Expand All @@ -235,14 +234,24 @@
<event_cue_signalled />
</conditions>
<actions>
<set_value name="$id" exact="'$' + event.param.$id" />
<debug_text text="'id %s updating to %s (type %s)'.[
<!--This could have been given a $ prefixed id already; try both styles.-->
<set_value name="$id" exact="event.param.$id" />
<do_if value="not Globals.$storage.{$id}?">
<set_value name="$id" exact="'$' + event.param.$id" />
</do_if>
<!--Error if still not found.-->
<do_if value="not Globals.$storage.{$id}?">
<debug_text text="'id %s not found in registerd options'.[event.param.$id]"
chance="Globals.$DebugChance" filter="general"/>
</do_if>
<do_else>
<debug_text text="'id %s updating to %s (type %s)'.[
event.param.$id,
event.param.$value,
typeof event.param.$value]"
chance="Globals.$DebugChance" filter="general"/>
<!--For now, don't validate the id, just store blindly.-->
<set_value name="Globals.$storage.{$id}" exact="event.param.$value"/>
chance="Globals.$DebugChance" filter="general"/>
<set_value name="Globals.$storage.{$id}" exact="event.param.$value"/>
</do_else>
</actions>
</cue>

Expand Down

0 comments on commit fc053ff

Please sign in to comment.