Ver código fonte

UI will now disable Nametable or Bank export if the other surface is selected.

dev
Bryan Miller 5 anos atrás
pai
commit
86ba5dbf90
3 arquivos alterados com 27 adições e 4 exclusões
  1. +19
    -0
      app/js/ctrls/CTRLIO.js
  2. +4
    -0
      sass/core.scss
  3. +4
    -4
      views/header_menu.html

+ 19
- 0
app/js/ctrls/CTRLIO.js Ver arquivo

import JSONSchema from "/app/js/common/JSONSchema.js"; import JSONSchema from "/app/js/common/JSONSchema.js";
import NESBank from "/app/js/models/NESBank.js"; import NESBank from "/app/js/models/NESBank.js";
import NESPalette from "/app/js/models/NESPalette.js"; import NESPalette from "/app/js/models/NESPalette.js";
import NESNameTable from "/app/js/models/NESNameTable.js";
import CTRLPalettesStore from "/app/js/ctrls/CTRLPalettesStore.js"; import CTRLPalettesStore from "/app/js/ctrls/CTRLPalettesStore.js";
import CTRLBanksStore from "/app/js/ctrls/CTRLBanksStore.js"; import CTRLBanksStore from "/app/js/ctrls/CTRLBanksStore.js";
import CTRLNameTablesStore from "/app/js/ctrls/CTRLNameTablesStore.js"; import CTRLNameTablesStore from "/app/js/ctrls/CTRLNameTablesStore.js";
} }


function HANDLE_SurfChange(surf){ function HANDLE_SurfChange(surf){
var enableclass = "";
if (surf instanceof NESBank){ if (surf instanceof NESBank){
SURF = surf; SURF = surf;
enableclass = "surf-bank";
} else { } else {
SURF = null; SURF = null;
if (surf instanceof NESNameTable)
enableclass="surf-nametable";
}

var e = document.querySelectorAll(".surf-export");
for (let i=0; i < e.length; i++){
var ea = e[i].querySelector("a");
if (ea){
if (e[i].classList.contains(enableclass)){
e[i].classList.remove("disable-links");
ea.classList.remove("pure-menu-disabled");
} else {
e[i].classList.add("disable-links");
ea.classList.add("pure-menu-disabled");
}
}
} }
} }



+ 4
- 0
sass/core.scss Ver arquivo

display: flex; display: flex;
} }


.disable-links {
pointer-events: none;
}

canvas.canvas-item-selected{ canvas.canvas-item-selected{
border: 3px solid #FF0000; border: 3px solid #FF0000;
} }

+ 4
- 4
views/header_menu.html Ver arquivo

<li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover"> <li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover">
<a href="#" id="exportchr" class="pure-menu-link">Export</a> <a href="#" id="exportchr" class="pure-menu-link">Export</a>
<ul class="pure-menu-children"> <ul class="pure-menu-children">
<li class="pure-menu-item" emit="modal-open" emit-args='{"cls":".export-chr"}'>
<a href="#" class="pure-menu-link">Bank to CHR</a>
</li>
<li class="pure-menu-item" emit="export-pal-asm"> <li class="pure-menu-item" emit="export-pal-asm">
<a href="#" class="pure-menu-link">Palette to ASM</a> <a href="#" class="pure-menu-link">Palette to ASM</a>
</li> </li>
<li class="pure-menu-item" emit="modal-open" emit-args='{"cls":".export-nametable"}'>
<li class="surf-export surf-bank pure-menu-item" emit="modal-open" emit-args='{"cls":".export-chr"}'>
<a href="#" class="pure-menu-link">Bank to CHR</a>
</li>
<li class="surf-export surf-nametable pure-menu-item" emit="modal-open" emit-args='{"cls":".export-nametable"}'>
<a href="#" class="pure-menu-link">Nametable to ASM</a> <a href="#" class="pure-menu-link">Nametable to ASM</a>
</li> </li>
</ul> </ul>

Carregando…
Cancelar
Salvar