0
0
mirror of https://github.com/marcrobledo/savegame-editors.git synced 2025-04-28 09:05:10 +00:00
This commit is contained in:
magiczocker10 2024-07-01 11:58:48 +02:00 committed by GitHub
parent ad3a7b554b
commit 62ecfc5cdd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 45 additions and 31 deletions

View File

@ -64,17 +64,20 @@
<div class="five columns">Help</div><div class="five columns" id="container-help"></div>
<div class="five columns">Bomb</div><div class="five columns" id="container-bomb"></div>
</div>
<br>
<h3>Controls</h3>
</div>
<h3 class="orange">Controls - Cross</h3>
<div class="container">
<div class="row">
<h4 class="orange">Cross</h4>
<div class="five columns">Up / Y</div><div class="five columns" id="container-cross-up"></div>
<div class="five columns">Left / A</div><div class="five columns" id="container-cross-left"></div>
<div class="five columns">Right / X</div><div class="five columns" id="container-cross-right"></div>
<div class="five columns">Bottom / B</div><div class="five columns" id="container-cross-bottom"></div>
<div class="five columns">L / R</div><div class="five columns" id="container-cross-lr"></div>
<br>
<h4 class="orange">Circle</h4>
</div>
</div>
<h3 class="orange">Controls - Circle</h3>
<div class="container">
<div class="row">
<div class="five columns">Up</div><div class="five columns" id="container-circle-up"></div>
<div class="five columns">Left</div><div class="five columns" id="container-circle-left"></div>
<div class="five columns">Right</div><div class="five columns" id="container-circle-right"></div>

View File

@ -46,9 +46,10 @@ SavegameEditor={
{value:3, name:'Orange Pencil'},
{value:4, name:'Blue Pencil'}
],
CONTROLS_CROSS_OFFSET:0x5DAC,
CONTROLS_CROSS_ABXY_OFFSET:0x5DB0,
CONTROLS_LR_OFFSET:0x5DB4,
CONTROLS_CIRCLE_OFFSET:0x223E,
CONTROLS_CROSS_OFFSET:0x2234,
CONTROLS_CROSS_ABXY_OFFSET:0x2238,
CONTROLS_LR_OFFSET:0x223C,
DIFFICULTIES:[
{value: 0, name: 'Easy'},
{value: 1, name: 'Medium'},
@ -187,9 +188,6 @@ SavegameEditor={
},
_load_profile:function(){
var profileStartOffset = SavegameEditor._getProfileOffset();
get('container-profile-name').innerHTML = '';
get('container-profile-name').appendChild(span(SavegameEditor._readU8String(profileStartOffset, 20)));
setValue('background', tempFile.readU8(profileStartOffset + SavegameEditor.Constants.BACKGROUND_OFFSET));
setValue('bgm-music', tempFile.readU8(profileStartOffset + SavegameEditor.Constants.BGM_MUSIC_OFFSET));
@ -207,7 +205,7 @@ SavegameEditor={
setValue('circle-bottom-left', tempFile.readU8(profileStartOffset + SavegameEditor.Constants.CONTROLS_CIRCLE_OFFSET+1));
setValue('circle-bottom-right', tempFile.readU8(profileStartOffset + SavegameEditor.Constants.CONTROLS_CIRCLE_OFFSET+2));
setValue('profile-name', tempFile.readU16String(profileStartOffset, 10));
var tmp = tempFile.readU8(profileStartOffset + 0x2231);
setValue('checkbox-help', tmp > 1 ? 'checked' : '');
setValue('checkbox-bomb', (tmp+1)%2===0 > 1 ? 'checked' : '');
@ -229,12 +227,42 @@ SavegameEditor={
checkValidSavegame:function(){
return (tempFile.fileSize==45688)
},
preload:function() {
get('container-profile-name').appendChild(input('profile-name', 10));
get('input-profile-name').addEventListener('change', function(){
tempFile.writeU16String(
this._getProfileOffset(),
10,
getValue('profile-name')
);
});
get('container-background').appendChild(select('background', SavegameEditor.Constants.BACKGROUND, SavegameEditor._write_background));
get('container-bomb').appendChild(checkbox('checkbox-bomb'));
get('container-difficulty').appendChild(select('difficulty', SavegameEditor.Constants.DIFFICULTIES, SavegameEditor._write_difficulty));
get('container-help').appendChild(checkbox('checkbox-help'));
get('container-bgm-music').appendChild(select('bgm-music', SavegameEditor.Constants.BGM_MUSIC, SavegameEditor._write_bgm_music));
get('container-cross-up').appendChild(select('cross-up', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_cross));
get('container-cross-left').appendChild(select('cross-left', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_cross));
get('container-cross-right').appendChild(select('cross-right', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_cross));
get('container-cross-bottom').appendChild(select('cross-bottom', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_cross));
get('container-cross-lr').appendChild(select('cross-lr', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_cross));
get('container-circle-up').appendChild(select('circle-up', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_circle));
get('container-circle-left').appendChild(select('circle-left', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_circle));
get('container-circle-right').appendChild(select('circle-right', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_circle));
get('container-circle-bottom-left').appendChild(select('circle-bottom-left', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_circle));
get('container-circle-bottom-right').appendChild(select('circle-bottom-right', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_circle));
},
/* load function */
load:function(){
tempFile.fileName='SAVEDATA';
fetch('/picross-3d-round-2/puzzles.json')
tempFile.littleEndian=true;
fetch('/savegame-editors/picross-3d-round-2/puzzles.json')
.then(function(response) {
return response.json();
}).then(function(data) {
@ -276,23 +304,6 @@ SavegameEditor={
}
}
setValue('amiibocount', unlockedAmiibos);
get('container-background').appendChild(select('background', SavegameEditor.Constants.BACKGROUND, SavegameEditor._write_background));
get('container-bomb').appendChild(checkbox('checkbox-bomb'));
get('container-difficulty').appendChild(select('difficulty', SavegameEditor.Constants.DIFFICULTIES, SavegameEditor._write_difficulty));
get('container-help').appendChild(checkbox('checkbox-help'));
get('container-bgm-music').appendChild(select('bgm-music', SavegameEditor.Constants.BGM_MUSIC, SavegameEditor._write_bgm_music));
get('container-cross-up').appendChild(select('cross-up', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_cross));
get('container-cross-left').appendChild(select('cross-left', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_cross));
get('container-cross-right').appendChild(select('cross-right', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_cross));
get('container-cross-bottom').appendChild(select('cross-bottom', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_cross));
get('container-cross-lr').appendChild(select('cross-lr', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_cross));
get('container-circle-up').appendChild(select('circle-up', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_circle));
get('container-circle-left').appendChild(select('circle-left', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_circle));
get('container-circle-right').appendChild(select('circle-right', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_circle));
get('container-circle-bottom-left').appendChild(select('circle-bottom-left', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_circle));
get('container-circle-bottom-right').appendChild(select('circle-bottom-right', SavegameEditor.Constants.CONTROLS, SavegameEditor._write_controls_circle));
this._load_profile();
},