-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traits for roundstart species size #4
base: master
Are you sure you want to change the base?
Conversation
Прикольно, дварфы но люди? эльфы но дварфы? |
Код под лицензией AGPL v3, соре но соре, его приём будем нарушать лицензию. |
@lzk228 Зря стараешься, это чужой код нарушающий лицензию. |
ну не мне же его мёржить, у меня и прав то нет |
Вроде подправил. Если этот ПР внатуре нарушает правила оффов - перепишу с нуля по другому. |
Переписывай |
AGPL v3 свободная лицензия, единственное и главное ограничение, весь репозиторий в котором используется код AGPL v3 должен быть лицензирован так же под AGPL v3 и быть полностью открыт |
Да, ты прав. И увы, этот репозиторий под MIT и будет всегда под MIT. |
имхо это очень странно делать это через два булеана в компоненте |
Это сделано, чтобы при инициализации компонента выбиралось, в какую сторону изменять рост куклы. |
вывод - просто поменяйте лицензию на AGPLv3 и добавьте MIT как сайд |
Уже решено сверху, другой лицензии не будет. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Везде должны быть file-scoped namespaces
[RegisterComponent] | ||
public sealed partial class HeightComponent : Component | ||
{ | ||
[DataField("tall")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[DataField("tall")] | |
[DataField] |
[DataField("tall")] | ||
public bool Tall = false; | ||
|
||
[DataField("short")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[DataField("short")] | |
[DataField] |
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} |
physics.SetPositionRadius(uid, id, fixture, circle, circle.Position * scale, circle.Radius * scale, manager); | ||
break; | ||
default: | ||
throw new NotImplementedException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new NotImplementedException(); | |
break; |
|
||
private void InitComponent(EntityUid uid, HeightComponent component, ComponentStartup args) | ||
{ | ||
if (TryComp<HeightTraitBlacklistComponent>(uid, out var comp)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (TryComp<HeightTraitBlacklistComponent>(uid, out var comp)) | |
if (HasComp<HeightTraitBlacklistComponent>(uid)) |
var physics = _entityManager.System<SharedPhysicsSystem>(); | ||
var appearance = _entityManager.System<AppearanceSystem>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему это не может быть [Dependency]
вместо использования .System()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Разве это критично важно? Часть кода изменения размера была взята из репы движка, где команда /scale
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну ты каждый раз про вызове метода Scale получаешь систему вместо того, чтобы один раз инжектнуть Dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну ты каждый раз про вызове метода Scale получаешь систему вместо того, чтобы один раз инжектнуть Dependency
В целом, логично. Тогда отправлю комит с новым кодом на основе всех названных ошибок. Я прост не очень силён в кодинге на шарпе, особенно в связке с таким большим проектом.
_entityManager.EnsureComponent<ScaleVisualsComponent>(uid); | ||
|
||
var appearanceComponent = _entityManager.EnsureComponent<AppearanceComponent>(uid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EnsureComp
?
|
||
appearance.SetData(uid, ScaleVisuals.Scale, oldScale * scale, appearanceComponent); | ||
|
||
if (_entityManager.TryGetComponent(uid, out FixturesComponent? manager)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
инвертируй if-блок + TryComp
} | ||
private void Scale(EntityUid uid, float scale) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
private void Scale(EntityUid uid, float scale) | |
} | |
private void Scale(EntityUid uid, float scale) |
[DataField("short")] | ||
public bool Short = false; | ||
|
||
public readonly float TallScale = 1.10f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделай это череp [DataField]
namespace Content.Server.Traits.Assorted | ||
{ | ||
[RegisterComponent] | ||
public sealed partial class HeightComponent : Component |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Переменная isShort
и isTall
идея плохая, лучше сделай прототипы роста, или хотя бы enum значение
using System.Numerics; | ||
|
||
namespace Content.Server.Traits.Assorted | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Этот блок лишний
if (TryComp<HeightTraitBlacklistComponent>(uid, out var comp)) | ||
return; | ||
|
||
if (component.Short) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Как говорил выше, реализация отвратительная
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<HeightComponent, ComponentStartup>(InitComponent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Убирать изменение роста при удалении компонента
{ | ||
[RegisterComponent] | ||
public sealed partial class HeightTraitBlacklistComponent : Component | ||
{ } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Этот блок лишний просто ставь ;
@@ -0,0 +1,4 @@ | |||
- type: traitCategory | |||
id: HeightTraits | |||
name: Рост |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
используй loc
файлы
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
используй loc
файлы
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Убери не нужные изменения
Лицензию сменили кстати. |
ебать вы с Торнадо человека обработали 😨 |
Описание PR
Добавляет две новые черты внешности в виде высокого/низкого роста.
Вся смелая часть кода была взята с репы фронтира и слегка отредактировано под нас. Изменён класс Server/Cloning/CloneSystem, чтобы черты оставались после клонирования.Переделано с нуля. Убрана гибкость в виде настройки роста под каждую расу.
Медиа