From 5797b2d64e1402c84bc67a47cf7a82e81ca47923 Mon Sep 17 00:00:00 2001 From: "ulukyn@gmail.com" Date: Tue, 22 Aug 2017 23:22:06 +0200 Subject: [PATCH 1/6] Fixed: Resize collision when scale object/npc (using vpb) --HG-- branch : develop --- code/ryzom/client/src/character_cl.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/ryzom/client/src/character_cl.cpp b/code/ryzom/client/src/character_cl.cpp index 228e3dbde..e73592acd 100644 --- a/code/ryzom/client/src/character_cl.cpp +++ b/code/ryzom/client/src/character_cl.cpp @@ -1718,6 +1718,17 @@ void CCharacterCL::updateVisualPropertyVpb(const NLMISC::TGameCycle &/* gameCycl _Instances[0].setScale(CVector(s,s,s)); } + + if (_Primitive) + { + float width, depth; + _Primitive->getSize(width, depth); + UMovePrimitive::TType primtype = _Primitive->getPrimitiveType(); + _Primitive->setPrimitiveType(UMovePrimitive::_2DOrientedBox); + _Primitive->setSize((width / oldCustomScale) * _CustomScale, (depth / oldCustomScale) * _CustomScale); + _Primitive->setPrimitiveType(primtype); + } + }// updateVisualPropertyVpb // //----------------------------------------------- From 3c6dc5ea92c9a530a1aad4fa7e31b740ea723dae Mon Sep 17 00:00:00 2001 From: "ulukyn@gmail.com" Date: Tue, 22 Aug 2017 23:23:00 +0200 Subject: [PATCH 2/6] Added: loadBackground(string) lua function to change the texture of next teleport --HG-- branch : develop --- code/ryzom/client/src/global.cpp | 1 + code/ryzom/client/src/global.h | 3 ++- code/ryzom/client/src/init_main_loop.cpp | 14 +++++++++++--- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 17 +++++++++++------ .../client/src/interface_v3/lua_ihm_ryzom.h | 1 + 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/code/ryzom/client/src/global.cpp b/code/ryzom/client/src/global.cpp index 7c298ca58..4b8e1aad7 100644 --- a/code/ryzom/client/src/global.cpp +++ b/code/ryzom/client/src/global.cpp @@ -65,6 +65,7 @@ bool InitCloudScape = true; // tells that the cloud scape must be reinitial CEntityAnimationManager *EAM = NULL; CProgress ProgressBar; TBackground LoadingBackground = StartBackground; +string LoadingBackgroundBG; string LoadingMusic; CContinent *LoadingContinent = NULL; bool ConnectionReadySent= false; diff --git a/code/ryzom/client/src/global.h b/code/ryzom/client/src/global.h index de9aa6a73..78cebcec9 100644 --- a/code/ryzom/client/src/global.h +++ b/code/ryzom/client/src/global.h @@ -62,7 +62,7 @@ enum TBackground ResurectKamiBackground, ResurectKaravanBackground, EndBackground, - IntroNevrax, + CustomBackground, IntroNVidia, LoadBackground, }; @@ -119,6 +119,7 @@ extern bool InitCloudScape; // tells that the cloud scape must be reinitia extern CEntityAnimationManager *EAM; extern CProgress ProgressBar; extern TBackground LoadingBackground; +extern std::string LoadingBackgroundBG; extern std::string LoadingMusic; extern CContinent *LoadingContinent; extern bool ConnectionReadySent; diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index ced1c85a6..cce91b5ba 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -1464,8 +1464,8 @@ void loadBackgroundBitmap (TBackground background) case EndBackground: filename = ClientCfg.End_BG; break; - case IntroNevrax: - filename = ClientCfg.IntroNevrax_BG; + case CustomBackground: // SpecialCase + filename = LoadingBackgroundBG; break; case IntroNVidia: filename = ClientCfg.IntroNVidia_BG; @@ -1535,7 +1535,15 @@ void loadBackgroundBitmap (TBackground background) void beginLoading (TBackground background) { LoadingContinent = NULL; - loadBackgroundBitmap (background); + if (!LoadingBackgroundBG.empty()) + { + loadBackgroundBitmap(CustomBackground); + LoadingBackgroundBG = ""; + } + else + { + loadBackgroundBitmap (background); + } } // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 1e11ae722..f6d8c9ef4 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -513,6 +513,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) LUABIND_FUNC(unpauseBGDownloader), LUABIND_FUNC(requestBGDownloaderPriority), LUABIND_FUNC(getBGDownloaderPriority), + LUABIND_FUNC(loadBackground), LUABIND_FUNC(getPatchLastErrorMessage), LUABIND_FUNC(getPlayerSelectedSlot), LUABIND_FUNC(isInGame), @@ -2047,7 +2048,8 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) float x = 0.0f, y = 0.0f, z = 0.0f; float scale = 1.0f; string context, url, skeleton, texture; - bool highlight, transparency, collision = false; + bool highlight, transparency = false; + bool collision = true; if (ls.getTop() >= 2) { @@ -2137,11 +2139,6 @@ int CLuaIHMRyzom::addShape(CLuaState &ls) CLuaIHM::checkArgType(ls, funcName, 13, LUA_TSTRING); skeleton = ls.toString(13); } - - /// ??????????????? - transparency = false; - highlight = false; - collision = true; CShapeInstanceReference instref = EntitiesMngr.createInstance(shape, CVector(x, y, z), context, url, collision, idx); UInstance instance = instref.Instance; @@ -3004,6 +3001,14 @@ sint CLuaIHMRyzom::getBGDownloaderPriority() return CBGDownloaderAccess::getInstance().getDownloadThreadPriority(); } +// *************************************************************************** +void CLuaIHMRyzom::loadBackground(const std::string &bg) +{ + LoadingBackground = CustomBackground; + LoadingBackgroundBG = bg; +} + + // *************************************************************************** ucstring CLuaIHMRyzom::getPatchLastErrorMessage() { diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h index b4712a253..0c29bbd3c 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -169,6 +169,7 @@ private: static void unpauseBGDownloader(); static void requestBGDownloaderPriority(uint priority); static sint getBGDownloaderPriority(); + static void loadBackground(const std::string &bg); static ucstring getPatchLastErrorMessage(); static bool isInGame(); static uint32 getPlayerSelectedSlot(); From afd4e964e3fa19954310b9966d0a34127e280a89 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 31 Aug 2017 11:53:44 +0300 Subject: [PATCH 3/6] Fixed: Path to NeL test files --HG-- branch : develop --- code/nel/tools/nel_unit_test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/tools/nel_unit_test/CMakeLists.txt b/code/nel/tools/nel_unit_test/CMakeLists.txt index 7e26a2498..6abc06a49 100644 --- a/code/nel/tools/nel_unit_test/CMakeLists.txt +++ b/code/nel/tools/nel_unit_test/CMakeLists.txt @@ -8,6 +8,6 @@ TARGET_LINK_LIBRARIES(nel_unit_test ${CPPTEST_LIBRARIES} nelmisc nelnet nelligo) NL_DEFAULT_PROPS(nel_unit_test "Unit Tests") NL_ADD_RUNTIME_FLAGS(nel_unit_test) -ADD_DEFINITIONS(-DNEL_UNIT_BASE="${PROJECT_SOURCE_DIR}/tools/nel_unit_test/") +ADD_DEFINITIONS(-DNEL_UNIT_BASE="${PROJECT_SOURCE_DIR}/nel/tools/nel_unit_test/") INSTALL(TARGETS nel_unit_test RUNTIME DESTINATION ${NL_BIN_PREFIX}) From c22b361dc2443c2955e4c70843d5b8072147bf65 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 31 Aug 2017 12:36:06 +0300 Subject: [PATCH 4/6] Changed: Remove NeL tests temp files --HG-- branch : develop --- .../tools/nel_unit_test/__copy_file_dst.foo | Bin 1027 -> 0 bytes code/nel/tools/nel_unit_test/__ligo_class.xml | 21 - .../tools/nel_unit_test/__test_prim.primitive | 27 - .../debug_cfg_with_error_main.cfg | 41 - code/nel/tools/nel_unit_test/result.html | 820 ------------------ 5 files changed, 909 deletions(-) delete mode 100644 code/nel/tools/nel_unit_test/__copy_file_dst.foo delete mode 100644 code/nel/tools/nel_unit_test/__ligo_class.xml delete mode 100644 code/nel/tools/nel_unit_test/__test_prim.primitive delete mode 100644 code/nel/tools/nel_unit_test/debug_cfg_with_error_main.cfg delete mode 100644 code/nel/tools/nel_unit_test/result.html diff --git a/code/nel/tools/nel_unit_test/__copy_file_dst.foo b/code/nel/tools/nel_unit_test/__copy_file_dst.foo deleted file mode 100644 index ab13f948afc2a382171fc6cd6d2e64ccfb98d618..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1027 zcmZQzWMXDvWn<^yMC+6cQE@6%&_`l#-T_m6KOcR8m$^Ra4i{)Y8_`)zddH zG%_|ZH8Z!cw6eCbwX=6{baHlab#wRd^z!!c_45x13RUz zF>}`JIdkXDU$Ah|;w4L$Enl&6)#^2C*R9{Mant54TeofBv2)k%J$v` - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/nel/tools/nel_unit_test/__test_prim.primitive b/code/nel/tools/nel_unit_test/__test_prim.primitive deleted file mode 100644 index 479734bcb..000000000 --- a/code/nel/tools/nel_unit_test/__test_prim.primitive +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - class - test - - - name - test_root - - - - - class - alias - - - name - alias - - - - - diff --git a/code/nel/tools/nel_unit_test/debug_cfg_with_error_main.cfg b/code/nel/tools/nel_unit_test/debug_cfg_with_error_main.cfg deleted file mode 100644 index 72c6bdf68..000000000 --- a/code/nel/tools/nel_unit_test/debug_cfg_with_error_main.cfg +++ /dev/null @@ -1,41 +0,0 @@ -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 1 -// This config file include the config file with error then generate an error -// WARNING : is you add lines, update the code in the test - - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error.cfg" 1 -// In this cfg, we introduce an error in a line after define and if clause - - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error.cfg" 5 - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error.cfg" 7 - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error.cfg" 9 - // nothing - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error.cfg" 13 -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error.cfg" 15 - - -// Here is the offending line, at line 18 -ABadVar iable = "foo"; - -// Some additionnal garbase lines - -AGoodVar = "bar"; -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 6 - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 8 -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 9 - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 11 - // nothing - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 15 -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 17 - - -// Some additionnal garbase lines - -AGoodVar = "bar"; diff --git a/code/nel/tools/nel_unit_test/result.html b/code/nel/tools/nel_unit_test/result.html deleted file mode 100644 index 057425b9f..000000000 --- a/code/nel/tools/nel_unit_test/result.html +++ /dev/null @@ -1,820 +0,0 @@ - - - - - - - NeLTest Unit Tests Results - - - - - - -

NeLTest Unit Tests Results

- -
-Designed by CppTest -
-
- -

Summary

- - - - - - - - - - - - - -
TestsErrorsSuccessTime (s)
66198%35.265000
-
- -

Test suites

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTestsErrorsSuccessTime (s)
CUTMiscCoTask20100%0.000000
CUTMiscCommand50100%0.015000
CUTMiscConfigFile60100%0.032000
CUTMiscDebug20100%0.000000
CUTMiscDynLibLoad 10100%0.000000
CUTMiscFile40100%0.859000
CUTMiscPackFile110100%0.016000
CUTMiscSingleton20100%0.000000
CUTMiscSString10100%0.000000
CUTMiscStream40100%0.000000
CUTMiscVariable 10100%0.000000
CUTMiscTypes110%0.000000
CUTNetLayer310100%2.312000
CUTNetMessage30100%0.000000
CUTNetModule210100%32.031000
CUTLigoPrimitive10100%0.000000
-
- -

Suite: CUTMiscCoTask

- - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
runTasks0true0.000000
tasksAndThreads0true0.000000
-

Back to top -

-

Suite: CUTMiscCommand

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
createOneInstance0true0.015000
createAnotherInstance0true0.000000
deleteOneInstance0true0.000000
derivedClass0true0.000000
derivedClassAndBaseCall0true0.000000
-

Back to top -

-

Suite: CUTMiscConfigFile

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
configWithInclude0true0.016000
configWithOptional0true0.000000
configWithDefine0true0.000000
configWithBadTest0true0.000000
configIncludeAndOptional0true0.000000
reportErrorInSubFiles0true0.016000
-

Back to top -

-

Suite: CUTMiscDebug

- - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
testInstanceCounter0true0.000000
testInstanceCounterOutput0true0.000000
-

Back to top -

-

Suite: CUTMiscDynLibLoad

- - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
libraryNameDecoration0true0.000000
-

Back to top -

-

Suite: CUTMiscFile

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
copyOneBigFile0true0.187000
copyDifferentFileSize0true0.203000
moveOneBigFile0true0.203000
moveDifferentFileSize0true0.266000
-

Back to top -

-

Suite: CUTMiscPackFile

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
addBnp0true0.000000
loadFromBnp0true0.000000
addXmlpack0true0.016000
loadFromXmlpack0true0.000000
compressMemory0true0.000000
loadFromBnpCompressed0true0.000000
loadFromXmlpackCompressed0true0.000000
decompressMemory0true0.000000
loadFromBnpUncompressed0true0.000000
loadFromXmlpackUncompressed0true0.000000
loadXmlpackWithSameName0true0.000000
-

Back to top -

-

Suite: CUTMiscSingleton

- - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
createSingleton0true0.000000
accessSingleton0true0.000000
-

Back to top -

-

Suite: CUTMiscSString

- - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
testStrtok0true0.000000
-

Back to top -

-

Suite: CUTMiscStream

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
constAndStream0true0.000000
memStreamSwap0true0.000000
copyOnWrite0true0.000000
preallocatedBitStream0true0.000000
-

Back to top -

-

Suite: CUTMiscVariable

- - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
declareVar0true0.000000
-

Back to top -

-

Suite: CUTMiscTypes

- - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
basicTypes1false0.000000
-

Back to top -

-

Suite: CUTNetLayer3

- - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
sendReceiveUpdate0true2.312000
-

Back to top -

-

Suite: CUTNetMessage

- - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
messageSwap0true0.000000
lockSubMEssage0true0.000000
lockSubMEssageWithLongName0true0.000000
-

Back to top -

-

Suite: CUTNetModule

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
testModuleInitInfoParsing0true0.000000
testModuleInitInfoQuering0true0.000000
testModuleInitInfoBadParsing0true0.000000
localModuleFactory0true0.016000
failedInit0true0.000000
createLocalGateway0true0.000000
plugLocalGateway0true0.000000
gatewayTransportManagement0true1.219000
connectGateways0true0.828000
moduleDisclosure0true1.328000
moduleMessaging0true1.625000
localMessageQueing0true0.609000
uniqueNameGenerator0true0.000000
gwPlugUnplug0true0.000000
peerInvisible0true3.453000
firewalling0true3.438000
distanceAndConnectionLoop0true6.109000
securityPlugin0true5.094000
synchronousMessaging0true1.031000
layer3Autoconnect0true6.672000
interceptorTest0true0.609000
-

Back to top -

-

Suite: CUTLigoPrimitive

- - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
testAliasGenerator0true0.000000
-

Back to top -

-
- -

Test results

-

CUTMiscTypes::basicTypes

- - - - - - - - - - - - - -
TestCUTMiscTypes::basicTypes
Filed:\ryzom\nel\tools\nel_unit_test\ut_misc_types.h:31
Messagesizeof(time_t) == sizeof(uint32)
-

Back to CUTMiscTypes -

-
- - -

- - Valid XHTML 1.0 Strict - -

- - From d6dcf7415a968d28f0176f90a34a93f7e867b39d Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sat, 2 Sep 2017 23:13:04 +0300 Subject: [PATCH 5/6] Fixed: Multiline text inside lists --HG-- branch : develop --- code/nel/include/nel/gui/group_html.h | 7 ++- code/nel/include/nel/gui/interface_element.h | 6 +++ code/nel/include/nel/gui/view_text.h | 4 +- code/nel/src/gui/group_html.cpp | 51 +++++++++++--------- code/nel/src/gui/interface_element.cpp | 4 +- code/nel/src/gui/interface_group.cpp | 8 +-- code/nel/src/gui/view_text.cpp | 2 +- 7 files changed, 48 insertions(+), 34 deletions(-) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 969eac1f7..8d3478579 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -714,7 +714,12 @@ namespace NLGUI std::vector _CellParams; // Indentation - uint _Indent; + std::vector _Indent; + inline uint getIndent() const { + if (_Indent.empty()) + return 0; + return _Indent.back(); + } // Current node is a title bool _Title; diff --git a/code/nel/include/nel/gui/interface_element.h b/code/nel/include/nel/gui/interface_element.h index 65a0fcaff..cd82417d6 100644 --- a/code/nel/include/nel/gui/interface_element.h +++ b/code/nel/include/nel/gui/interface_element.h @@ -94,6 +94,7 @@ namespace NLGUI _XReal = _YReal = _WReal = _HReal = 0; _X = _Y = _W = _H = 0; //_Snap = 1; + _MarginLeft = 0; _PosRef = Hotspot_BL; _ParentPosRef = Hotspot_BL; @@ -178,6 +179,9 @@ namespace NLGUI sint32 getH() const { return (_Active?_H:0); } sint32 getH(bool bTestActive) const { return (bTestActive?(_Active?_H:0):_H); } + void setMarginLeft(sint32 m) { _MarginLeft = m; } + sint32 getMarginLeft() const { return _MarginLeft; } + /** * Get the max width used by the window. * @@ -568,6 +572,8 @@ namespace NLGUI sint32 _W; sint32 _H; + sint32 _MarginLeft; + //sint32 _Snap; // position references e.g. : _PosRef=BL, _ParentPosref=MM : the bottom left corner of the element diff --git a/code/nel/include/nel/gui/view_text.h b/code/nel/include/nel/gui/view_text.h index a00932667..8b8e1a7cf 100644 --- a/code/nel/include/nel/gui/view_text.h +++ b/code/nel/include/nel/gui/view_text.h @@ -93,7 +93,7 @@ namespace NLGUI void setMultiLineSpace (sint nMultiLineSpace); void setMultiLineMaxWOnly (bool state); void setMultiLineClipEndSpace (bool state); // use it for multiline edit box for instance - void setFirstLineX (uint firstLineX); + void setFirstLineX (sint firstLineX); void setMultiMaxLine(uint l) { _MultiMaxLine = l; } void setMultiMinLine(uint l) { _MultiMinLine = l; } @@ -398,7 +398,7 @@ namespace NLGUI uint _TextSelectionEnd; // First line X coordinate - uint _FirstLineX; + sint _FirstLineX; /// Dynamic tooltips std::vector _Tooltips; diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index ab5644f9d..e616f56bd 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -2181,8 +2181,9 @@ namespace NLGUI sint32 indent = LIIndent; // list-style-type: outside if (_CurrentViewLink) - indent -= _CurrentViewLink->getMaxUsedW(); - getParagraph()->setFirstViewIndent(indent); + { + getParagraph()->setFirstViewIndent(-_CurrentViewLink->getMaxUsedW()); + } flushString (); @@ -2238,8 +2239,7 @@ namespace NLGUI if (present[MY_HTML_TABLE_CELLPADDING] && value[MY_HTML_TABLE_CELLPADDING]) fromString(value[MY_HTML_TABLE_CELLPADDING], table->CellPadding); - // Table must fit the container size - + table->setMarginLeft(getIndent()); addHtmlGroup (table, 0); _Tables.push_back(table); @@ -2247,6 +2247,7 @@ namespace NLGUI // Add a cell pointer _Cells.push_back(NULL); _TR.push_back(false); + _Indent.push_back(0); } break; case HTML_TH: @@ -2328,7 +2329,12 @@ namespace NLGUI _Cells.back()->NewLine = getTR(); table->addChild (_Cells.back()); + + // reusing indent pushed by table + _Indent.back() = 0; + newParagraph(TDBeginSpace); + // indent is already 0, getParagraph()->setMarginLeft(0); // maybe setIndent(0) if LI is using one // Reset TR flag if (!_TR.empty()) @@ -2418,7 +2424,7 @@ namespace NLGUI _UL.push_back(HTMLOListElement(1, "square")); // if LI is already present _LI = _UL.size() > 1 || _DL.size() > 1; - _Indent += ULIndent; + _Indent.push_back(getIndent() + ULIndent); endParagraph(); break; case HTML_OBJECT: @@ -2489,6 +2495,13 @@ namespace NLGUI case HTML_DT: if (!_DL.empty()) { + // close DT if still open + if (_DL.back().DD) + { + _DL.back().DD = false; + popIfNotEmpty(_Indent); + } + // see if this is the first
, closing tag not required if (!_DL.back().DT) { @@ -2519,8 +2532,8 @@ namespace NLGUI if (!_DL.back().DD) { - _Indent += ULIndent; _DL.back().DD = true; + _Indent.push_back(getIndent() + ULIndent); } if (!_LI) @@ -2547,7 +2560,7 @@ namespace NLGUI _UL.push_back(HTMLOListElement(start, type)); // if LI is already present _LI = _UL.size() > 1 || _DL.size() > 1; - _Indent += ULIndent; + _Indent.push_back(getIndent() + ULIndent); endParagraph(); } break; @@ -2659,6 +2672,7 @@ namespace NLGUI popIfNotEmpty (_TR); popIfNotEmpty (_Cells); popIfNotEmpty (_Tables); + popIfNotEmpty (_Indent); endParagraph(); // Add a cell break; @@ -2801,13 +2815,9 @@ namespace NLGUI case HTML_UL: if (!_UL.empty()) { - if (_Indent > ULIndent) - _Indent = _Indent - ULIndent; - else - _Indent = 0; - endParagraph(); popIfNotEmpty(_UL); + popIfNotEmpty(_Indent); } break; case HTML_DL: @@ -2824,10 +2834,7 @@ namespace NLGUI // unclosed DD if (_DL.back().DD) { - if (_Indent > ULIndent) - _Indent = _Indent - ULIndent; - else - _Indent = 0; + popIfNotEmpty(_Indent); } popIfNotEmpty (_DL); @@ -2846,12 +2853,8 @@ namespace NLGUI // parser will process two DD in a row as nested when first DD is not closed if (_DL.back().DD) { - if (_Indent > ULIndent) - _Indent = _Indent - ULIndent; - else - _Indent = 0; - _DL.back().DD = false; + popIfNotEmpty(_Indent); } } break; @@ -2964,7 +2967,7 @@ namespace NLGUI _Connecting = false; _CurrentViewLink = NULL; _CurrentViewImage = NULL; - _Indent = 0; + _Indent.clear(); _LI = false; _SelectOption = false; _GroupListAdaptor = NULL; @@ -4033,7 +4036,7 @@ namespace NLGUI CGroupParagraph *newParagraph = new CGroupParagraph(CViewBase::TCtorParam()); newParagraph->setResizeFromChildH(true); - newParagraph->setIndent(_Indent); + newParagraph->setMarginLeft(getIndent()); // Add to the group addHtmlGroup (newParagraph, beginSpace); @@ -4767,7 +4770,7 @@ namespace NLGUI _FontOblique.clear(); _FontUnderlined.clear(); _FontStrikeThrough.clear(); - _Indent = 0; + _Indent.clear(); _LI = false; _UL.clear(); _DL.clear(); diff --git a/code/nel/src/gui/interface_element.cpp b/code/nel/src/gui/interface_element.cpp index e33d1dbd8..2e13d80e6 100644 --- a/code/nel/src/gui/interface_element.cpp +++ b/code/nel/src/gui/interface_element.cpp @@ -509,7 +509,7 @@ namespace NLGUI // ------------------------------------------------------------------------------------------------ void CInterfaceElement::updateCoords() { - _XReal = _X; + _XReal = _X + _MarginLeft; _YReal = _Y; _WReal = getW(); _HReal = getH(); @@ -526,7 +526,7 @@ namespace NLGUI if (el == NULL) return; - _XReal += el->_XReal; + _XReal += el->_XReal - el->_MarginLeft; _YReal += el->_YReal; THotSpot hsParent = _ParentPosRef; diff --git a/code/nel/src/gui/interface_group.cpp b/code/nel/src/gui/interface_group.cpp index fc75ae0db..dce9fc266 100644 --- a/code/nel/src/gui/interface_group.cpp +++ b/code/nel/src/gui/interface_group.cpp @@ -1457,7 +1457,7 @@ namespace NLGUI } CViewBase::updateCoords(); - _XReal += _OffsetX; + _XReal += _OffsetX + _MarginLeft; _YReal += _OffsetY; //update all children elements @@ -1468,7 +1468,7 @@ namespace NLGUI pIE->updateCoords(); } - _XReal -= _OffsetX; + _XReal -= _OffsetX - _MarginLeft; _YReal -= _OffsetY; } @@ -1958,9 +1958,9 @@ namespace NLGUI newSciH = newSciH - ((newSciY+newSciH)-(oldSciY+oldSciH)); } - newSciXDest = newSciX; + newSciXDest = newSciX - _MarginLeft; newSciYDest = newSciY; - newSciWDest = newSciW; + newSciWDest = newSciW + _MarginLeft; newSciHDest = newSciH; } diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index e145db91c..2faae3a0a 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -2494,7 +2494,7 @@ namespace NLGUI } // *************************************************************************** - void CViewText::setFirstLineX(uint firstLineX) + void CViewText::setFirstLineX(sint firstLineX) { _FirstLineX = firstLineX; } From 9dce8df5469b360821373ac36f4af86e55f5ef31 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sat, 2 Sep 2017 23:13:47 +0300 Subject: [PATCH 6/6] Fixed: Image tooltip not showing correctly --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index e616f56bd..b185c67c3 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -225,8 +225,6 @@ namespace NLGUI btn->setTexturePushed(file); btn->invalidateCoords(); btn->invalidateContent(); - btn->resetInvalidCoords(); - btn->updateCoords(); paragraphChange(); } else @@ -242,8 +240,6 @@ namespace NLGUI btm->setTexture (file); btm->invalidateCoords(); btm->invalidateContent(); - btm->resetInvalidCoords(); - btm->updateCoords(); paragraphChange(); } else @@ -254,14 +250,12 @@ namespace NLGUI btgc->setTexture (file); btgc->invalidateCoords(); btgc->invalidateContent(); - btgc->resetInvalidCoords(); - btgc->updateCoords(); paragraphChange(); } } } } - + // Force image width, height void CGroupHTML::setImageSize(CViewBase *view, const CStyleParams &style) {