mirror of
				https://github.com/unanmed/HumanBreak.git
				synced 2025-11-04 07:02:58 +08:00 
			
		
		
		
	Deploying to gh-pages from  @ 35f166fe9a 🚀
				
					
				
			This commit is contained in:
		
							parent
							
								
									ce9c2d075f
								
							
						
					
					
						commit
						2bd3658f0f
					
				@ -731,7 +731,7 @@ actions.prototype._sys_onmove_choices = function (x, y, px, py) {
 | 
			
		||||
actions.prototype._sys_onmove = function (x, y, px, py) {
 | 
			
		||||
    if (core.status.lockControl) return false;
 | 
			
		||||
 | 
			
		||||
    if (core.status.preview.dragging) {
 | 
			
		||||
    if (core.status.preview?.dragging) {
 | 
			
		||||
        core.setViewport(
 | 
			
		||||
            core.bigmap.offsetX - px + core.status.preview.px,
 | 
			
		||||
            core.bigmap.offsetY - py + core.status.preview.py
 | 
			
		||||
@ -740,7 +740,7 @@ actions.prototype._sys_onmove = function (x, y, px, py) {
 | 
			
		||||
        core.status.preview.py = py;
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    if (core.status.preview.prepareDragging) {
 | 
			
		||||
    if (core.status.preview?.prepareDragging) {
 | 
			
		||||
        if (
 | 
			
		||||
            Math.abs(px - core.status.preview.px) <= 20 &&
 | 
			
		||||
            Math.abs(py - core.status.preview.py) <= 20
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										27
									
								
								server.cjs
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								server.cjs
									
									
									
									
									
								
							@ -26,9 +26,6 @@ let hotReloadData = '';
 | 
			
		||||
/** 是否已经启动了热重载模块 */
 | 
			
		||||
let watched = false;
 | 
			
		||||
 | 
			
		||||
/** 是否已经启动了录像调试模块 */
 | 
			
		||||
let replayed = false;
 | 
			
		||||
 | 
			
		||||
/** 监听端口 */
 | 
			
		||||
let port = 3000;
 | 
			
		||||
const next = () => {
 | 
			
		||||
@ -41,11 +38,18 @@ const next = () => {
 | 
			
		||||
};
 | 
			
		||||
next();
 | 
			
		||||
 | 
			
		||||
let repStart;
 | 
			
		||||
 | 
			
		||||
const listenedFloors = [];
 | 
			
		||||
const listenedPlugins = [];
 | 
			
		||||
 | 
			
		||||
const hasPlugin = (function () {
 | 
			
		||||
    try {
 | 
			
		||||
        fss.readdirSync('./project/plugin');
 | 
			
		||||
        return true;
 | 
			
		||||
    } catch {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
})();
 | 
			
		||||
 | 
			
		||||
// ----- GET file
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@ -346,10 +350,12 @@ async function watch() {
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    // 插件热重载
 | 
			
		||||
    const plugins = await extract('project/plugin/*.js');
 | 
			
		||||
    plugins.forEach(v => {
 | 
			
		||||
        watchOnePlugin(v.slice(15));
 | 
			
		||||
    });
 | 
			
		||||
    if (hasPlugin) {
 | 
			
		||||
        const plugins = await extract('project/plugin/*.js');
 | 
			
		||||
        plugins.forEach(v => {
 | 
			
		||||
            watchOnePlugin(v.slice(15));
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 数据热重载
 | 
			
		||||
    const datas = (await extract('project/*.js')).filter(
 | 
			
		||||
@ -383,6 +389,7 @@ function testWatchFloor(url) {
 | 
			
		||||
 * @param {string} url 要测试的路径
 | 
			
		||||
 */
 | 
			
		||||
function testWatchPlugin(url) {
 | 
			
		||||
    if (!hasPlugin) return;
 | 
			
		||||
    if (/project(\/|\\)plugin(\/|\\).*\.js/.test(url)) {
 | 
			
		||||
        const f = url.slice(15);
 | 
			
		||||
        if (!listenedFloors.includes(f.slice(0, -3))) {
 | 
			
		||||
@ -414,7 +421,7 @@ function watchOneFloor(file) {
 | 
			
		||||
function watchOnePlugin(file) {
 | 
			
		||||
    if (!/.*\.js/.test(file)) return;
 | 
			
		||||
    const f = file.slice(0, -3);
 | 
			
		||||
    listenedFloors.push(file.slice(0, -3));
 | 
			
		||||
    listenedPlugins.push(file.slice(0, -3));
 | 
			
		||||
    fss.watchFile(`project/plugin/${file}`, { interval: 500 }, () => {
 | 
			
		||||
        const plugin = f;
 | 
			
		||||
        if (hotReloadData.includes(`@@plugin:${plugin}`)) return;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user