Skip to content

Commit

Permalink
v1.0.3.19
Browse files Browse the repository at this point in the history
  • Loading branch information
steve02081504 committed Apr 22, 2023
1 parent 1adc3d0 commit f95cfb5
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 11 deletions.
9 changes: 4 additions & 5 deletions src/CheckUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,18 @@ void CheckUpdate() {
if(p == u8string::npos)
return;
buff = buff.substr(p + 11);
p = buff.find(u8"\"");
p = buff.find(u8'\"');
if(p == u8string::npos)
return;
buff = buff.substr(p + 1);
p = buff.find(u8"\"");
p = buff.find(u8'\"');
if(p == u8string::npos)
return;
tagname = buff.substr(0, p);
}
if(tagname == U8_VERSION_STRING_FOR_TAG_CHECK) {
if(tagname == U8_VERSION_STRING_FOR_TAG_CHECK)
return;
}
if(MessageBox(NULL, LoadStringFromResource(IDS_NEW_VERSION_AVAILABLE).c_str(), L"Tama", MB_YESNO) == IDYES)
if(MessageBox(NULL, LoadCStringFromResource(IDS_NEW_VERSION_AVAILABLE), L"Tama", MB_YESNO) == IDYES)
ShellExecute(NULL, L"open", L"https://github.com/YAYA-shiori/tama/releases/latest", NULL, NULL, SW_SHOW);
#endif
}
5 changes: 3 additions & 2 deletions src/Events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "header_files/UItools.hpp"
#include "my-gists/windows/SetIcon.h"
#include "my-gists/ukagaka/from_ghost_path.hpp"
#include "my-gists/windows/LoadStringFromResource.hpp"

void On_tamaOpen(HWND hWnd, wstring ghost_path) {
tamaOpen_called = 1;
Expand All @@ -19,7 +20,7 @@ void On_tamaOpen(HWND hWnd, wstring ghost_path) {
if(info.has(L"Icon")) {
auto hIcon = from_ghost_path::load_icon(ghost_path, info[L"Icon"]);
if(!hIcon)
;//err << SET_RED "Can't load icon: " SET_BLUE << result[L"Icon"] << RESET_COLOR << endline;
WriteText(LoadStringFromResource(IDS_ERROR_ICON_NOT_FOUND) + info[L"Icon"], F_ERROR);
else {
icon_info.hIcon = hIcon;
icon_info.hIconSmall = hIcon;
Expand All @@ -28,7 +29,7 @@ void On_tamaOpen(HWND hWnd, wstring ghost_path) {
if(info.has(L"SmallIcon")) {
auto hIcon = from_ghost_path::load_icon(ghost_path, info[L"SmallIcon"]);
if(!hIcon)
;//err << SET_RED "Can't load icon: " SET_BLUE << result[L"SmallIcon"] << RESET_COLOR << endline;
WriteText(LoadStringFromResource(IDS_ERROR_ICON_NOT_FOUND) + info[L"SmallIcon"], F_ERROR);
else
icon_info.hIconSmall = hIcon;
}
Expand Down
7 changes: 6 additions & 1 deletion src/GhostStuff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,18 @@ bool ExecLoad(void) {
return 1;
}


inline wstring operator+(wstring s0, wstring_view s1) {
return s0.append(s1);
}

void WriteShioriError(int id,UINT stringResourceID) {
//id最少4个字符,不够的话前面补0
auto idstr = to_wstring(id);
if(idstr.size()<4)
idstr.insert(0, 4 - idstr.size(), L'0');

wstring tmp = dllpath + L" : tama error TE" + idstr + L" : " + LoadStringFromResource(stringResourceID) + L"\r\n";
wstring tmp = dllpath + L" : tama error TE" + idstr + L" : " + LoadStringViewFromResource(stringResourceID) + L"\r\n";
WriteText(tmp, F_ERROR);
}
void CshioriErrorHandler(Cshiori::Error err) {
Expand Down
4 changes: 2 additions & 2 deletions src/header_files/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define VERSION_NUM1 1
#define VERSION_NUM2 0
#define VERSION_NUM3 3
#define VERSION_NUM4 18
#define CONSTRUCTION_TIMES 51
#define VERSION_NUM4 19
#define CONSTRUCTION_TIMES 52

#define STRINGIZER_HELPER(a) #a
#define STRINGIZER(a) STRINGIZER_HELPER(a)
Expand Down
1 change: 1 addition & 0 deletions src/header_files/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define IDS_ERROR_RUN_SSP_FAILED 118
#define IDS_ERROR_SSP_RUNNING_TIMEOUT 119
#define IDS_SELF_IN_GHOST_DIR_ASK_IF_RUN_SSP 120
#define IDS_ERROR_ICON_NOT_FOUND 121

#define IDS_interface_load_not_found 200
#define IDS_interface_unload_not_found 201
Expand Down
2 changes: 1 addition & 1 deletion src/my-gists
3 changes: 3 additions & 0 deletions src/resource/tama.rc
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ BEGIN
IDS_ERROR_SSP_RUNNING_TIMEOUT "SSPの起動でタイムアウトしました。"
IDS_SELF_IN_GHOST_DIR_ASK_IF_RUN_SSP
"この玉はゴーストフォルダに入っています。\nゴーストを起動してリンクさせますか?"
IDS_ERROR_ICON_NOT_FOUND "アイコンが見つかりません:"
END

STRINGTABLE
Expand Down Expand Up @@ -349,6 +350,7 @@ BEGIN
IDS_ERROR_RUN_SSP_FAILED "启动SSP失败。"
IDS_ERROR_SSP_RUNNING_TIMEOUT "启动SSP超时。"
IDS_SELF_IN_GHOST_DIR_ASK_IF_RUN_SSP "此tama在一个ghost文件夹中\n运行所在ghost并链接?"
IDS_ERROR_ICON_NOT_FOUND "未找到图标文件:"
END

STRINGTABLE
Expand Down Expand Up @@ -500,6 +502,7 @@ BEGIN
IDS_ERROR_SSP_RUNNING_TIMEOUT "SSP launch timed out."
IDS_SELF_IN_GHOST_DIR_ASK_IF_RUN_SSP
"This Tama is in a ghost folder.\nStart SSP with this ghost and link Tama?"
IDS_ERROR_ICON_NOT_FOUND "Icon not found: "
END

STRINGTABLE
Expand Down

0 comments on commit f95cfb5

Please sign in to comment.