Project1

标题: 用什么方法能防止玩家直接通过右上角的红叉退出游戏? [打印本页]

作者: 605533120    时间: 2015-5-5 13:05
标题: 用什么方法能防止玩家直接通过右上角的红叉退出游戏?
目前我的游戏的自动存档机制如果直接通过红叉退出会有100%的几率会导致存档损坏,
所以我想尝试用什么办法能够防止玩家直接通过红叉退出游戏
作者: VIPArcher    时间: 2015-5-5 13:40
看图书馆的 多功能 DLL SiNova v10015【6/9更新鼠标脚本】
https://rpg.blue/thread-347535-1-1.html
作者: soulsaga    时间: 2015-5-5 13:41
用打开菜单时自动存档代替吧...
作者: zhaoxun96    时间: 2015-5-6 11:19
你在开头提醒一下就是了...真正要玩的玩家肯定都会遵守的...
就算红叉关不了,人家火了直接结束进程............
作者: 3106345123    时间: 2015-5-6 15:40
去边框脚本
  1. # (WinUser.h 中的一些宏)
  2. # GWL_STYLE        = -16
  3. # WS_CAPTION       = 0x00C00000L
  4. # SM_CXSCREEN      = 0
  5. # SM_CYSCREEN      = 1
  6. # SWP_FRAMECHANGED = 0x0020

  7. # 防止 F12 后再次执行
  8. if $START_NOCAPTION == nil
  9.   $START_NOCAPTION = 1
  10.   getPrivateProfileString = Win32API.new("kernel32", "GetPrivateProfileString", ['P', 'P', 'P', 'P', 'L', 'P'], 'L')
  11.   findWindow = Win32API.new("user32", "FindWindow", ['P', 'P'], 'L')
  12.   getWindowLong = Win32API.new("user32", "GetWindowLong", ['L', 'I'], 'L')
  13.   setWindowLong = Win32API.new("user32", "SetWindowLong", ['L', 'I', 'L'], 'L')
  14.   getSystemMetrics = Win32API.new("user32", "GetSystemMetrics", ['I'], 'I')
  15.   setWindowPos = Win32API.new("user32", "SetWindowPos",['L', 'L', 'I', 'I', 'I', 'I', 'I'], 'L')
  16.   
  17.   # 分配字符串缓冲区
  18.   title = " " * 128
  19.   # 通过读取 Game.ini 获取窗口标题
  20.   getPrivateProfileString.call("Game", "Title", "", title, 128, "./Game.ini")
  21.   # 通过窗口类名和标题获取窗口句柄
  22.   hWnd = findWindow.call('RGSS Player', title)
  23.   
  24.   # 获取窗口样式
  25.   style = getWindowLong.call(hWnd, -16)
  26.   # 去掉 WS_CAPTION 样式
  27.   style &= ~0x00C00000
  28.   # 应用新样式
  29.   setWindowLong.call(hWnd, -16, style)
  30.   # 获取屏幕尺寸
  31.   scr_width = getSystemMetrics.call(0)
  32.   scr_height = getSystemMetrics.call(1)
  33.   # 更新窗口框架并居中
  34.   setWindowPos.call(hWnd, 0, (scr_width - 544) / 2, (scr_height - 416) / 2, 544, 416, 0x0020)
  35. end
复制代码





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1