Add AVA2-style display options (effect level, trees, clouds)

Client-only port of ENABLE_GRAPHIC_ON_OFF / HIDE_OBJECTS: five effect
levels toggle attached actor effects via Active/Deactive, tree and cloud
parts use background.SetVisiblePart, plus shortcuts for the original
name and damage options. mt_display window, mt_display.cfg, port.display
test, docs/AVA2-DISPLAY.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-15 21:11:25 +09:00
co-authored by Claude Opus 5.5
parent e22d7ba6fd
commit e546f91e03
15 changed files with 376 additions and 0 deletions
+21
View File
@@ -4,6 +4,7 @@
#include "PythonNonPlayer.h"
#include "PythonPlayer.h"
#include "PythonCharacterManager.h"
#include "PythonSystem.h"
#include "AbstractPlayer.h"
#include "AbstractApplication.h"
#include "Packet.h"
@@ -1868,6 +1869,7 @@ void CInstanceBase::Update()
{
++ms_dwUpdateCounter;
__UpdateEffectShown();
StateProcess();
m_GraphicThingInstance.PhysicsProcess();
m_GraphicThingInstance.RotationProcess();
@@ -2454,6 +2456,25 @@ bool CInstanceBase::__IsInViewFrustum()
return m_GraphicThingInstance.isShow();
}
// PORT: AVA2 ENABLE_GRAPHIC_ON_OFF effect level, applied to attached effects (skills, buffs, refine glow).
void CInstanceBase::__UpdateEffectShown()
{
const int iLevel = CPythonSystem::Instance().GetEffectLevel();
bool isShown = true;
if (iLevel == 4)
isShown = false;
else if (iLevel != 0 && !__IsMainInstance())
{
if (iLevel == 1)
isShown = IsEnemy() || IsStone();
else if (iLevel == 2)
isShown = IsPC();
else
isShown = false;
}
m_GraphicThingInstance.SetAttachingEffectShown(isShown);
}
bool CInstanceBase::__CanRender()
{
if (!__IsInViewFrustum())
+1
View File
@@ -407,6 +407,7 @@ class CInstanceBase
protected:
bool __IsExistMainInstance();
bool __IsMainInstance();
void __UpdateEffectShown();
bool __MainCanSeeHiddenThing();
float __GetBowRange();
+4
View File
@@ -110,6 +110,9 @@ class CPythonSystem : public CSingleton<CPythonSystem>
bool IsAlwaysShowName();
bool IsShowDamage();
bool IsShowSalesText();
// PORT: AVA2 effect_level (0 all, 1 hide players/NPCs, 2 hide monsters/NPCs, 3 hide others, 4 hide all).
int GetEffectLevel() { return m_iPortEffectLevel; }
void SetEffectLevel(int iLevel) { m_iPortEffectLevel = iLevel < 0 || iLevel > 4 ? 0 : iLevel; }
bool IsUseDefaultIME();
bool IsNoSoundCard();
bool IsAutoTiling();
@@ -159,4 +162,5 @@ class CPythonSystem : public CSingleton<CPythonSystem>
bool m_isInterfaceConfig;
PyObject * m_poInterfaceHandler;
TWindowStatus m_WindowStatus[WINDOW_MAX_NUM];
int m_iPortEffectLevel = 0;
};
@@ -211,6 +211,22 @@ PyObject * systemSetShowSalesTextFlag(PyObject * poSelf, PyObject * poArgs)
return Py_BuildNone();
}
PyObject * systemSetEffectLevel(PyObject * poSelf, PyObject * poArgs)
{
int iLevel;
if (!PyTuple_GetInteger(poArgs, 0, &iLevel))
return Py_BuildException();
CPythonSystem::Instance().SetEffectLevel(iLevel);
return Py_BuildNone();
}
PyObject * systemGetEffectLevel(PyObject * poSelf, PyObject * poArgs)
{
return Py_BuildValue("i", CPythonSystem::Instance().GetEffectLevel());
}
PyObject * systemIsAlwaysShowName(PyObject * poSelf, PyObject * poArgs)
{
return Py_BuildValue("i", CPythonSystem::Instance().IsAlwaysShowName());
@@ -422,6 +438,8 @@ void initsystem()
{ "SetShowSalesTextFlag", systemSetShowSalesTextFlag, METH_VARARGS },
{ "IsShowSalesText", systemIsShowSalesText, METH_VARARGS },
{ "SetEffectLevel", systemSetEffectLevel, METH_VARARGS }, // PORT: AVA2
{ "GetEffectLevel", systemGetEffectLevel, METH_VARARGS },
{ "GetShadowLevel", systemGetShadowLevel, METH_VARARGS },
{ "SetShadowLevel", systemSetShadowLevel, METH_VARARGS },