Skip to content

Commit e73a66f

Browse files
committed
- setting ship voice, personality and cadence now only available via UI. No longer available via a voice command.
- Added "disembark" command to when you are in the ship. - Added "show/open/display station services" when you are in your ship at the station/port/carrier. - Wrapped the subscribers that do IO in to virtual threads. (slight performance improvement).
1 parent 16a56d4 commit e73a66f

File tree

61 files changed

+1394
-1435
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1394
-1435
lines changed

app/src/main/java/elite/intel/ai/brain/AiActionsMap.java

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ public Map<String, String> actionMap() {
4545
map.put("wake up", WAKEUP.getAction());
4646
map.put("sleep, go to sleep, ignore me, do not monitor", SLEEP.getAction());
4747
map.put("interrupt", INTERRUPT_TTS.getAction());
48-
map.put("switch to combat mode", ACTIVATE_COMBAT_MODE.getAction());
49-
map.put("switch to analysis mode", ACTIVATE_ANALYSIS_MODE.getAction());
50-
48+
if (status.isInMainShip() || status.isInSrv()) {
49+
map.put("switch to combat mode", ACTIVATE_COMBAT_MODE.getAction());
50+
map.put("switch to analysis mode", ACTIVATE_ANALYSIS_MODE.getAction());
51+
}
5152
// navigation
5253
map.put("navigate to coordinates {lat:X, lon:Y}", NAVIGATE_TO_TARGET.getAction());
5354
map.put("navigate to active mission, plot route to active mission, plot route to mission, take me to mission, go to mission {key:X}", NAVIGATE_TO_NEXT_MISSION.getAction());
@@ -56,34 +57,44 @@ public Map<String, String> actionMap() {
5657
map.put("navigate to next trade stop, go to next trade stop", NAVIGATE_TO_NEXT_TRADE_STOP.getAction());
5758
map.put("navigate from memory, paste from memory", NAVIGATE_TO_ADDRESS_FROM_MEMORY.getAction());
5859
map.put("cancel navigation, abort navigation, stop navigation", NAVIGATION_OFF.getAction());
59-
map.put("target destination", TARGET_DESTINATION.getAction());
60-
map.put("jump to hyperspace, jump, hyperspace jump, enter hyperspace, lets go, next way point", JUMP_TO_HYPERSPACE.getAction());
61-
map.put("drop out, drop here, drop ftl, drop from supercruise, leave supercruise, drop in", DROP_FROM_SUPER_CRUISE.getAction());
62-
map.put("enter supercruise, supercruise, go supercruise, supercruise", ENTER_SUPER_CRUISE.getAction());
60+
61+
if (status.isInMainShip()) {
62+
map.put("target destination", TARGET_DESTINATION.getAction());
63+
map.put("jump to hyperspace, jump, hyperspace jump, enter hyperspace, lets go, next way point", JUMP_TO_HYPERSPACE.getAction());
64+
map.put("drop out, drop here, drop ftl, drop from supercruise, leave supercruise, drop in", DROP_FROM_SUPER_CRUISE.getAction());
65+
map.put("enter supercruise, supercruise, go supercruise, supercruise", ENTER_SUPER_CRUISE.getAction());
66+
}
6367
map.put("set home system", SET_HOME_SYSTEM.getAction());
6468

6569
// speed / throttle
66-
map.put("stop engines, stop here, full stop, all stop, halt, kill engines, cut throttle, zero throttle, stop ship", SET_SPEED_ZERO.getAction());
67-
map.put("taxi to landing, taxi, auto land, autopilot landing", TAXI.getAction());
68-
map.put("quarter throttle, 25 percent, slow speed, one quarter", SET_SPEED25.getAction());
69-
map.put("half throttle, 50 percent, half speed", SET_SPEED50.getAction());
70-
map.put("three quarters throttle, 75 percent, three quarter speed", SET_SPEED75.getAction());
71-
map.put("full throttle, 100 percent, full speed, maximum speed, max throttle", SET_SPEED100.getAction());
72-
map.put("increase speed by {key:X}", INCREASE_SPEED_BY.getAction());
73-
map.put("decrease speed by {key:X}", DECREASE_SPEED_BY.getAction());
74-
map.put("set optimal speed, optimal approach speed, optimize approach speed", SET_OPTIMAL_SPEED.getAction());
70+
if (status.isInMainShip()) {
71+
map.put("stop engines, stop here, full stop, all stop, halt, kill engines, cut throttle, zero throttle, stop ship", SET_SPEED_ZERO.getAction());
72+
map.put("taxi to landing, taxi, auto land, autopilot landing", TAXI.getAction());
73+
map.put("quarter throttle, 25 percent, slow speed, one quarter", SET_SPEED25.getAction());
74+
map.put("half throttle, 50 percent, half speed", SET_SPEED50.getAction());
75+
map.put("three quarters throttle, 75 percent, three quarter speed", SET_SPEED75.getAction());
76+
map.put("full throttle, 100 percent, full speed, maximum speed, max throttle", SET_SPEED100.getAction());
77+
map.put("increase speed by {key:X}", INCREASE_SPEED_BY.getAction());
78+
map.put("decrease speed by {key:X}", DECREASE_SPEED_BY.getAction());
79+
map.put("set optimal speed, optimal approach speed, optimize approach speed", SET_OPTIMAL_SPEED.getAction());
80+
map.put("landing gear, gear down, lower landing gear, extend landing gear", DEPLOY_LANDING_GEAR.getAction());
81+
map.put("retract landing gear, gear up, raise landing gear, stow landing gear", RETRACT_LANDING_GEAR.getAction());
82+
map.put("request docking, dock at station, request landing, docking request, ask for docking, request parking, parking spot, request pad", REQUEST_DOCKING.getAction());
83+
}
7584

7685
// flight / ship systems
77-
map.put("landing gear, gear down, lower landing gear, extend landing gear", DEPLOY_LANDING_GEAR.getAction());
78-
map.put("retract landing gear, gear up, raise landing gear, stow landing gear", RETRACT_LANDING_GEAR.getAction());
79-
map.put("request docking, dock at station, request landing, docking request, ask for docking, request parking, parking spot, request pad", REQUEST_DOCKING.getAction());
80-
map.put("open / close cargo scoop, deploy / retract cargo scoop, open / close cargo bay", TOGGLE_CARGO_SCOOP.getAction());
81-
map.put("night vision, nightvision, turn on night vision, turn off night vision ", NIGHT_VISION_ON_OFF.getAction());
82-
map.put("headlights, lights, turn off lights, turn on lights, ship lights, lights on, lights off ", LIGHTS_ON_OFF.getAction());
83-
map.put("drive assist, driving assist, SRV assist {state:true/false}", DRIVE_ASSIST.getAction());
84-
map.put("dismiss ship, send ship away, ship to orbit", DISMISS_SHIP.getAction());
85-
map.put("return to surface, pick me up", RETURN_TO_SURFACE.getAction());
86-
86+
if (status.isInMainShip() || status.isInSrv()) {
87+
map.put("open / close cargo scoop, deploy / retract cargo scoop, open / close cargo bay", TOGGLE_CARGO_SCOOP.getAction());
88+
map.put("night vision, nightvision, turn on night vision, turn off night vision ", NIGHT_VISION_ON_OFF.getAction());
89+
map.put("headlights, lights, turn off lights, turn on lights, ship lights, lights on, lights off ", LIGHTS_ON_OFF.getAction());
90+
}
91+
if (status.isInSrv()) {
92+
map.put("drive assist, driving assist, SRV assist {state:true/false}", DRIVE_ASSIST.getAction());
93+
}
94+
if (status.isInMainShip() || status.isOnFoot()) {
95+
map.put("dismiss ship, send ship away, ship to orbit", DISMISS_SHIP.getAction());
96+
map.put("return to surface, pick me up", RETURN_TO_SURFACE.getAction());
97+
}
8798
// market / traders / brokers
8899
map.put("find raw material trader, raw trader, where to trade raw materials {key:X}", FIND_RAW_MATERIAL_TRADER.getAction());
89100
map.put("find encoded material trader, encoded trader, data trader {key:X}", FIND_ENCODED_MATERIAL_TRADER.getAction());
@@ -102,6 +113,7 @@ public Map<String, String> actionMap() {
102113
map.put("calculate trade route", CALCULATE_TRADE_ROUTE.getAction());
103114
map.put("list trade route parameters", LIST_TRADE_ROUTE_PARAMETERS.getAction());
104115
map.put("monetize route", MONETIZE_ROUTE.getAction());
116+
105117
map.put("change trade profile starting budget {key:X}", CHANGE_TRADE_PROFILE_SET_STARTING_BUDGET.getAction());
106118
map.put("change trade profile max stops {key:X}", CHANGE_TRADE_PROFILE_SET_MAX_NUMBER_OF_STOPS.getAction());
107119
map.put("change trade profile max distance {key:X}", CHANGE_TRADE_PROFILE_SET_MAX_DISTANCE_FROM_ENTRY.getAction());
@@ -116,16 +128,9 @@ public Map<String, String> actionMap() {
116128
map.put("discovery announcements {state:true/false}", DISCOVERY_ON_OFF.getAction());
117129
map.put("route announcements {state:true/false}", ROUTE_ON_OFF.getAction());
118130
map.put("disable all announcements", DISABLE_ALL_ANNOUNCEMENTS.getAction());
119-
map.put("set voice {key:X}", SET_AI_VOICE.getAction());
120-
map.put("list available voices", LIST_AVAILABLE_VOICES.getAction());
121131
map.put("clear reminders", CLEAR_REMINDERS.getAction());
122132
map.put("set reminder {key:X}", SET_REMINDER.getAction());
123133

124-
if (!systemSession.useLocalQueryLlm()) {
125-
map.put("set personality {key:X}", SET_PERSONALITY.getAction());
126-
map.put("set cadence {key:X}", SET_CADENCE.getAction());
127-
}
128-
129134
// UI panels
130135
map.put("activate", ACTIVATE.getAction());
131136
map.put("show, open or display transactions panel", SHOW_TRANSACTIONS.getAction());
@@ -148,6 +153,9 @@ public Map<String, String> actionMap() {
148153
map.put("show, open or display carrier management panel", DISPLAY_CARRIER_MANAGEMENT.getAction());
149154
map.put("show, open or display galaxy map", OPEN_GALAXY_MAP.getAction());
150155
map.put("show, open or display local / stat system map", OPEN_SYSTEM_MAP.getAction());
156+
if (status.isInMainShip()) {
157+
map.put("show, open or display station services panel", SHOW_STATION_SERVICES.getAction());
158+
}
151159
map.put("exit close panel", EXIT_CLOSE.getAction());
152160
map.put("power to shields, max shields, boost shields", INCREASE_SHIELDS_POWER.getAction());
153161
map.put("power to engines, max engines, boost engines", INCREASE_ENGINES_POWER.getAction());

app/src/main/java/elite/intel/ai/brain/handlers/commands/ChangeShipVoiceHandler.java

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
11
package elite.intel.ai.brain.handlers.commands;
22

33
import com.google.gson.JsonObject;
4-
import elite.intel.ai.hands.events.GameInputEvent;
5-
import elite.intel.gameapi.GameControllerBus;
6-
import elite.intel.session.Status;
7-
import elite.intel.session.ui.UINavigator;
84

95
public class ClosePanelHandler implements CommandHandler {
106

11-
12-
private final UINavigator navigator = new UINavigator();
13-
private final Status status = Status.getInstance();
14-
157
@Override
168
public void handle(String action, JsonObject params, String responseText) {
17-
18-
if (status.isSystemMapOpen() || status.isGalaxyMapOpen()) {
19-
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_UI_LEFT.getGameBinding(), 0));
20-
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_UI_RIGHT.getGameBinding(), 0));
21-
}
22-
navigator.closeOpenPanel();
9+
UiExit.close();
2310
}
2411
}

app/src/main/java/elite/intel/ai/brain/handlers/commands/Commands.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ public enum Commands {
4444
FIND_NEAREST_FLEET_CARRIER ("find_nearest_fleet_carrier", null, FindNearestFleetCarrierHandler.class),
4545

4646
FIND_COMMODITY ("find_commodity", null, FindCommodityHandler.class),
47-
SET_AI_VOICE ("set_voice", null, ChangeShipVoiceHandler.class),
4847
SET_HOME_SYSTEM ("set_home_system", null, SetCurrentStarAsHomeSystem.class),
49-
SET_PERSONALITY ("set_personality", null, SetPersonalityHandler.class),
50-
SET_CADENCE ("set_cadence", null, SetCadenceHandler.class),
5148
SET_RADIO_TRANSMISSION_MODE ("toggle_radio", null, SetRadioTransmissionOnOff.class),
5249
SET_RADAR_CONTACT_ANNOUNCEMENT ("toggle_radar_announcements", null, RadarAnnouncementOnOffHandler.class),
5350

@@ -135,6 +132,7 @@ public enum Commands {
135132
SHOW_INVENTORY_PANEL ("show_inventory_panel", null, OpenInventoryHandler.class),
136133
SHOW_STORAGE_PANEL ("show_storage_panel", null, OpenStoragePanelHandler.class),
137134
SHOW_STATUS_PANEL ("show_status_panel", null, OpenStatusPanelHandler.class),
135+
SHOW_STATION_SERVICES ("show_station_services_panel", null, OpenStationServicesHandler.class),
138136
EXIT_CLOSE ("exit_close", null, ClosePanelHandler.class),
139137

140138

@@ -174,7 +172,6 @@ public enum Commands {
174172
TARGET_WINGMAN1 ("target_wingman_2", BINDING_TARGET_WINGMAN1.getGameBinding(), SimpleCommandActionHandler.class),
175173
TARGET_WINGMAN2 ("target_wingman_3", BINDING_TARGET_WINGMAN2.getGameBinding(), SimpleCommandActionHandler.class),
176174
WING_NAV_LOCK ("wing_nav_lock", BINDING_WING_NAV_LOCK.getGameBinding(), SimpleCommandActionHandler.class),
177-
LIST_AVAILABLE_VOICES ("list_available_voices", null, ListAvailableVoicesHandler.class),
178175
CLEAR_REMINDERS ("clear_reminders", null, CleareReminderHandler.class),
179176
SET_REMINDER ("set_reminder", null, SetReminderHandler.class),
180177
DELETE_CODEX_ENTRY ("delete_codex_entry", null, DeleteCodexEntryHandler.class),

app/src/main/java/elite/intel/ai/brain/handlers/commands/DisembarkHandler.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public class DisembarkHandler implements CommandHandler {
1515

1616
@Override
1717
public void handle(String action, JsonObject params, String responseText) {
18-
19-
if (status.isInMainShip() || status.isInSrv()) {
18+
UiExit.close();
19+
if (status.isInSrv()) {
2020
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_FOCUS_ROLE_PANEL.getGameBinding(), 0));
2121

2222
/// ensure the cursor is at the top
@@ -30,6 +30,11 @@ public void handle(String action, JsonObject params, String responseText) {
3030
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_UI_RIGHT.getGameBinding(), 0));
3131
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_ACTIVATE.getGameBinding(), 0));
3232
navigator.assumeDefaultState(StatusFlags.GuiFocus.ROLE_PANEL);
33+
} else if (status.isInMainShip()) {
34+
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_UI_DOWN.getGameBinding(), 0));
35+
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_UI_DOWN.getGameBinding(), 0));
36+
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_UI_DOWN.getGameBinding(), 0));
37+
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_ACTIVATE.getGameBinding(), 0));
3338
}
3439
}
3540
}

app/src/main/java/elite/intel/ai/brain/handlers/commands/ListAvailableVoicesHandler.java

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package elite.intel.ai.brain.handlers.commands;
2+
3+
import com.google.gson.JsonObject;
4+
import elite.intel.ai.hands.events.GameInputEvent;
5+
import elite.intel.gameapi.GameControllerBus;
6+
7+
public class OpenStationServicesHandler implements CommandHandler {
8+
9+
@Override
10+
public void handle(String action, JsonObject params, String responseText) {
11+
UiExit.close();
12+
13+
prepToKnownUiPosition();
14+
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_UI_UP.getGameBinding(), 0));
15+
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_UI_UP.getGameBinding(), 0));
16+
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_ACTIVATE.getGameBinding(), 0));
17+
}
18+
19+
20+
private void prepToKnownUiPosition() {
21+
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_UI_DOWN.getGameBinding(), 0));
22+
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_UI_DOWN.getGameBinding(), 0));
23+
GameControllerBus.publish(new GameInputEvent(Bindings.GameCommand.BINDING_UI_DOWN.getGameBinding(), 0));
24+
}
25+
}

0 commit comments

Comments
 (0)