Skip to content

Commit

Permalink
~ Changed in-game text color for Neutral to yellow
Browse files Browse the repository at this point in the history
+ Added game_object:set_character_icon(texture_name)
  • Loading branch information
revolucas authored and Xottab-DUTY committed Dec 23, 2017
1 parent 6aa30b9 commit 986f036
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/xrGame/InventoryOwner.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ class CInventoryOwner : public CAttachmentOwner
virtual void SetReputation(CHARACTER_REPUTATION_VALUE);
virtual void ChangeReputation(CHARACTER_REPUTATION_VALUE);

virtual void SetIcon(const shared_str& iconName)
{
CharacterInfo().m_SpecificCharacter.data()->m_icon_name = iconName;
}

//для работы с relation system
u16 object_id() const;
CHARACTER_COMMUNITY_INDEX Community() const { return CharacterInfo().Community().index(); };
Expand Down
4 changes: 3 additions & 1 deletion src/xrGame/script_game_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,9 @@ class CScriptGameObject
void SetActorRunCoef(float run_coef);

float GetActorRunBackCoef() const;
void SetActorRunBackCoef(float run_back_coef);
void SetActorRunBackCoef(float run_back_coef);

void SetCharacterIcon(pcstr iconName);
//-Alundaio
#endif // GAME_OBJECT_EXTENDED_EXPORTS
doors::door* m_door;
Expand Down
12 changes: 12 additions & 0 deletions src/xrGame/script_game_object_inventory_owner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2069,5 +2069,17 @@ void CScriptGameObject::SetActorRunBackCoef(float run_back_coef)
}
pActor->m_fRunBackFactor = run_back_coef;
}

void CScriptGameObject::SetCharacterIcon(pcstr iconName)
{
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());

if (!pInventoryOwner)
{
ai().script_engine().script_log(LuaMessageType::Error, "SetCharacterIcon available only for InventoryOwner");
return;
}
return pInventoryOwner->SetIcon(iconName);
}
#endif
//-Alundaio
2 changes: 2 additions & 0 deletions src/xrGame/script_game_object_script3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ class_<CScriptGameObject>& script_register_game_object2(class_<CScriptGameObject
.def("get_max_uses", &CScriptGameObject::GetMaxUses)
// Phantom
.def("phantom_set_enemy", &CScriptGameObject::PhantomSetEnemy)
// Actor
.def("set_character_icon", &CScriptGameObject::SetCharacterIcon)
#endif
//-Alundaio

Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/ui/UIInventoryUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ u32 InventoryUtilities::GetGoodwillColor(CHARACTER_GOODWILL gw)
u32 res = 0xffc0c0c0;
if (gw == NEUTRAL_GOODWILL)
{
res = 0xffc0c0c0;
res = 0xfffce80b; //0xffc0c0c0;
}
else if (gw > 1000)
{
Expand Down Expand Up @@ -569,7 +569,7 @@ u32 InventoryUtilities::GetRelationColor(ALife::ERelationType relation)
switch (relation)
{
case ALife::eRelationTypeFriend: return 0xff00ff00; break;
case ALife::eRelationTypeNeutral: return 0xffc0c0c0; break;
case ALife::eRelationTypeNeutral: return 0xfffce80b/*0xffc0c0c0*/; break;
case ALife::eRelationTypeEnemy: return 0xffff0000; break;
default: NODEFAULT;
}
Expand Down

0 comments on commit 986f036

Please sign in to comment.