From f361c691158f673cc3ed7ef8b0fb32c37a80a970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Wed, 19 Oct 2022 01:42:22 -0300 Subject: [PATCH] Minor annoying bugs fixes. ecode: Added fallback font to the build. --- README.md | 8 ++++---- include/eepp/system/iostreamstring.hpp | 4 +++- include/eepp/version.hpp | 2 +- projects/linux/ecode/build.app.sh | 1 + projects/macos/ecode/build.app.sh | 1 + projects/mingw32/ecode/build.app.sh | 3 ++- src/eepp/system/iostreamstring.cpp | 7 ++++++- src/eepp/ui/uimenu.cpp | 5 +++++ src/tools/ecode/appconfig.cpp | 6 +++--- src/tools/ecode/ecode.cpp | 6 ++++-- src/tools/ecode/version.hpp | 2 +- 11 files changed, 31 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4e8ce3d10..cdb908afe 100644 --- a/README.md +++ b/README.md @@ -348,13 +348,13 @@ Also please use a modern browser with good WebGL and WASM support (Chrome/ium 70 * **[ecode - Text Editor](https://cdn.ensoft.dev/eepp-demos/demo-fs.html?run=ecode.js)** -* **[Texture Atlas Editor](https://cdn.ensoft.dev/eepp-demos/demo-fs.html?run=eepp-TextureAtlasEditor.js)** - -* **[Map Editor](https://cdn.ensoft.dev/eepp-demos/demo-fs.html?run=eepp-MapEditor.js)** +* **[UI Editor](https://cdn.ensoft.dev/eepp-demos/demo-fs.html?run=eepp-UIEditor.js)** * **[UI Hello World](https://cdn.ensoft.dev/eepp-demos/demo-fs.html?run=eepp-ui-hello-world.js)** -* **[UI Editor running some tests](https://cdn.ensoft.dev/eepp-demos/demo-fs.html?run=eepp-UIEditor.js)** +* **[Texture Atlas Editor](https://cdn.ensoft.dev/eepp-demos/demo-fs.html?run=eepp-TextureAtlasEditor.js)** + +* **[Map Editor](https://cdn.ensoft.dev/eepp-demos/demo-fs.html?run=eepp-MapEditor.js)** * **[Fonts example](https://cdn.ensoft.dev/eepp-demos/demo-fs.html?run=eepp-fonts.js)** diff --git a/include/eepp/system/iostreamstring.hpp b/include/eepp/system/iostreamstring.hpp index 6908a5651..cd6aafa92 100644 --- a/include/eepp/system/iostreamstring.hpp +++ b/include/eepp/system/iostreamstring.hpp @@ -11,6 +11,8 @@ class EE_API IOStreamString : public IOStream { public: IOStreamString(); + IOStreamString( const std::string& filepath ); + virtual ios_size read( char* data, ios_size size ); virtual ios_size write( const char* data, ios_size size ); @@ -37,7 +39,7 @@ class EE_API IOStreamString : public IOStream { protected: std::string mStream; - ios_size mPos; + ios_size mPos{ 0 }; }; }} // namespace EE::System diff --git a/include/eepp/version.hpp b/include/eepp/version.hpp index 91090a331..60e4ce6fc 100644 --- a/include/eepp/version.hpp +++ b/include/eepp/version.hpp @@ -6,7 +6,7 @@ #define EEPP_MAJOR_VERSION 2 #define EEPP_MINOR_VERSION 5 -#define EEPP_PATCH_LEVEL 0 +#define EEPP_PATCH_LEVEL 1 #define EEPP_CODENAME "Bindu" /** The compiled version of the library */ diff --git a/projects/linux/ecode/build.app.sh b/projects/linux/ecode/build.app.sh index ec31083ad..b369f01a5 100755 --- a/projects/linux/ecode/build.app.sh +++ b/projects/linux/ecode/build.app.sh @@ -28,6 +28,7 @@ cp -r ../../../bin/assets/fonts/NotoSans-Regular.ttf ecode.app/assets/fonts/ cp -r ../../../bin/assets/fonts/remixicon.ttf ecode.app/assets/fonts/ cp -r ../../../bin/assets/fonts/NotoEmoji-Regular.ttf ecode.app/assets/fonts/ cp -r ../../../bin/assets/fonts/NotoColorEmoji.ttf ecode.app/assets/fonts/ +cp -r ../../../bin/assets/fonts/DroidSansFallbackFull.ttf ecode.app/assets/fonts/ cp -r ../../../bin/assets/plugins ecode.app/assets/ mkdir -p ecode.app/assets/icon/ cp -r ../../../bin/assets/icon/ee.png ecode.app/assets/icon/ diff --git a/projects/macos/ecode/build.app.sh b/projects/macos/ecode/build.app.sh index bfe838000..116f192eb 100755 --- a/projects/macos/ecode/build.app.sh +++ b/projects/macos/ecode/build.app.sh @@ -24,6 +24,7 @@ cp -r ../../../bin/assets/fonts/NotoSans-Regular.ttf ecode.app/Contents/MacOS/as cp -r ../../../bin/assets/fonts/remixicon.ttf ecode.app/Contents/MacOS/assets/fonts/ cp -r ../../../bin/assets/fonts/NotoEmoji-Regular.ttf ecode.app/Contents/MacOS/assets/fonts/ cp -r ../../../bin/assets/fonts/NotoColorEmoji.ttf ecode.app/Contents/MacOS/assets/fonts/ +cp -r ../../../bin/assets/fonts/DroidSansFallbackFull.ttf ecode.app/Contents/MacOS/assets/fonts/ cp -r ../../../bin/assets/plugins ecode.app/Contents/MacOS/assets/ cp -r ../../../bin/assets/icon ecode.app/Contents/MacOS/assets/ mkdir ecode.app/Contents/MacOS/assets/ui diff --git a/projects/mingw32/ecode/build.app.sh b/projects/mingw32/ecode/build.app.sh index cc56b291d..1abe0b02b 100755 --- a/projects/mingw32/ecode/build.app.sh +++ b/projects/mingw32/ecode/build.app.sh @@ -48,6 +48,7 @@ cp -r ../../../bin/assets/fonts/NotoSans-Regular.ttf ecode/assets/fonts/ cp -r ../../../bin/assets/fonts/remixicon.ttf ecode/assets/fonts/ cp -r ../../../bin/assets/fonts/NotoEmoji-Regular.ttf ecode/assets/fonts/ cp -r ../../../bin/assets/fonts/NotoColorEmoji.ttf ecode/assets/fonts/ +cp -r ../../../bin/assets/fonts/DroidSansFallbackFull.ttf ecode/assets/fonts/ cp -r ../../../bin/assets/plugins ecode/assets/ mkdir ecode/assets/ui cp ../../../bin/assets/ui/breeze.css ecode/assets/ui/ @@ -60,4 +61,4 @@ ECODE_MINOR_VERSION=$(grep "define ECODE_MINOR_VERSION" $VERSIONPATH | awk '{pri ECODE_PATCH_LEVEL=$(grep "define ECODE_PATCH_LEVEL" $VERSIONPATH | awk '{print $3}') ECODE_ZIP_NAME=ecode-windows-$ECODE_MAJOR_VERSION.$ECODE_MINOR_VERSION.$ECODE_PATCH_LEVEL-$ARCH.zip -zip -r "$ECODE_ZIP_NAME" ecode/ \ No newline at end of file +zip -r "$ECODE_ZIP_NAME" ecode/ diff --git a/src/eepp/system/iostreamstring.cpp b/src/eepp/system/iostreamstring.cpp index 22ea83cba..95f341232 100644 --- a/src/eepp/system/iostreamstring.cpp +++ b/src/eepp/system/iostreamstring.cpp @@ -1,9 +1,14 @@ #include +#include #include namespace EE { namespace System { -IOStreamString::IOStreamString() : mPos( 0 ) {} +IOStreamString::IOStreamString() {} + +IOStreamString::IOStreamString( const std::string& filepath ) { + FileSystem::fileGet( filepath, mStream ); +} ios_size IOStreamString::read( char* data, ios_size size ) { Int64 endPosition = mPos + size; diff --git a/src/eepp/ui/uimenu.cpp b/src/eepp/ui/uimenu.cpp index 1ee5fa6f2..7b933b7e5 100644 --- a/src/eepp/ui/uimenu.cpp +++ b/src/eepp/ui/uimenu.cpp @@ -736,6 +736,11 @@ void UIMenu::findBestMenuPos( Vector2f& pos, UIMenu* menu, UIMenu* parent, pos = { pos.x, 0 }; } } + + if ( pos.x < 0 ) + pos.x = 0; + if ( pos.y < 0 ) + pos.y = 0; } } } diff --git a/src/tools/ecode/appconfig.cpp b/src/tools/ecode/appconfig.cpp index b046e0653..a442bb69e 100644 --- a/src/tools/ecode/appconfig.cpp +++ b/src/tools/ecode/appconfig.cpp @@ -70,7 +70,7 @@ void AppConfig::load( const std::string& confPath, std::string& keybindingsPath, ini.getValueB( "editor", "highlight_matching_brackets", true ); editor.highlightCurrentLine = ini.getValueB( "editor", "highlight_current_line", true ); editor.verticalScrollbar = ini.getValueB( "editor", "vertical_scrollbar", true ); - editor.horizontalScrollbar = ini.getValueB( "editor", "horizontal_scrollbar", false ); + editor.horizontalScrollbar = ini.getValueB( "editor", "horizontal_scrollbar", true ); ui.fontSize = ini.getValue( "ui", "font_size", "11dp" ); ui.showSidePanel = ini.getValueB( "ui", "show_side_panel", true ); ui.panelPosition = panelPositionFromString( ini.getValue( "ui", "panel_position", "left" ) ); @@ -98,11 +98,11 @@ void AppConfig::load( const std::string& confPath, std::string& keybindingsPath, editor.colorPreview = ini.getValueB( "editor", "color_preview", true ); editor.minimap = ini.getValueB( "editor", "minimap", true ); editor.showDocInfo = ini.getValueB( "editor", "show_doc_info", true ); - editor.hideTabBarOnSingleTab = ini.getValueB( "editor", "hide_tab_bar_on_single_tab", true ); + editor.hideTabBarOnSingleTab = ini.getValueB( "editor", "hide_tab_bar_on_single_tab", false ); editor.singleClickTreeNavigation = ini.getValueB( "editor", "single_click_tree_navigation", false ); editor.syncProjectTreeWithEditor = - ini.getValueB( "editor", "sync_project_tree_with_editor", false ); + ini.getValueB( "editor", "sync_project_tree_with_editor", true ); editor.autoCloseXMLTags = ini.getValueB( "editor", "auto_close_xml_tags", true ); editor.lineSpacing = ini.getValue( "editor", "line_spacing", "0dp" ); diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index 5babbf5f8..3fbeafba5 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -376,7 +376,7 @@ void App::loadConfig( const LogLevel& logLevel ) { FileSystem::makeDir( mConfigPath ); FileSystem::dirAddSlashAtEnd( mConfigPath ); mPluginsPath = mConfigPath + "plugins"; - mColorSchemesPath = mConfigPath + "colorschemes"; + mColorSchemesPath = mConfigPath + "editor" + FileSystem::getOSSlash() + "colorschemes"; mTerminalManager = std::make_unique( this ); mTerminalManager->setTerminalColorSchemesPath( mConfigPath + "terminal" + FileSystem::getOSSlash() + "colorschemes" ); @@ -2053,11 +2053,13 @@ static void updateKeybindings( IniFile& ini, const std::string& group, Input* in for ( const auto& key : keybindings ) invertedKeybindings[key.second] = key.first; + bool keybindingsWereEmpty = keybindings.empty(); + if ( defKeybindings.size() != keybindings.size() || forceRebind ) { for ( const auto& key : defKeybindings ) { auto foundCmd = invertedKeybindings.find( key.second ); auto shortcutStr = bindings.getShortcutString( key.first ); - if ( foundCmd == invertedKeybindings.end() && + if ( ( foundCmd == invertedKeybindings.end() || keybindingsWereEmpty ) && keybindings.find( shortcutStr ) == keybindings.end() ) { keybindings[shortcutStr] = key.second; invertedKeybindings[key.second] = shortcutStr; diff --git a/src/tools/ecode/version.hpp b/src/tools/ecode/version.hpp index a33a34128..bdd3674d4 100644 --- a/src/tools/ecode/version.hpp +++ b/src/tools/ecode/version.hpp @@ -8,7 +8,7 @@ using namespace EE; #define ECODE_MAJOR_VERSION 0 #define ECODE_MINOR_VERSION 3 -#define ECODE_PATCH_LEVEL 0 +#define ECODE_PATCH_LEVEL 1 #define ECODE_CODENAME "Mūlādhāra" /** The compiled version of the library */