| 191 | } |
| 192 | |
| 193 | static void load_wait_context(wait_context& c, const xtextbox::tag_entry_list& el) |
| 194 | { |
| 195 | static S32 v[32]; |
| 196 | |
| 197 | c.reset_type(); |
| 198 | c.delay = 0.0f; |
| 199 | |
| 200 | xtextbox::tag_entry* e = xtextbox::find_entry(el, substr::create("wait", 4)); |
| 201 | |
| 202 | if (e && xtextbox::read_list(*e, &c.delay, 1) == 1) |
| 203 | { |
| 204 | c.type.time = true; |
| 205 | } |
| 206 | |
| 207 | xtextbox::tag_entry* prompt = xtextbox::find_entry(el, substr::create("prompt", 6)); |
| 208 | |
| 209 | if (prompt) |
| 210 | { |
| 211 | c.type.prompt = true; |
| 212 | if (prompt->op == '=' && prompt->args_size == 1 && |
| 213 | icompare(*prompt->args, substr::create("yesno", 5)) == 0) |
| 214 | { |
| 215 | c.query = Q_YESNO; |
| 216 | } |
| 217 | else |
| 218 | { |
| 219 | c.query = Q_SKIP; |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | e = xtextbox::find_entry(el, substr::create("sound", 5)); |
| 224 | c.type.sound = (e != NULL); |
| 225 | |
| 226 | e = xtextbox::find_entry(el, substr::create("event", 5)); |
| 227 | if (e) |
| 228 | { |
| 229 | c.type.event = true; |
| 230 | U32 r = xtextbox::read_list(*e, v, 32); |
| 231 | if (r == 0) |
| 232 | { |
| 233 | c.event_mask = -1; |
| 234 | } |
| 235 | else if (e->op == '=') |
| 236 | { |
| 237 | for (U32 i = 0; i < r; i++) |
| 238 | { |
| 239 | if ((U32)v[i] < 32) |
| 240 | { |
| 241 | c.event_mask |= (1 << v[i]); |
| 242 | } |
| 243 | } |
| 244 | if (c.event_mask & 1) |
| 245 | { |
| 246 | c.event_mask = -1; |
| 247 | } |
| 248 | } |
| 249 | } |
| 250 | e = xtextbox::find_entry(el, substr::create("need", 4)); |
no test coverage detected