MCPcopy Create free account
hub / github.com/crawl/crawl / clear_mapping

Method clear_mapping

crawl-ref/source/macro.cc:1190–1214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1188 }
1189
1190 void clear_mapping(keyseq key)
1191 {
1192 macromap &mapref = get_map();
1193 if (!mapref.count(key))
1194 return;
1195
1196 const int keycode = key[0];
1197 string key_str = keycode_is_printable(keycode)
1198 ? keycode_to_name(keycode, false).c_str()
1199 : make_stringf("%s (%s)",
1200 vtostr(key).c_str(), keycode_to_name(keycode, false).c_str());
1201 string action_str = vtostr(mapref[key]);
1202
1203 action_str = replace_all(action_str, "<", "<<");
1204 key_str = replace_all(key_str, "<", "<<");
1205
1206 status_msg = make_stringf("Cleared %s '%s' => '%s'.",
1207 mode_name().c_str(),
1208 key_str.c_str(),
1209 action_str.c_str());
1210
1211 macro_del(mapref, key);
1212 crawl_state.unsaved_macros = true;
1213 fill_entries();
1214 }
1215
1216 void clear_hovered()
1217 {

Callers

nothing calls this directly

Calls 7

keycode_is_printableFunction · 0.85
keycode_to_nameFunction · 0.85
make_stringfFunction · 0.85
vtostrFunction · 0.85
replace_allFunction · 0.85
macro_delFunction · 0.85
countMethod · 0.45

Tested by

no test coverage detected