Skip to content

Commit

Permalink
2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
henrypp committed Jan 28, 2018
1 parent c6bc113 commit 11c190c
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 56 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v2.0.1 (28 January 2018)
- revert "start minimized" option (issue #7)
- fixed hotkeys initialization in some cases
- fixed ui bugs

v2.0 (27 January 2018)
+ code rewritten on c++
+ added clear window background feature (vista+)
Expand Down
5 changes: 5 additions & 0 deletions bin/History.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v2.0.1 (28 January 2018)
- revert "start minimized" option (issue #7)
- fixed hotkeys initialization in some cases
- fixed ui bugs

v2.0 (27 January 2018)
+ code rewritten on c++
+ added clear window background feature (vista+)
Expand Down
Binary file modified bin/freeshooter.lng
Binary file not shown.
Binary file modified bin/i18n/!example.txt
Binary file not shown.
Binary file modified bin/i18n/Russian.ini
Binary file not shown.
2 changes: 1 addition & 1 deletion build.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@echo off

cd ..\builder
build "Free Shooter" freeshooter 2.0
build "Free Shooter" freeshooter 2.0.1
4 changes: 2 additions & 2 deletions src/app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#define APP_NAME L"Free Shooter"
#define APP_NAME_SHORT L"freeshooter"
#define APP_VERSION L"2.0"
#define APP_VERSION_RES 2,0,0,0
#define APP_VERSION L"2.0.1"
#define APP_VERSION_RES 2,0,1,0
#define APP_COPYRIGHT L"(c) 2009, 2010, 2018 " _APP_AUTHOR L". All Rights Reversed."

#endif // __APP_H__
37 changes: 19 additions & 18 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,19 +401,16 @@ void _app_takeshot (HWND hwnd, EnumScreenshot mode)
}
}

void _app_hotkeyuninit (HWND hwnd)
{
UnregisterHotKey (hwnd, HOTKEY_ID_FULLSCREEN);
UnregisterHotKey (hwnd, HOTKEY_ID_WINDOW);
UnregisterHotKey (hwnd, HOTKEY_ID_REGION);
}

void _app_hotkeyinit (HWND hwnd)
{
bool is_nofullscreen = false;
bool is_nowindow = false;
bool is_noregion = false;

UnregisterHotKey (hwnd, HOTKEY_ID_FULLSCREEN);
UnregisterHotKey (hwnd, HOTKEY_ID_WINDOW);
UnregisterHotKey (hwnd, HOTKEY_ID_REGION);

if (app.ConfigGet (L"HotkeyFullscreenEnabled", true).AsBool ())
{
const UINT hk_fullscreen = app.ConfigGet (L"HotkeyFullscreen", HOTKEY_FULLSCREEN).AsUint ();
Expand Down Expand Up @@ -761,8 +758,6 @@ INT_PTR CALLBACK HotkeysProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
case WM_INITDIALOG:
{
_app_hotkeyuninit (app.GetHWND ());

// configure window
_r_wnd_center (hwnd, GetParent (hwnd));

Expand Down Expand Up @@ -860,12 +855,6 @@ INT_PTR CALLBACK HotkeysProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
break;
}

case WM_DESTROY:
{
_app_hotkeyinit (app.GetHWND ());
break;
}

case WM_COMMAND:
{
if (HIWORD (wparam) == CBN_SELCHANGE && (LOWORD (wparam) == IDC_FULLSCREEN_CB || LOWORD (wparam) == IDC_WINDOW_CB || LOWORD (wparam) == IDC_REGION_CB))
Expand All @@ -888,9 +877,9 @@ INT_PTR CALLBACK HotkeysProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
const DWORD window_idx = (DWORD)SendDlgItemMessage (hwnd, IDC_WINDOW_CB, CB_GETCURSEL, 0, 0);
const DWORD region_idx = (DWORD)SendDlgItemMessage (hwnd, IDC_REGION_CB, CB_GETCURSEL, 0, 0);

app.ConfigSet (L"HotkeyFullscreenEnabled", (fullscreen_idx > 0));
app.ConfigSet (L"HotkeyWindowEnabled", (window_idx > 0));
app.ConfigSet (L"HotkeyRegionEnabled", (region_idx > 0));
app.ConfigSet (L"HotkeyFullscreenEnabled", bool (fullscreen_idx > 0));
app.ConfigSet (L"HotkeyWindowEnabled", bool (window_idx > 0));
app.ConfigSet (L"HotkeyRegionEnabled", bool (region_idx > 0));

if (fullscreen_idx > 0)
{
Expand Down Expand Up @@ -940,6 +929,8 @@ INT_PTR CALLBACK HotkeysProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
app.ConfigSet (L"HotkeyRegion", (DWORD)MAKEWORD (SendDlgItemMessage (hwnd, IDC_REGION_CB, CB_GETITEMDATA, region_idx, 0), modifiers));
}

_app_hotkeyinit (app.GetHWND ());

// without break;
}

Expand All @@ -960,6 +951,7 @@ INT_PTR CALLBACK HotkeysProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)

void _app_initdropdownmenu (HMENU hmenu, bool is_button)
{
app.LocaleMenu (hmenu, IDS_STARTMINIMIZED_CHK, IDM_STARTMINIMIZED_CHK, false, nullptr);
app.LocaleMenu (hmenu, IDS_LOADONSTARTUP_CHK, IDM_LOADONSTARTUP_CHK, false, nullptr);
app.LocaleMenu (hmenu, IDS_CHECKUPDATES_CHK, IDM_CHECKUPDATES_CHK, false, nullptr);
app.LocaleMenu (hmenu, IDS_COPYTOCLIPBOARD_CHK, IDM_COPYTOCLIPBOARD_CHK, false, nullptr);
Expand All @@ -970,6 +962,7 @@ void _app_initdropdownmenu (HMENU hmenu, bool is_button)
app.LocaleMenu (hmenu, IDS_IMAGEFORMAT, FORMAT_MENU, true, nullptr);
app.LocaleMenu (hmenu, IDS_HOTKEYS, IDM_HOTKEYS, false, is_button ? L"...\tF3" : nullptr);

CheckMenuItem (hmenu, IDM_STARTMINIMIZED_CHK, MF_BYCOMMAND | (app.ConfigGet (L"IsStartMinimized", false).AsBool () ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem (hmenu, IDM_LOADONSTARTUP_CHK, MF_BYCOMMAND | (app.AutorunIsEnabled () ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem (hmenu, IDM_CHECKUPDATES_CHK, MF_BYCOMMAND | (app.ConfigGet (L"CheckUpdates", true).AsBool () ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem (hmenu, IDM_COPYTOCLIPBOARD_CHK, MF_BYCOMMAND | (app.ConfigGet (L"CopyToClipboard", false).AsBool () ? MF_CHECKED : MF_UNCHECKED));
Expand Down Expand Up @@ -1226,6 +1219,14 @@ INT_PTR CALLBACK DlgProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
break;
}

case IDM_STARTMINIMIZED_CHK:
{
const bool new_val = !app.ConfigGet (L"IsStartMinimized", false).AsBool ();
app.ConfigSet (L"IsStartMinimized", new_val);

break;
}

case IDM_LOADONSTARTUP_CHK:
{
const bool new_val = !app.AutorunIsEnabled ();
Expand Down
2 changes: 1 addition & 1 deletion src/main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#define UID 1337
#define LANG_MENU 4
#define SETTINGS_MENU 6
#define FORMAT_MENU 3
#define FORMAT_MENU 4
#define WND_SLEEP 150
#define PEN_COLOR RGB(0,0,0)
#define PEN_COLOR_BK RGB(255,255,255)
Expand Down
68 changes: 35 additions & 33 deletions src/resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,20 @@
#define IDM_TRAY_EXIT 149

// Settings Menu
#define IDM_LOADONSTARTUP_CHK 150
#define IDM_CHECKUPDATES_CHK 151
#define IDM_COPYTOCLIPBOARD_CHK 152
#define IDM_PLAYSOUNDS_CHK 153
#define IDM_INCLUDEMOUSECURSOR_CHK 154
#define IDM_CLEARBACKGROUND_CHK 155
#define IDM_DISABLEAEROONWND_CHK 156
#define IDM_FORMAT_BMP 157
#define IDM_FORMAT_JPG 158
#define IDM_FORMAT_PNG 159
#define IDM_FORMAT_GIF 160
#define IDM_FORMAT_TIFF 161
#define IDM_HOTKEYS 162
#define IDM_STARTMINIMIZED_CHK 150
#define IDM_LOADONSTARTUP_CHK 151
#define IDM_CHECKUPDATES_CHK 152
#define IDM_COPYTOCLIPBOARD_CHK 153
#define IDM_PLAYSOUNDS_CHK 154
#define IDM_INCLUDEMOUSECURSOR_CHK 155
#define IDM_CLEARBACKGROUND_CHK 156
#define IDM_DISABLEAEROONWND_CHK 157
#define IDM_FORMAT_BMP 158
#define IDM_FORMAT_JPG 159
#define IDM_FORMAT_PNG 160
#define IDM_FORMAT_GIF 161
#define IDM_FORMAT_TIFF 162
#define IDM_HOTKEYS 163

#define IDX_LANGUAGE 1000

Expand All @@ -116,31 +117,32 @@
#define IDS_HIDEME_CHK 16
#define IDS_CLASSICUI_CHK 17

#define IDS_LOADONSTARTUP_CHK 18
#define IDS_CHECKUPDATES_CHK 19
#define IDS_COPYTOCLIPBOARD_CHK 20
#define IDS_DISABLEAEROONWND_CHK 21
#define IDS_STARTMINIMIZED_CHK 18
#define IDS_LOADONSTARTUP_CHK 19
#define IDS_CHECKUPDATES_CHK 20
#define IDS_COPYTOCLIPBOARD_CHK 21
#define IDS_DISABLEAEROONWND_CHK 22

#define IDS_PLAYSOUNDS_CHK 22
#define IDS_INCLUDEMOUSECURSOR_CHK 23
#define IDS_CLEARBACKGROUND_CHK 24
#define IDS_PLAYSOUNDS_CHK 23
#define IDS_INCLUDEMOUSECURSOR_CHK 24
#define IDS_CLEARBACKGROUND_CHK 25

#define IDS_MODE_FULLSCREEN 25
#define IDS_MODE_WINDOW 26
#define IDS_MODE_REGION 27
#define IDS_MODE_FULLSCREEN 26
#define IDS_MODE_WINDOW 27
#define IDS_MODE_REGION 28

#define IDS_IMAGEFORMAT 28
#define IDS_FOLDER 29
#define IDS_QUICKSETTINGS 30
#define IDS_MODE 31
#define IDS_SCREENSHOT 32
#define IDS_HOTKEYS 33
#define IDS_IMAGEFORMAT 29
#define IDS_FOLDER 30
#define IDS_QUICKSETTINGS 31
#define IDS_MODE 32
#define IDS_SCREENSHOT 33
#define IDS_HOTKEYS 34

#define IDS_DISABLE 34
#define IDS_WARNING_HOTKEYS 35
#define IDS_DISABLE 35
#define IDS_WARNING_HOTKEYS 36

#define IDS_SAVE 36
#define IDS_CANCEL 37
#define IDS_SAVE 37
#define IDS_CANCEL 38

// Wav
#define IDW_MAIN 1
Expand Down
4 changes: 3 additions & 1 deletion src/resource.rc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ IDM_SETTINGS MENU
{
POPUP ""
{
MENUITEM " ", IDM_STARTMINIMIZED_CHK
MENUITEM " ", IDM_LOADONSTARTUP_CHK
MENUITEM " ", IDM_CHECKUPDATES_CHK
MENUITEM SEPARATOR
Expand Down Expand Up @@ -186,6 +187,7 @@ STRINGTABLE
IDS_HIDEME_CHK "Hide main window before capture"
IDS_CLASSICUI_CHK "Use classic interface (restart required)"

IDS_STARTMINIMIZED_CHK "Start minimized"
IDS_LOADONSTARTUP_CHK "Load on system startup"
IDS_CHECKUPDATES_CHK "Periodically check for updates (recommended)"
IDS_COPYTOCLIPBOARD_CHK "Copy image to clipboard"
Expand All @@ -194,7 +196,7 @@ STRINGTABLE
IDS_FOLDER "Screenshots folder"
IDS_QUICKSETTINGS "Quick settings"
IDS_MODE "Mode"
IDS_IMAGEFORMAT "Image format"
IDS_IMAGEFORMAT "Save as..."

IDS_PLAYSOUNDS_CHK "Play capture sound"
IDS_INCLUDEMOUSECURSOR_CHK "Include mouse cursor"
Expand Down

0 comments on commit 11c190c

Please sign in to comment.