Skip to content

Commit

Permalink
feat: update update.js
Browse files Browse the repository at this point in the history
  • Loading branch information
S-N-O-R-L-A-X committed Jul 21, 2024
1 parent 6e4373a commit 03e57b4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
2 changes: 1 addition & 1 deletion game/resources/app/extension/大战七阴/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name":"大战七阴",
"author":"SNORLAX",
"intro":"就你们叫七阴啊?!",
"version":"8.1.0",
"version":"8.2.0",
"diskURL":"",
"forumURL":""
}
20 changes: 20 additions & 0 deletions game/resources/app/extension/大战七阴/source/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ export async function content(config, pack) {
...lib.devil_characters.mobile_list, ...lib.devil_characters.ol_list, ...lib.devil_characters.other_list];

if (lib.config.mode == "brawl") {

// game.loadModeAsync('boss',function(mode){
// for(var i in mode.translate){
// lib.storage.translate[i]=mode.translate[i];
// }
// for(var i in mode.characterPack.mode_boss){
// if(mode.characterPack.mode_boss[i][4].contains('bossallowed')){
// lib.storage.boss[i]=mode.characterPack.mode_boss[i];
// }
// }
// loadversus();
// });


if (!lib.storage.stage) lib.storage.stage = {};
const old_dc_characters = get7characters(lib.devil_characters.old_dc_list);
const dc_characters = get7characters(lib.devil_characters.old_dc_list.concat(lib.devil_characters.dc_list));
Expand Down Expand Up @@ -143,6 +157,12 @@ export async function content(config, pack) {
discardPile: [],
gameDraw: true,
}],
// content: {
// chooseCharacterBefore: () => {
// console.log("start!!!");
// game.log("start")
// }
// }
};
_status.extensionstage = true;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {lib,game,ui,get,ai,_status} from '../../../noname.js'
import { lib, game, ui, get, ai, _status } from '../../../noname.js'

export async function precontent(config,pack){
export async function precontent(config, pack) {
if (!game.utils) {
game.utils = {};
}
Expand Down Expand Up @@ -31,5 +31,4 @@ export async function precontent(config,pack){
});
_status.characterlist = list;
}

}
17 changes: 4 additions & 13 deletions noname/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,10 @@ async function parseCharacters() {
}

async function parseUpdateInfo() {
return fs.readFile(`${root_url}/source/config.js`, 'utf8').then(data => {
// get update log
const updateContent = /<div class=".update">扩展版本:[\s\S]*?扩展版本/m.exec(data)[0];

const rg3 = /[\s\S]*?<\/span>:<br>([\s\S]*?)<br>'?/g;
const updateObj = {
"time": getNowFormatDate(),
"version": "8.1.0",
"content": []
}

while ((info = rg3.exec(updateContent)) !== null) {
updateObj.content.push(info[1]);
return fs.readFile(`${root_url}/update.json`, 'utf8').then(data => {
const updateObj= {
time: getNowFormatDate(),
...JSON.parse(data)
}

fs.readFile("./src/Views/UpdateLog/update.json").then((buffer) => {
Expand Down

0 comments on commit 03e57b4

Please sign in to comment.