fix search

This commit is contained in:
Juni
2023-01-10 12:12:29 -05:00
parent ba9ec4617f
commit 13f35c0b98
8 changed files with 16 additions and 11 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View File

@@ -16,6 +16,7 @@ AFRAME.registerComponent('recenter', {
});
this.el.addEventListener('recenter', this.recenter);
this.el.sceneEl.addEventListener('recenter', this.recenter);
},
recenter: (function () {

View File

@@ -54,19 +54,20 @@ AFRAME.registerComponent('search', {
const zipFileReader = new zip.BlobReader(zipBlob);
const zipReader = new zip.ZipReader(zipFileReader);
const files = await zipReader.getEntries();
const info = _.find(files, {filename: "Info.dat"});
//const infoStream = new TransformStream();
//const infoPromise = new Response(infoStream.readable).text();
console.log(files);
const info = _.find(files, {filename: "Info.dat"}) || _.find(files, {filename: "info.dat"});
const infoBlob = await info.getData(new zip.BlobWriter());
const infoJson = JSON.parse(await infoBlob.text());
console.log(infoJson);
const songFile = _.find(files, {filename: infoJson._songFilename});
const songBlob = await songFile.getData(new zip.BlobWriter());
const songUrl = URL.createObjectURL(songBlob);
console.log(songUrl);
const coverFile = _.find(files, {filename: infoJson._coverImageFilename});
let coverUrl="";
if(coverFile){
const coverBlob = await coverFile.getData(new zip.BlobWriter());
const coverUrl = URL.createObjectURL(coverBlob);
coverUrl = URL.createObjectURL(coverBlob);
}
const difficultyInfo = infoJson._difficultyBeatmapSets[0]._difficultyBeatmaps;
const difficultyFiles = {};
difficultyInfo.forEach(async (d) => {

View File

@@ -1,6 +1,6 @@
/* global AFRAME */
var KEYBOARDS = {
supersaber: {wrapCount: 20, inputOffsetY: 0.008, inputOffsetX: 0.08, img: 'keyboard.png', hoverImg: 'keyboard-hover.png', layout: [{"key":"1", "x":0.014, "y":0.024, "w":0.094, "h":0.183}, {"key":"2", "x":0.108, "y":0.024, "w":0.094, "h":0.183}, {"key":"3", "x":0.203, "y":0.024, "w":0.095, "h":0.183}, {"key":"4", "x":0.299, "y":0.024, "w":0.094, "h":0.183}, {"key":"5", "x":0.394, "y":0.024, "w":0.093, "h":0.183}, {"key":"6", "x":0.487, "y":0.024, "w":0.095, "h":0.183}, {"key":"7", "x":0.583, "y":0.024, "w":0.093, "h":0.183}, {"key":"8", "x":0.677, "y":0.024, "w":0.095, "h":0.183}, {"key":"9", "x":0.772, "y":0.024, "w":0.093, "h":0.183}, {"key":"0", "x":0.866, "y":0.024, "w":0.093, "h":0.183}, {"key":"q", "x":0.014, "y":0.215, "w":0.094, "h":0.183}, {"key":"w", "x":0.108, "y":0.215, "w":0.094, "h":0.183}, {"key":"e", "x":0.203, "y":0.215, "w":0.095, "h":0.183}, {"key":"r", "x":0.299, "y":0.215, "w":0.094, "h":0.183}, {"key":"t", "x":0.394, "y":0.215, "w":0.093, "h":0.183}, {"key":"y", "x":0.487, "y":0.215, "w":0.095, "h":0.183}, {"key":"i", "x":0.677, "y":0.215, "w":0.095, "h":0.183}, {"key":"u", "x":0.583, "y":0.215, "w":0.093, "h":0.183}, {"key":"o", "x":0.772, "y":0.215, "w":0.093, "h":0.183}, {"key":"p", "x":0.866, "y":0.215, "w":0.093, "h":0.183}, {"key":"a", "x":0.063, "y":0.405, "w":0.094, "h":0.183}, {"key":"s", "x":0.158, "y":0.405, "w":0.094, "h":0.183}, {"key":"d", "x":0.253, "y":0.405, "w":0.095, "h":0.183}, {"key":"f", "x":0.349, "y":0.405, "w":0.094, "h":0.183}, {"key":"g", "x":0.443, "y":0.405, "w":0.093, "h":0.183}, {"key":"h", "x":0.537, "y":0.405, "w":0.095, "h":0.183}, {"key":"j", "x":0.633, "y":0.405, "w":0.092, "h":0.183}, {"key":"k", "x":0.726, "y":0.405, "w":0.095, "h":0.183}, {"key":"l", "x":0.821, "y":0.405, "w":0.093, "h":0.183}, {"key":"z", "x":0.111, "y":0.598, "w":0.093, "h":0.181}, {"key":"x", "x":0.205, "y":0.598, "w":0.095, "h":0.181}, {"key":"c", "x":0.301, "y":0.598, "w":0.095, "h":0.181}, {"key":"v", "x":0.396, "y":0.598, "w":0.093, "h":0.181}, {"key":"b", "x":0.49, "y":0.598, "w":0.094, "h":0.181}, {"key":"n", "x":0.585, "y":0.598, "w":0.094, "h":0.181}, {"key":"m", "x":0.68, "y":0.598, "w":0.093, "h":0.181}, {"key":"Delete", "x":0.777, "y":0.598, "w":0.137, "h":0.181}, {"key":" ", "x":0.297, "y":0.788, "w":0.381, "h":0.201}, {"key":"Escape", "x":0.013, "y":0.797, "w":0.137, "h":0.181}, {"key":"Insert", "x":0.014, "y":-0.001, "w":0.01, "h":0.005}]}
supersaber: {wrapCount: 20, inputOffsetY: 0.008, inputOffsetX: 0.08, img: 'keyboard.png', hoverImg: 'keyboard-hover.png', layout: [{"key":"1", "x":0.014, "y":0.024, "w":0.094, "h":0.183}, {"key":"2", "x":0.108, "y":0.024, "w":0.094, "h":0.183}, {"key":"3", "x":0.203, "y":0.024, "w":0.095, "h":0.183}, {"key":"4", "x":0.299, "y":0.024, "w":0.094, "h":0.183}, {"key":"5", "x":0.394, "y":0.024, "w":0.093, "h":0.183}, {"key":"6", "x":0.487, "y":0.024, "w":0.095, "h":0.183}, {"key":"7", "x":0.583, "y":0.024, "w":0.093, "h":0.183}, {"key":"8", "x":0.677, "y":0.024, "w":0.095, "h":0.183}, {"key":"9", "x":0.772, "y":0.024, "w":0.093, "h":0.183}, {"key":"0", "x":0.866, "y":0.024, "w":0.093, "h":0.183}, {"key":"q", "x":0.014, "y":0.215, "w":0.094, "h":0.183}, {"key":"w", "x":0.108, "y":0.215, "w":0.094, "h":0.183}, {"key":"e", "x":0.203, "y":0.215, "w":0.095, "h":0.183}, {"key":"r", "x":0.299, "y":0.215, "w":0.094, "h":0.183}, {"key":"t", "x":0.394, "y":0.215, "w":0.093, "h":0.183}, {"key":"y", "x":0.487, "y":0.215, "w":0.095, "h":0.183}, {"key":"i", "x":0.677, "y":0.215, "w":0.095, "h":0.183}, {"key":"u", "x":0.583, "y":0.215, "w":0.093, "h":0.183}, {"key":"o", "x":0.772, "y":0.215, "w":0.093, "h":0.183}, {"key":"p", "x":0.866, "y":0.215, "w":0.093, "h":0.183}, {"key":"a", "x":0.063, "y":0.405, "w":0.094, "h":0.183}, {"key":"s", "x":0.158, "y":0.405, "w":0.094, "h":0.183}, {"key":"d", "x":0.253, "y":0.405, "w":0.095, "h":0.183}, {"key":"f", "x":0.349, "y":0.405, "w":0.094, "h":0.183}, {"key":"g", "x":0.443, "y":0.405, "w":0.093, "h":0.183}, {"key":"h", "x":0.537, "y":0.405, "w":0.095, "h":0.183}, {"key":"j", "x":0.633, "y":0.405, "w":0.092, "h":0.183}, {"key":"k", "x":0.726, "y":0.405, "w":0.095, "h":0.183}, {"key":"l", "x":0.821, "y":0.405, "w":0.093, "h":0.183}, {"key":"z", "x":0.111, "y":0.598, "w":0.093, "h":0.181}, {"key":"x", "x":0.205, "y":0.598, "w":0.095, "h":0.181}, {"key":"c", "x":0.301, "y":0.598, "w":0.095, "h":0.181}, {"key":"v", "x":0.396, "y":0.598, "w":0.093, "h":0.181}, {"key":"b", "x":0.49, "y":0.598, "w":0.094, "h":0.181}, {"key":"n", "x":0.585, "y":0.598, "w":0.094, "h":0.181}, {"key":"m", "x":0.68, "y":0.598, "w":0.093, "h":0.181}, {"key":"Delete", "x":0.777, "y":0.598, "w":0.137, "h":0.181}, {"key":" ", "x":0.297, "y":0.788, "w":0.381, "h":0.201}, {"key":"Escape", "x":0.013, "y":0.797, "w":0.137, "h":0.181}, {"key":"Enter", "x":0.850, "y":0.797, "w":0.137, "h":0.181}, {"key":"Insert", "x":0.014, "y":-0.001, "w":0.01, "h":0.005}]}
};
if (typeof AFRAME === 'undefined') {
@@ -425,7 +425,10 @@ AFRAME.registerComponent('super-keyboard', {
switch (this.keyHover.key) {
case 'Enter': {
this.accept();
//this.accept();
console.log("Enter Search", this.changeEventDetail);
this.el.emit('superkeyboardchange', this.changeEventDetail);
//this.dismiss();
break;
}
case 'Insert': {
@@ -437,7 +440,7 @@ AFRAME.registerComponent('super-keyboard', {
this.el.setAttribute('super-keyboard', 'value', newValue);
this.updateTextInput(newValue);
this.changeEventDetail.value = newValue;
this.el.emit('superkeyboardchange', this.changeEventDetail);
//this.el.emit('superkeyboardchange', this.changeEventDetail);
break;
}
case 'Shift': {
@@ -458,7 +461,7 @@ AFRAME.registerComponent('super-keyboard', {
this.el.setAttribute('super-keyboard', 'value', newValue);
this.updateTextInput(newValue);
this.changeEventDetail.value = newValue;
this.el.emit('superkeyboardchange', this.changeEventDetail);
// this.el.emit('superkeyboardchange', this.changeEventDetail);
break;
}
}

View File

@@ -234,8 +234,8 @@
scale="1.3 1.3 1.3"></a-entity>
{% endmacro %}
{{ saber('left', 'right', '#850e3e', 'pink') }}
{{ saber('right', 'left', '#256c43', 'cyan') }}
{{ saber('left', 'right', '#850e3e', 'pink') }}
</a-entity>
<a-entity