Skip to content

Commit

Permalink
removed ui button
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeBryssinck committed Dec 30, 2023
1 parent 15f5e66 commit eadb689
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 65 deletions.
40 changes: 0 additions & 40 deletions Code/client/Services/Generic/OverlayClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

#include <World.h>

#include <Magic/EffectItem.h>
#include <Games/TES.h>

OverlayClient::OverlayClient(TransportService& aTransport, TiltedPhoques::OverlayRenderHandler* apHandler)
: TiltedPhoques::OverlayClient(apHandler)
, m_transport(aTransport)
Expand Down Expand Up @@ -45,8 +42,6 @@ bool OverlayClient::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser, CefR
ProcessConnectMessage(eventArgs);
else if (eventName == "disconnect")
ProcessDisconnectMessage();
else if (eventName == "pingPlayers")
ProcessPingPlayersMessage();
else if (eventName == "sendMessage")
ProcessChatMessage(eventArgs);
else if (eventName == "launchParty")
Expand Down Expand Up @@ -106,41 +101,6 @@ void OverlayClient::ProcessDisconnectMessage()
World::Get().GetRunner().Queue([]() { World::Get().GetTransport().Close(); });
}

void OverlayClient::ProcessPingPlayersMessage()
{
World::Get().GetRunner().Queue([]() {
Mod* pSkyrimTogether = ModManager::Get()->GetByName("SkyrimTogether.esp");
if (!pSkyrimTogether)
return;

MagicItem* pSpell = Cast<MagicItem>(TESForm::GetById((pSkyrimTogether->standardId << 24) | 0x1825));

if (!pSpell)
return;

MagicTarget::AddTargetData data{};
data.pSpell = pSpell;
data.pEffectItem = pSpell->GetEffect((pSkyrimTogether->standardId << 24) | 0x1824);
data.fMagnitude = 1.f;
data.fUnkFloat1 = 1.f;
data.eCastingSource = MagicSystem::CastingSource::CASTING_SOURCE_COUNT;

auto view = World::Get().view<FormIdComponent, PlayerComponent>();
for (const auto entity : view)
{
auto& formIdComponent = view.get<FormIdComponent>(entity);
if (formIdComponent.Id == 0x14)
continue;

auto* pRemotePlayer = Cast<Actor>(TESForm::GetById(formIdComponent.Id));
if (!pRemotePlayer)
continue;

pRemotePlayer->magicTarget.AddTarget(data);
}
});
}

void OverlayClient::ProcessChatMessage(CefRefPtr<CefListValue> aEventArgs)
{
std::string contents = aEventArgs->GetString(1).ToString();
Expand Down
1 change: 0 additions & 1 deletion Code/client/Services/OverlayClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ struct OverlayClient : TiltedPhoques::OverlayClient
private:
void ProcessConnectMessage(CefRefPtr<CefListValue> aEventArgs);
void ProcessDisconnectMessage();
void ProcessPingPlayersMessage();
void ProcessChatMessage(CefRefPtr<CefListValue> aEventArgs);
void ProcessTeleportMessage(CefRefPtr<CefListValue> aEventArgs);
void ProcessToggleDebugUI();
Expand Down
6 changes: 0 additions & 6 deletions Code/skyrim_ui/src/app/components/root/root.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@
>
{{ 'COMPONENT.ROOT.PLAYER_MANAGER' | transloco }}
</button>
<button
data-style-ornament="inverted"
(click)="pingPlayers()"
>
{{ 'COMPONENT.ROOT.PING_PLAYERS' | transloco }}
</button>
</ng-container>
<button
data-style-ornament="inverted"
Expand Down
4 changes: 0 additions & 4 deletions Code/skyrim_ui/src/app/components/root/root.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,4 @@ export class RootComponent implements OnInit {
public reconnect(): void {
this.client.reconnect();
}

public pingPlayers(): void {
this.client.pingPlayers();
}
}
7 changes: 0 additions & 7 deletions Code/skyrim_ui/src/app/services/client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,6 @@ export class ClientService implements OnDestroy {
this._remainingReconnectionAttempt = 0;
}

/**
* Ping players in the immediate area (lighting them up with a visual effect).
*/
public pingPlayers(): void {
skyrimtogether.pingPlayers();
}

/**
* Launch a party.
*/
Expand Down
1 change: 0 additions & 1 deletion Code/skyrim_ui/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
"ROOT": {
"CONNECT": "Connect",
"DISCONNECT": "Disconnect",
"PING_PLAYERS": "Ping players",
"RECONNECT": "Reconnect",
"PLAYER_MANAGER": "Player Manager",
"SETTINGS": "Settings",
Expand Down
5 changes: 0 additions & 5 deletions Code/skyrim_ui/src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,6 @@ interface SkyrimTogether {
*/
disconnect(): void;

/**
* Ping players in the immediate area.
*/
pingPlayers(): void;

/**
* Send message to server.
*/
Expand Down
1 change: 0 additions & 1 deletion Code/tp_process/ProcessHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ void ProcessHandler::OnContextCreated(CefRefPtr<CefBrowser> browser, CefRefPtr<C

m_pCoreObject->SetValue("connect", CefV8Value::CreateFunction("connect", m_pOverlayHandler), V8_PROPERTY_ATTRIBUTE_NONE);
m_pCoreObject->SetValue("disconnect", CefV8Value::CreateFunction("disconnect", m_pOverlayHandler), V8_PROPERTY_ATTRIBUTE_NONE);
m_pCoreObject->SetValue("pingPlayers", CefV8Value::CreateFunction("pingPlayers", m_pOverlayHandler), V8_PROPERTY_ATTRIBUTE_NONE);
m_pCoreObject->SetValue("sendMessage", CefV8Value::CreateFunction("sendMessage", m_pOverlayHandler), V8_PROPERTY_ATTRIBUTE_NONE);
m_pCoreObject->SetValue("deactivate", CefV8Value::CreateFunction("deactivate", m_pOverlayHandler), V8_PROPERTY_ATTRIBUTE_NONE);
m_pCoreObject->SetValue("launchParty", CefV8Value::CreateFunction("launchParty", m_pOverlayHandler), V8_PROPERTY_ATTRIBUTE_NONE);
Expand Down

0 comments on commit eadb689

Please sign in to comment.