comparison mpui.js @ 213:ddb36f1c515f

Fix palette support in the launcher.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 03 Sep 2018 14:28:58 +0300
parents b3579297e04e
children bd63ecb82e61
comparison
equal deleted inserted replaced
212:b3579297e04e 213:ddb36f1c515f
260 260
261 function mpLauncherDone() 261 function mpLauncherDone()
262 { 262 {
263 // Get selected values from DOM elements 263 // Get selected values from DOM elements
264 var mpUI = stGE("mpUI"); 264 var mpUI = stGE("mpUI");
265 mpMachine = stGetSelValue(stGE("machineID"), 0); 265 var machine = mpMachines[stGetSelIndex("machineID")];
266
267 mpMachine = machine[0];
266 268
267 var index = stGetSelValue(stGE("dimensionsID"), -1); 269 var index = stGetSelValue(stGE("dimensionsID"), -1);
268 if (index > 0) 270 if (index > 0)
269 { 271 {
270 mpUIForcedWidth = mpUIDimensions[index][0]; 272 mpUIForcedWidth = mpUIDimensions[index][0];
272 } 274 }
273 else 275 else
274 mpUIForcedWidth = mpUIForcedHeight = 0; 276 mpUIForcedWidth = mpUIForcedHeight = 0;
275 277
276 mpUIScale = stGetSelValue(stGE("scalesID"), -1); 278 mpUIScale = stGetSelValue(stGE("scalesID"), -1);
279
277 index = stGetSelValue(stGE("paletteID"), -1); 280 index = stGetSelValue(stGE("paletteID"), -1);
278 if (index >= 0) 281 if (index >= 0)
279 mpUIPalette = mpPalettes[mpMachine][index]; 282 mpUIPalette = mpPalettes[machine[2]][index];
280 283
281 stClearChildren(mpUI); 284 stClearChildren(mpUI);
282 285
283 // Initialize the canvas etc. 286 // Initialize the canvas etc.
284 var mpCanvas = stGE("mpCanvas"); 287 var mpCanvas = stGE("mpCanvas");