mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-21 19:31:14 +00:00
Added APROP_SoundClass
- Added APROP_SoundClass to GetActorProperty, SetActorProperty, CheckActorProperty
This commit is contained in:
parent
08fc91fe3e
commit
852a96497d
4 changed files with 22 additions and 2 deletions
|
@ -391,6 +391,7 @@ public:
|
||||||
float BlendB = 0;
|
float BlendB = 0;
|
||||||
float BlendA = 0;
|
float BlendA = 0;
|
||||||
|
|
||||||
|
FString SoundClass;
|
||||||
FString LogText; // [RH] Log for Strife
|
FString LogText; // [RH] Log for Strife
|
||||||
FString SubtitleText;
|
FString SubtitleText;
|
||||||
int SubtitleCounter;
|
int SubtitleCounter;
|
||||||
|
|
|
@ -4044,6 +4044,7 @@ enum
|
||||||
APROP_MaxStepHeight = 44,
|
APROP_MaxStepHeight = 44,
|
||||||
APROP_MaxDropOffHeight= 45,
|
APROP_MaxDropOffHeight= 45,
|
||||||
APROP_DamageType = 46,
|
APROP_DamageType = 46,
|
||||||
|
APROP_SoundClass = 47,
|
||||||
};
|
};
|
||||||
|
|
||||||
// These are needed for ACS's APROP_RenderStyle
|
// These are needed for ACS's APROP_RenderStyle
|
||||||
|
@ -4307,6 +4308,17 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
|
||||||
actor->DamageType = Level->Behaviors.LookupString(value);
|
actor->DamageType = Level->Behaviors.LookupString(value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case APROP_SoundClass:
|
||||||
|
if (actor->IsKindOf(NAME_PlayerPawn))
|
||||||
|
{
|
||||||
|
if (actor->player != NULL)
|
||||||
|
{
|
||||||
|
actor->player->SoundClass = Level->Behaviors.LookupString(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// do nothing.
|
// do nothing.
|
||||||
break;
|
break;
|
||||||
|
@ -4404,6 +4416,7 @@ int DLevelScript::GetActorProperty (int tid, int property)
|
||||||
case APROP_MaxStepHeight: return DoubleToACS(actor->MaxStepHeight);
|
case APROP_MaxStepHeight: return DoubleToACS(actor->MaxStepHeight);
|
||||||
case APROP_MaxDropOffHeight: return DoubleToACS(actor->MaxDropOffHeight);
|
case APROP_MaxDropOffHeight: return DoubleToACS(actor->MaxDropOffHeight);
|
||||||
case APROP_DamageType: return GlobalACSStrings.AddString(actor->DamageType.GetChars());
|
case APROP_DamageType: return GlobalACSStrings.AddString(actor->DamageType.GetChars());
|
||||||
|
case APROP_SoundClass: return GlobalACSStrings.AddString(actor->player->SoundClass.GetChars());
|
||||||
|
|
||||||
default: return 0;
|
default: return 0;
|
||||||
}
|
}
|
||||||
|
@ -4477,6 +4490,7 @@ int DLevelScript::CheckActorProperty (int tid, int property, int value)
|
||||||
case APROP_Species: string = actor->GetSpecies().GetChars(); break;
|
case APROP_Species: string = actor->GetSpecies().GetChars(); break;
|
||||||
case APROP_NameTag: string = actor->GetTag(); break;
|
case APROP_NameTag: string = actor->GetTag(); break;
|
||||||
case APROP_DamageType: string = actor->DamageType.GetChars(); break;
|
case APROP_DamageType: string = actor->DamageType.GetChars(); break;
|
||||||
|
case APROP_SoundClass: string = actor->player->SoundClass; break;
|
||||||
}
|
}
|
||||||
if (string == NULL) string = "";
|
if (string == NULL) string = "";
|
||||||
return (!stricmp(string, Level->Behaviors.LookupString(value)));
|
return (!stricmp(string, Level->Behaviors.LookupString(value)));
|
||||||
|
|
|
@ -347,6 +347,7 @@ void player_t::CopyFrom(player_t &p, bool copyPSP)
|
||||||
ConversationFaceTalker = p.ConversationFaceTalker;
|
ConversationFaceTalker = p.ConversationFaceTalker;
|
||||||
MUSINFOactor = p.MUSINFOactor;
|
MUSINFOactor = p.MUSINFOactor;
|
||||||
MUSINFOtics = p.MUSINFOtics;
|
MUSINFOtics = p.MUSINFOtics;
|
||||||
|
SoundClass = p.SoundClass;
|
||||||
if (copyPSP)
|
if (copyPSP)
|
||||||
{
|
{
|
||||||
// This needs to transfer ownership completely.
|
// This needs to transfer ownership completely.
|
||||||
|
@ -1696,7 +1697,8 @@ void player_t::Serialize(FSerializer &arc)
|
||||||
("settings_controller", settings_controller)
|
("settings_controller", settings_controller)
|
||||||
("onground", onground)
|
("onground", onground)
|
||||||
("musinfoactor", MUSINFOactor)
|
("musinfoactor", MUSINFOactor)
|
||||||
("musinfotics", MUSINFOtics);
|
("musinfotics", MUSINFOtics)
|
||||||
|
("SoundClass", SoundClass);
|
||||||
|
|
||||||
if (arc.isWriting ())
|
if (arc.isWriting ())
|
||||||
{
|
{
|
||||||
|
@ -1812,6 +1814,7 @@ DEFINE_FIELD_X(PlayerInfo, player_t, original_cmd)
|
||||||
DEFINE_FIELD_X(PlayerInfo, player_t, userinfo)
|
DEFINE_FIELD_X(PlayerInfo, player_t, userinfo)
|
||||||
DEFINE_FIELD_X(PlayerInfo, player_t, weapons)
|
DEFINE_FIELD_X(PlayerInfo, player_t, weapons)
|
||||||
DEFINE_FIELD_NAMED_X(PlayerInfo, player_t, cmd.ucmd.buttons, buttons)
|
DEFINE_FIELD_NAMED_X(PlayerInfo, player_t, cmd.ucmd.buttons, buttons)
|
||||||
|
DEFINE_FIELD_X(PlayerInfo, player_t, SoundClass)
|
||||||
|
|
||||||
DEFINE_FIELD_X(UserCmd, usercmd_t, buttons)
|
DEFINE_FIELD_X(UserCmd, usercmd_t, buttons)
|
||||||
DEFINE_FIELD_X(UserCmd, usercmd_t, pitch)
|
DEFINE_FIELD_X(UserCmd, usercmd_t, pitch)
|
||||||
|
|
|
@ -1620,6 +1620,7 @@ static const char *GetSoundClass(AActor *pp)
|
||||||
}
|
}
|
||||||
auto sclass = player? pp->NameVar(NAME_SoundClass) : NAME_None;
|
auto sclass = player? pp->NameVar(NAME_SoundClass) : NAME_None;
|
||||||
|
|
||||||
|
sclass != NAME_None ? pp->player->SoundClass = sclass.GetChars() : (FString)"player";
|
||||||
return sclass != NAME_None ? sclass.GetChars() : "player";
|
return sclass != NAME_None ? sclass.GetChars() : "player";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1637,7 +1638,7 @@ int S_FindSkinnedSound (AActor *actor, FSoundID refid)
|
||||||
|
|
||||||
if (actor != nullptr)
|
if (actor != nullptr)
|
||||||
{
|
{
|
||||||
pclass = GetSoundClass (actor);
|
pclass = actor->player->SoundClass;
|
||||||
if (actor->player != nullptr) gender = actor->player->userinfo.GetGender();
|
if (actor->player != nullptr) gender = actor->player->userinfo.GetGender();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1696,6 +1697,7 @@ void S_MarkPlayerSounds (AActor *player)
|
||||||
PlayerSounds[listidx].MarkUsed();
|
PlayerSounds[listidx].MarkUsed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
Loading…
Reference in a new issue