Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/***********************************************************************************
* Copyright (c) 2024 /// Project SWG /// www.projectswg.com *
* Copyright (c) 2025 /// Project SWG /// www.projectswg.com *
* *
* ProjectSWG is the first NGE emulator for Star Wars Galaxies founded on *
* ProjectSWG is an emulation project for Star Wars Galaxies founded on *
* July 7th, 2011 after SOE announced the official shutdown of Star Wars Galaxies. *
* Our goal is to create an emulator which will provide a server for players to *
* continue playing a game similar to the one they used to play. We are basing *
* it on the final publish of the game prior to end-game events. *
* Our goal is to create one or more emulators which will provide servers for *
* players to continue playing a game similar to the one they used to play. *
* *
* This file is part of Holocore. *
* *
Expand Down Expand Up @@ -40,6 +39,7 @@
import com.projectswg.holocore.resources.support.objects.radial.pet.VehicleMountRadial;
import com.projectswg.holocore.resources.support.objects.radial.terminal.*;
import com.projectswg.holocore.resources.support.objects.swg.SWGObject;
import com.projectswg.holocore.resources.support.objects.swg.creature.CreatureObject;
import com.projectswg.holocore.resources.support.objects.swg.custom.AIObject;
import com.projectswg.holocore.resources.support.objects.swg.tangible.CreditObject;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -71,6 +71,7 @@ public enum RadialHandler {

classHandlers.put(AIObject.class, aiHandler);
classHandlers.put(CreditObject.class, new CreditObjectRadial());
classHandlers.put(CreatureObject.class, new CreatureObjectRadial());
}

private void initializeMeleeWeaponRadials() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/***********************************************************************************
* Copyright (c) 2025 /// Project SWG /// www.projectswg.com *
* *
* ProjectSWG is an emulation project for Star Wars Galaxies founded on *
* July 7th, 2011 after SOE announced the official shutdown of Star Wars Galaxies. *
* Our goal is to create one or more emulators which will provide servers for *
* players to continue playing a game similar to the one they used to play. *
* *
* This file is part of Holocore. *
* *
* --------------------------------------------------------------------------------*
* *
* Holocore is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* Holocore is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with Holocore. If not, see <http://www.gnu.org/licenses/>. *
***********************************************************************************/
package com.projectswg.holocore.resources.support.objects.radial.`object`

import com.projectswg.common.data.radial.RadialItem
import com.projectswg.common.data.radial.RadialOption
import com.projectswg.holocore.intents.gameplay.entertainment.WatchIntent
import com.projectswg.holocore.resources.support.global.player.Player
import com.projectswg.holocore.resources.support.objects.radial.RadialHandlerInterface
import com.projectswg.holocore.resources.support.objects.swg.SWGObject
import com.projectswg.holocore.resources.support.objects.swg.creature.CreatureObject

class CreatureObjectRadial : RadialHandlerInterface {
override fun getOptions(options: MutableCollection<RadialOption>, player: Player, target: SWGObject) {
if (target !is CreatureObject) return

watch(options, player, target)
}

override fun handleSelection(player: Player, target: SWGObject, selection: RadialItem) {
when (selection) {
RadialItem.SERVER_PERFORMANCE_WATCH -> WatchIntent(player, target, true).broadcast()
RadialItem.SERVER_PERFORMANCE_WATCH_STOP -> WatchIntent(player, target, false).broadcast()
else -> {}
}
}

private fun watch(options: MutableCollection<RadialOption>, player: Player, target: CreatureObject) {
if (!target.isPlayer) return
if (!target.isPerforming) return
val dancing = target.performanceId == 0
if (!dancing) return

val currentlyWatching = player.creatureObject.performanceListenTarget == target.objectId

if (currentlyWatching) {
options.add(RadialOption.create(RadialItem.SERVER_PERFORMANCE_WATCH_STOP, "@radial_performance:watch_stop"))
} else {
options.add(RadialOption.create(RadialItem.SERVER_PERFORMANCE_WATCH, "@radial_performance:watch"))
}
}
}
Loading