Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
regularize timestamp change rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Z-H-Sun committed Aug 11, 2021
1 parent b2ec4c5 commit 5366b85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ See Also / 另请参见: [tswKai(改)](https://github.com/Z-H-Sun/tswKai); [
* **Data management function since V2.023**: After selecting or typing the filename of interest in the combobox, you can press <kbd>Delete</kbd> to delete that data file. To enable this function, `SAVEDAT_PATH` must be either found or defined in the program. / **自 2.023 版起提供存档管理功能**:在组合框中选中或键入目标存档的文件名,然后按 <kbd>Delete</kbd> 键删除,前提是程序能找到或用户自己定义 `SAVEDAT_PATH`
* Then, press <kbd>Enter</kbd> to confirm or press <kbd>ESC</kbd> to cancel. / 随后,按 <kbd>Enter</kbd> 确定或按 <kbd>ESC</kbd> 取消。
* **New Feature since V2.023:** You can now have tsSL running in the background all the time; whenever a new TSW process is opened, the target of tswSL will be automatically switched to that process. Previously, if you quit and reopen another instance of TSW, you will have to close and reopen tswSL as well. / 现在可以在后台一直保持 tswSL 运行,即使新开另一个 TSW 进程,tswSL 也会自动切换作用对象为当前 TSW 进程。之前的版本中,如果退出 TSW 后重开,则 tswSL 也需要退出重开。
* Supplementary note: The timestamp, `MMDD`, in the filenames of temporary savedata reflects the date you start an instance of TSW: If you never quit TSW, the timestamp will not change even if days have passed; however, if you restart TSW on a different day, the timestamp will change. / 补充说明:临时存档文件名中的时间戳 `月月日日` 反映的是开启对应 TSW 进程的日期,因此,如果你一直不关 TSW,那么即使到第二天,时间戳也不会更改;反之如果到第二天关掉先前进程并重启 TSW,那么时间戳将更改。

## Troubleshooting / 疑难解答
* **Cannot find the TSW process and/or window**: Please check if TSW V1.2 is currently running. / **找不到魔塔进程或窗口**:请检查是否已经打开魔塔 1.2 版本。
Expand Down
4 changes: 2 additions & 2 deletions tswSL.rbw
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ FILENAME_LEN = 10
FILENAME_MAX = 256 # not really, filename+path cannot exceed 260 chars
MODIFIER = [6, 7, 7] # load = Shift+Ctrl; save = Shift+Ctrl+Alt; quit = Shift+Ctrl+Alt
KEY = [49, 50, 51, 52, 53, 54, 55, 56, 57, 48] # data 1-8 = key1-8; custom data = key9; quit = key0
TIME_STAMP = Time.now.strftime('\%m%dtmp_') # temp filename format

def init()
$time_stamp = Time.now.strftime('\%m%dtmp_') # temp filename format
$hWnd = Win32API.new('user32', 'FindWindow', 'pi', 'l').call('TTSW10', 0)
$pID = '\0\0\0\0'
Win32API.new('user32', 'GetWindowThreadProcessId', 'lp', 'l').call($hWnd, $pID)
Expand Down Expand Up @@ -137,7 +137,7 @@ def slTEMP(save, num, filename=nil)
address = BASE_ADDRESS+PATH_ADDRESS[8*save+num]
err = 0
if filename.nil?
filename2 = TIME_STAMP+(num+1).to_s
filename2 = $time_stamp+(num+1).to_s
# Temporarily change the path to the data file
err = LST_ERR.call if WRITE_PROCESS.call($hPrc, address, filename2, FILENAME_LEN, ' ').zero?
else
Expand Down

0 comments on commit 5366b85

Please sign in to comment.