Skip to content

Commit 3b44fc7

Browse files
Доработан таймер
1 parent f8a82d2 commit 3b44fc7

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

PlainInsteadView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ extern "C" {
2727
extern BOOL IsNeedSaveTadsGame; //Íåîáõîäèìî ñîõðàíåíèå èãðû
2828
extern BOOL IsOkSaveLoadTadsGame; //Óñïåøíîñòü ñîõðàíåíèÿ/çàãðóçêè
2929
extern char TadsFileName[200];
30+
int inv_save_index = -1; //Èíäåêñ â map Ñîõðàíåííîãî ðåçóëüòàòà èíâåíòàðÿ
3031
}
31-
3232
#define txt text_er + text[debug] + ways_er +(debug?ways:L"") + inv_er + (debug ? inv : L"")
3333
static BOOL m_auto_say;
3434
CPlainInsteadView* CPlainInsteadView::m_curView = 0;

PlainInsteadView.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ void onNewInsteadCommand(char*cmd, char* p,CString cmdForLog = L"",int rc=0);
110110
CListBox mListWays;
111111
CListBox mListInv;
112112
std::map<int, int> pos_id_inv;
113-
int inv_save_index=-1; //Èíäåêñ â map Ñîõðàíåííîãî ðåçóëüòàòà èíâåíòàðÿ
114113
afx_msg void OnUpdateOutView();
115114
afx_msg void OnStnClickedStaticScene();
116115
CStatic mStaticScene;

build/tiny2.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ end]]
9292
stead.restart =instead_restart
9393
stead.menu_toggle =instead_menu
9494
stead.autosave=instead_autosave
95+
stead.wait_use=instead_wait_use
9596
-- Audio
9697
stead.get_music = function()
9798
return game._music, game._music_loop;
@@ -231,6 +232,7 @@ restore_music = stead.restore_music
231232
is_music = stead.is_music
232233
function stead.mouse_filter() return 0 end
233234
function stead.mouse_pos() return 0,0 end
235+
function stead.grab_events() return true end
234236
function stead.screen_size() return 0,0 end
235237
--Для космический рейнджеров
236238
unpack = stead.unpack;

tiny_instead/tiny_gui.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "externals.h"
22
#include "internals.h"
33
static int game_grab_events = 0;
4-
static int game_wait_use = 1;
4+
int game_wait_use = 1;
55
static char* GetClipboardText()
66
{
77
if (!IsClipboardFormatAvailable(CF_TEXT) || !OpenClipboard(NULL)) return NULL;
@@ -47,6 +47,7 @@ const char* text = luaL_optstring(L, 1, NULL);
4747
return 0;
4848
}
4949
static int luaB_wait_use(lua_State* L) {
50+
if (lua_isboolean(L, 1)) game_wait_use = lua_toboolean(L, 1);
5051
return 0;
5152
}
5253
static int luaB_grab_events(lua_State* L) {

tiny_instead/tiny_timer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
static UINT_PTR timer_id = 0;
77
static int volatile unsigned instead_timer_nr = 0;
88
extern BOOLEAN isSaving;
9+
extern int inv_save_index, game_wait_use;
910
static void CALLBACK instead_fn(HWND window, UINT interval, UINT timer_id, DWORD dword);
1011
extern void onNewInsteadCommand(char* cmd, char* p,int rc);
1112
extern uint64_t getTicks();
@@ -30,7 +31,7 @@ if (!delay)
3031
static void onTimer() {
3132
instead_timer_nr = 0;
3233
instead_lock();
33-
if (instead_busy() || !timer_id ||isSaving) {
34+
if (instead_busy() || !timer_id ||isSaving || (game_wait_use &&inv_save_index>-1)) {
3435
instead_unlock();
3536
return;
3637
}

0 commit comments

Comments
 (0)