-
Notifications
You must be signed in to change notification settings - Fork 154
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
Goal_action #2198
base: master
Are you sure you want to change the base?
Goal_action #2198
Changes from 11 commits
d0923de
213cded
beb4256
c9ac877
26f54ca
adba6d4
7ff91a9
db49f5d
729f98d
4af7e7e
3cd45a6
eff5097
27ba746
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
|
||
using Content.Shared.ActionBlocker; | ||
using Robust.Shared.Audio.Systems; | ||
using Content.Server.Chat.Systems; | ||
using Content.Shared.SS220.Shout; | ||
using Content.Shared.Dataset; | ||
using Robust.Shared.Random; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.SS220.Shout; | ||
|
||
public sealed class ShoutSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedAudioSystem _audio = default!; | ||
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; | ||
[Dependency] private readonly ChatSystem _chat = default!; | ||
[Dependency] private readonly IPrototypeManager _proto = default!; | ||
[Dependency] private readonly IRobustRandom _random = default!; | ||
|
||
/// <summary> | ||
/// Just handler of a ShoutActionEvent. | ||
/// If there is no sound or phrase it won't do anything. | ||
/// </summary> | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<ShoutActionEvent>(OnShoutAction); | ||
} | ||
|
||
private void OnShoutAction(ShoutActionEvent args) | ||
{ | ||
if (args.Handled) | ||
return; | ||
|
||
args.Handled = true; | ||
|
||
if (!_actionBlocker.CanEmote(args.Performer)) | ||
return; | ||
|
||
if (args.ShoutSound != null) | ||
{ | ||
_audio.PlayEntity(args.ShoutSound, args.Performer, args.Performer); | ||
} | ||
|
||
if (args.ShoutPhrases != null) | ||
{ | ||
if (!_proto.TryIndex<DatasetPrototype>(args.ShoutPhrases, out var placeholder))//i dont like nested ifs, but idk how to make it more pretty | ||
return; | ||
|
||
var emoteType = _random.Pick(placeholder.Values); | ||
_chat.TrySendInGameICMessage(args.Performer, emoteType, InGameICChatType.Emote, ChatTransmitRange.Normal, checkRadioPrefix: false, ignoreActionBlocker: true); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
|
||
using Content.Shared.Actions; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Audio; | ||
using Content.Shared.Dataset; | ||
|
||
namespace Content.Shared.SS220.Shout; | ||
/// <summary> | ||
/// Event for memes, or is u want to make some kind of alternative scream button | ||
/// </summary> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Гендер для звука разве что, а для сообщения в чат гендер может переключаться локализацией (просто комментарий, действий не требуется) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ну, вот я для звука, но может как-то потом |
||
/// ToDo maybe add some gender checks if it will be used be anybody except me? | ||
public sealed partial class ShoutActionEvent : InstantActionEvent | ||
{ | ||
/// <summary> | ||
/// Sound played when action button is pressed | ||
/// </summary> | ||
[DataField, ViewVariables(VVAccess.ReadWrite)] | ||
public SoundSpecifier? ShoutSound; | ||
|
||
/// <summary> | ||
/// Shouted phrase when action button is pressed | ||
/// </summary> | ||
[DataField] | ||
public ProtoId<DatasetPrototype>? ShoutPhrases; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- files: | ||
- gooool.ogg | ||
license: "CC0-1.0" | ||
copyright: "Modified by SkaldetSkaeg (Github), shortened, cleaned from background sounds, converted to OGG." | ||
source: "https://www.myinstants.com/ru/instant/goool-7073/" | ||
Comment on lines
+1
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Источник интересный, а у нас есть право лицензировать это как CC0, я уж не говорю о том что использовать? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Я, просто, не уверен, что можно писать “No Known Copyright”. Насчёт использования, то тут на уровне нашего ТТС. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Предлагаешь свой где-то записать? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Есть 2 существенных отличия от ТТС:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. А с этим звуком, точнее как ты здесь его определил, есть 2 проблемы:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Короче, снова немного в дебри погрузился. По сути это user generated content, так как постобработка и контекст. Но что по лицензии хз. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. В общем я ещё уточню по этому моменту, но лучше искать звук на который у нас будет лицензия. Можно, я не знаю, попросить Шусса на стриме крикнуть "ГОООЛ" чтоб мы это использовали здесь. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
я бы ещё по картинке спросил. Мне её просто пережатую скинули. Лучше попросить наших перерисовать, когда со звуком разберемся? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. На самом деле да There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. с картинкой решено |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ent-ActionGoal = Гол | ||
.desc = ГОООООООООООООООООООЛ! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- type: dataset | ||
id: goalPhrases | ||
values: | ||
- восклицает | ||
- голосует | ||
- бравирует | ||
- возглашает | ||
- выкрикивает | ||
- вскрикивает | ||
Comment on lines
+1
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. А локализацию можно? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Не совсем понял There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. сами фразы должны быть в локализации, здесь должны быть только ключи |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"version": 1, | ||
"license": "EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt", | ||
"copyright": "Sprited by Gabbka for SS220", | ||
SkaldetSkaeg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"size": { | ||
"x": 32, | ||
"y": 32 | ||
}, | ||
"states": [ | ||
{ | ||
"name": "goal" | ||
} | ||
] | ||
} |
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.
Я так думаю это должно быть документацией к классу, так что должно быть прямо перед ним