Skip to content

Commit 986f036

Browse files
revolucasXottab-DUTY
authored andcommitted
~ Changed in-game text color for Neutral to yellow
+ Added game_object:set_character_icon(texture_name)
1 parent 6aa30b9 commit 986f036

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

src/xrGame/InventoryOwner.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ class CInventoryOwner : public CAttachmentOwner
171171
virtual void SetReputation(CHARACTER_REPUTATION_VALUE);
172172
virtual void ChangeReputation(CHARACTER_REPUTATION_VALUE);
173173

174+
virtual void SetIcon(const shared_str& iconName)
175+
{
176+
CharacterInfo().m_SpecificCharacter.data()->m_icon_name = iconName;
177+
}
178+
174179
//для работы с relation system
175180
u16 object_id() const;
176181
CHARACTER_COMMUNITY_INDEX Community() const { return CharacterInfo().Community().index(); };

src/xrGame/script_game_object.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,9 @@ class CScriptGameObject
916916
void SetActorRunCoef(float run_coef);
917917

918918
float GetActorRunBackCoef() const;
919-
void SetActorRunBackCoef(float run_back_coef);
919+
void SetActorRunBackCoef(float run_back_coef);
920+
921+
void SetCharacterIcon(pcstr iconName);
920922
//-Alundaio
921923
#endif // GAME_OBJECT_EXTENDED_EXPORTS
922924
doors::door* m_door;

src/xrGame/script_game_object_inventory_owner.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,5 +2069,17 @@ void CScriptGameObject::SetActorRunBackCoef(float run_back_coef)
20692069
}
20702070
pActor->m_fRunBackFactor = run_back_coef;
20712071
}
2072+
2073+
void CScriptGameObject::SetCharacterIcon(pcstr iconName)
2074+
{
2075+
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());
2076+
2077+
if (!pInventoryOwner)
2078+
{
2079+
ai().script_engine().script_log(LuaMessageType::Error, "SetCharacterIcon available only for InventoryOwner");
2080+
return;
2081+
}
2082+
return pInventoryOwner->SetIcon(iconName);
2083+
}
20722084
#endif
20732085
//-Alundaio

src/xrGame/script_game_object_script3.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@ class_<CScriptGameObject>& script_register_game_object2(class_<CScriptGameObject
387387
.def("get_max_uses", &CScriptGameObject::GetMaxUses)
388388
// Phantom
389389
.def("phantom_set_enemy", &CScriptGameObject::PhantomSetEnemy)
390+
// Actor
391+
.def("set_character_icon", &CScriptGameObject::SetCharacterIcon)
390392
#endif
391393
//-Alundaio
392394

src/xrGame/ui/UIInventoryUtilities.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ u32 InventoryUtilities::GetGoodwillColor(CHARACTER_GOODWILL gw)
533533
u32 res = 0xffc0c0c0;
534534
if (gw == NEUTRAL_GOODWILL)
535535
{
536-
res = 0xffc0c0c0;
536+
res = 0xfffce80b; //0xffc0c0c0;
537537
}
538538
else if (gw > 1000)
539539
{
@@ -569,7 +569,7 @@ u32 InventoryUtilities::GetRelationColor(ALife::ERelationType relation)
569569
switch (relation)
570570
{
571571
case ALife::eRelationTypeFriend: return 0xff00ff00; break;
572-
case ALife::eRelationTypeNeutral: return 0xffc0c0c0; break;
572+
case ALife::eRelationTypeNeutral: return 0xfffce80b/*0xffc0c0c0*/; break;
573573
case ALife::eRelationTypeEnemy: return 0xffff0000; break;
574574
default: NODEFAULT;
575575
}

0 commit comments

Comments
 (0)