221 Commits

Author SHA1 Message Date
Kawe Mazidjatari
efe71fbe24 ImGui console UX improvements
* Fixed click-through parent window.
* Keep selection position when lines get cleared.
* Keep cursor position when lines get cleared.
* Ensure cursor visibility when dragging cursor outside rect.
* Falter free scrolling in autocomplete window.
* Falter free scrolling in logging window (window no longer stutters when lines get cleared).
2022-06-26 16:47:00 +02:00
Kawe Mazidjatari
d7a004a0eb Fixed bug where auto-scrolling occasionally gets disabled
Issue happened when scrolling back, most of the time it will work, but there is always jitter in the first frame after the change which could result in ImGui::GetScrollY() <= ImGui::GetScrollMaxY() resulting in auto-scroll disable.
Only scroll back if ImGui::GetScrollY() <= ImGui::GetScrollMaxY() and always reset value of CConsole::m_nScrollBack.
2022-06-24 18:28:26 +02:00
Kawe Mazidjatari
cdc32531eb Prevent selection in console when scrollbar is active
Fixed issue where scrolling with the scrollbar would select text whilst sliding.
Improved UX by not showing the text edit cursor when scrollbar is hovered.
2022-06-24 17:43:50 +02:00
Kawe Mazidjatari
88259a69ae Allow selection while cursor is no longer hovered over child window 2022-06-24 15:23:14 +02:00
Kawe Mazidjatari
2eda8235b7 Slight theming tweaks
Minor improvements to small detail:
No child border on console on default theme (this is invisible).
Tweaked first use size and min size where by default the text would always perfectly align between ScrollY min and max.
2022-06-24 12:45:47 +02:00
Kawe Mazidjatari
add5c577ff Improve ImGui theme system
-imgui_theme "modern" = Respawn theme.
-imgui_theme "legacy" = Valve theme.
No args = default theme.
2022-06-24 12:22:04 +02:00
Kawe Mazidjatari
e1ede0c995 Remove unused function from imgui_logger.cpp 2022-06-24 12:12:00 +02:00
Kawe Mazidjatari
145b5dcd13 CTextLogger cleanup
Reordered structure.
Use C++ style casts.
changed m_flLastClick (float) to double.
2022-06-22 00:33:12 +02:00
Kawe Mazidjatari
76ec4b8f4a Improve console scrolling
Moved auto scrolling logic to CTextLogger.
Removed redundant code in CTextLogger.
Added bool param to CTextLogger::RemoveLine to determine whether or not to lock the mutex (internal operations should not lock).
Fixed issue where scrolling with cursor is not possible when auto-scroll is set or ScrollY is towards its max.
Fixed copy button (copy all text in console via GUI, ctrl + a - ctrl + v alternative).
2022-06-21 23:25:15 +02:00
Kawe Mazidjatari
a436b70601 CConsole / CTextLogger optimizations
CConsole: cast to proper types.
CTextLogger: only compute line string if filter is active.
2022-06-21 20:20:12 +02:00
Kawe Mazidjatari
3e2c395584 Don't append newlines on obtained text
Newlines are added through the SDK, and the CTextLogger class has been modified to insert a newline when in encounters a newline character.
2022-06-21 11:32:40 +02:00
Kawe Mazidjatari
a534ef1e3c Type untyped variables in CTextLogger
All of these are known types that aren't going to change.
2022-06-21 11:13:30 +02:00
Kawe Mazidjatari
f7dd4089f0 Logger improvements
Fix crash cases due to concurrent access and wrong type casting.
Improve filter logic (now greys out everything outside criteria).

TODO: Return 'size_t' for everything size related.
2022-06-21 10:14:20 +02:00
Kawe Mazidjatari
da299a002c Reimplement text filter
Could be better at some point, currently removes anything not matching criteria resulting in gaps.
But on the other side it might be good as the location of all occurrences are known (should make it easier to see when it is logged during the process).

Revisit in the future.
2022-06-20 20:21:52 +02:00
Kawe Mazidjatari
7d749fc53a Skip space characters properly in CTextLogger 2022-06-20 13:23:38 +02:00
Kawe Mazidjatari
f52bfb139e Remove m_bReadOnly from CTextLogger
User can't modify the log text, it can only be modified through code.
2022-06-20 13:23:11 +02:00
Kawe Mazidjatari
33aebfb89d ImGui theme improvements 2022-06-20 13:05:50 +02:00
Kawe Mazidjatari
28f0df81c6 Fix crash case
Prevent concurrent access to CTextLogger::m_Lines.
Additional cleanup.
2022-06-20 11:01:53 +02:00
Kawe Mazidjatari
1b81f2d1eb Modify CTextLogger
Redact and modify CTextLogger (copy of CTextEditor) to fit logger usage.
Removed most unnecessary methods/code and members.
2022-06-20 10:17:11 +02:00
Kawe Mazidjatari
fed337fbbd Add imgui_logger.cpp
A copy of CTextEditor
2022-06-20 10:14:43 +02:00
Kawe Mazidjatari
f1091fef0e imgui_editor.cpp class rename 2022-06-20 10:05:32 +02:00
Kawe Mazidjatari
20eabe4b8e Update imgui_editor.h 2022-06-19 10:54:11 +02:00
Kawe Mazidjatari
40a0c8878a Rename TextEditor members 2022-06-19 10:51:45 +02:00
Kawe Mazidjatari
0c11011567 Add ImGuiColorTextEdit to project 2022-06-18 23:23:29 +02:00
Kawe Mazidjatari
a4783a755e Fix memory leak
Access checksum objects directly vs pointer reference. Structure size equals a 64 bit pointer (fits into a single register).
Allocated memory was never deallocated (my mistake).
2022-06-05 03:01:10 +02:00
Kawe Mazidjatari
22029abfc2 Fixed compression bug for VPK system
Fixed bug where the compressed buffer size equals the source buffer size getting packed into the VPK chunk. In all occurrences this resulted in corrupted data upon export.

The reason for data being corrupt upon export is because the engine checks the equality of the compressed and decompressed size fields in the directory file, if they are equal, the engine doesn't attempt to decompress the block. So we end up with a still compressed block on the disk (technically not corrupt in the context of the compression lib, but useless as-is on the disk).

If a compressed file doesn't get lower in size we are better out storing it rather than compressing it.

Added a new condition in lzham::lzham_lib_compress_memory which checks source and destination buffer size equality.
2022-06-05 02:24:44 +02:00
Kawe Mazidjatari
e6ef3d71f1 Rename variable 'g_pIConsole' to 'g_pConsole' 2022-05-27 02:46:13 +02:00
Kawe Mazidjatari
58d46c0a8c Rename class 'IBrowser' to 'CBrowser'
Renamed 'g_pIBrowser' to 'g_pBrowser' as well
2022-05-27 02:44:36 +02:00
Kawe Mazidjatari
e1799887d0 Finished GUI SDK Launcher
Implemented logic behind console frontend.
cleaned up sdklauncher.cpp (methods properly split up in class).
2022-05-26 22:04:50 +02:00
Kawe Mazidjatari
4b72afb74f Light refactor for logging
Moved logging functions to dbg.h (tier0) and export them from the dll.
Added additional functions for checking bad pointers (debug only!).
Reduced output code size.
2022-05-25 14:18:29 +02:00
Kawe Mazidjatari
4eaba9f5a2 Gui launcher work
Improved theme
Implemented dedicated server and client logic (gui side only)
2022-05-25 12:07:08 +02:00
Kawe Mazidjatari
dacd307663 See description
* Finished designer code for launcher gui.
* Basic implementation of setting flags for host launch option.
* Check in 'CHostState::LoadConfig' if -launcher is below 1.. if condition is met the cfg's will be executed from 'CHostState::LoadConfig'.
* Added 'StringIsDigit' utility.
2022-05-24 02:23:37 +02:00
Kawe Mazidjatari
4afc4e8d6a Update cppkore theme 2022-05-23 19:12:37 +02:00
Kawe Mazidjatari
b7057a1204 Set correct icon resolution
Small icon handle is no longer equal to large if Icon::ApplicationIcon() is called
2022-05-21 22:41:15 +02:00
Kawe Mazidjatari
04bee896be Fix string/wstring type conflict
cppkore uses string/wstring as StringBase while we use std::string/std::wstring as string/wstring. Changed all types in cppkore to String/WString instead.
2022-05-21 21:51:35 +02:00
Kawe Mazidjatari
f11f3fe95d Add 'cppkore' library to project 2022-05-21 19:58:09 +02:00
Kawe Mazidjatari
637041d5e7 Use 'fs' instead of 'std::filesystem' 2022-05-16 21:54:46 +02:00
Kawe Mazidjatari
81dcfa60a0 Cleanup 2022-05-13 17:51:01 +02:00
Kawe Mazidjatari
3144227ec8 Update GetAdr implementations to feature spdlog
Fixed all alignments and reduced code verbosity
2022-05-13 14:53:25 +02:00
Kawe Mazidjatari
10474d07d7 Update JSON lib to version 3.10.5 2022-05-03 17:28:17 +02:00
Kawe Mazidjatari
84fe122e43 Update ImGui lib
Update to 1.87
2022-04-24 20:52:40 +02:00
Kawe Mazidjatari
a778d910e7 Fix rare crash in naveditor
Running tests in the naveditor without building navigation segfaults the application.

Reduced verbose prints when building navigation.
2022-04-22 02:31:06 +02:00
Kawe Mazidjatari
e1f5e7d46b Un-hardcode all CHostState dependencies
The SDK now works on executables with ASLR enabled.
!TODO: Dedicated.
2022-04-12 02:48:46 +02:00
Kawe Mazidjatari
092b7e9d43 Start of migration to IDetour interface
Migrating to this to initialize all patterns and prototypes in Systems_Init() instead.
This should make debugging missing/not found patterns easier and allow for opting out variable/constant search (some of these require other patterns to be found, thus resulting in seg faults..).

Also added check to detect if user has a eligible CPU to run this SDK.
The game requires SSE and SSE2 instruction sets. Our SDK requires this too due to the use of SSE intrinsics, so we cannot let the game handle this. We have to check it ourselves.
2022-04-11 01:44:30 +02:00
Kawe Mazidjatari
aa57170e0d Start of pattern search refactor 2022-04-09 01:14:22 +02:00
Kawe Mazidjatari
b405125357 Fix clang-cl compile
Temporarily commented SDL2 audio as some SSE code doesn't work properly with clang-cl
2022-03-27 22:18:58 +02:00
Kawe Mazidjatari
6f268c0978 Check if ImGui config file exist before attempting to parse it 2022-03-27 12:09:46 +02:00
Kawe Mazidjatari
72ca651003 Cleanup DetourNavMesh.h 2022-03-26 00:44:42 +01:00
Kawe Mazidjatari
9b33e1b94e Fix more debugdraw 2022-03-19 12:56:22 +01:00
Kawe Mazidjatari
35ad8554a5 Somewhat correct working navmesh
The reachability table needs to be figured out still. The issue should be very small, but at the moment I do not have time for it.

The pointer to the table, and table pointers to data is correct, however, not a single poly is ever getting marked as 'reachable' (0xffffffff). This could be either within recast itself (see build_link_table() and set_reachable() functions), or the way the engine parses the data. The function that determines whether poly is reachable is located at '0x140F448E0'
2022-03-18 03:14:07 +01:00