Updates all bots to use TGUI, and adds mute button for certain bots

This commit is contained in:
Nyks
2021-04-20 23:55:13 -04:00
committed by VirgoBot
parent ed95d17304
commit 0c105abaeb
12 changed files with 210 additions and 23 deletions
+25
View File
@@ -10,6 +10,7 @@
wait_if_pulled = 1
min_target_dist = 0
var/vocal = 1
var/cleaning = 0
var/wet_floors = 0
var/spray_blood = 0
@@ -26,7 +27,11 @@
return ..()
/mob/living/bot/cleanbot/handleIdle()
<<<<<<< HEAD
if(!wet_floors && !spray_blood && prob(2))
=======
if(!wet_floors && !spray_blood && vocal && prob(2))
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
custom_emote(2, "makes an excited booping sound!")
playsound(src, 'sound/machines/synth_yes.ogg', 50, 0)
@@ -163,20 +168,34 @@
data["on"] = on
data["open"] = open
data["locked"] = locked
<<<<<<< HEAD
data["blood"] = blood
data["patrol"] = will_patrol
=======
data["blood"] = blood
data["patrol"] = will_patrol
data["vocal"] = vocal
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
data["wet_floors"] = wet_floors
data["spray_blood"] = spray_blood
data["version"] = "v2.0"
return data
<<<<<<< HEAD
/mob/living/bot/cleanbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return TRUE
usr.set_machine(src)
add_fingerprint(usr)
=======
mob/living/bot/cleanbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return TRUE
usr.set_machine(src)
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
switch(action)
if("start")
if(on)
@@ -192,6 +211,12 @@
will_patrol = !will_patrol
patrol_path = null
. = TRUE
<<<<<<< HEAD
=======
if("vocal")
vocal = !vocal
. = TRUE
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
if("wet_floors")
wet_floors = !wet_floors
to_chat(usr, "<span class='notice'>You twiddle the screw.</span>")
+2 -1
View File
@@ -12,6 +12,7 @@
patrol_speed = 3
target_speed = 6
vocal = 1
cleaning = 0
blood = 0
var/red_switch = 0
@@ -25,7 +26,7 @@
icon_state = "edCLN[on]"
/mob/living/bot/cleanbot/edCLN/handleIdle()
if(prob(10))
if(vocal && prob(10))
custom_emote(2, "makes a less than thrilled beeping sound.")
playsound(src, 'sound/machines/synth_yes.ogg', 50, 0)
+61
View File
@@ -35,6 +35,7 @@
if(!ui)
ui = new(user, src, "Farmbot", name)
ui.open()
<<<<<<< HEAD
/mob/living/bot/farmbot/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
var/list/data = ..()
@@ -65,6 +66,38 @@
/mob/living/bot/farmbot/attack_hand(mob/user)
=======
/mob/living/bot/farmbot/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
var/list/data = ..()
data["on"] = on
data["tank"] = !!tank
if(tank)
data["tankVolume"] = tank.reagents.total_volume
data["tankMaxVolume"] = tank.reagents.maximum_volume
data["locked"] = locked
data["waters_trays"] = null
data["refills_water"] = null
data["uproots_weeds"] = null
data["replaces_nutriment"] = null
data["collects_produce"] = null
data["removes_dead"] = null
if(!locked)
data["waters_trays"] = waters_trays
data["refills_water"] = refills_water
data["uproots_weeds"] = uproots_weeds
data["replaces_nutriment"] = replaces_nutriment
data["collects_produce"] = collects_produce
data["removes_dead"] = removes_dead
return data
mob/living/bot/farmbot/attack_hand(mob/user)
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
. = ..()
if(.)
return
@@ -83,6 +116,7 @@
/mob/living/bot/farmbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return TRUE
<<<<<<< HEAD
add_fingerprint(usr)
@@ -95,10 +129,28 @@
else
turn_on()
. = TRUE
=======
add_fingerprint(usr)
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
switch(action)
if("power")
if(!access_scanner.allowed(src))
return FALSE
if(on)
turn_off()
else
turn_on()
. = TRUE
if(locked)
return TRUE
<<<<<<< HEAD
=======
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
switch(action)
if("water")
waters_trays = !waters_trays
@@ -112,6 +164,7 @@
if("replacenutri")
replaces_nutriment = !replaces_nutriment
. = TRUE
<<<<<<< HEAD
// VOREStation Edit: No automatic hydroponics
// if("collect")
// collects_produce = !collects_produce
@@ -121,6 +174,14 @@
// . = TRUE
// VOREStation Edit End
=======
if("collect")
collects_produce = !collects_produce
. = TRUE
if("removedead")
removes_dead = !removes_dead
. = TRUE
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
/mob/living/bot/farmbot/update_icons()
if(on && action)
+30 -1
View File
@@ -12,6 +12,7 @@
wait_if_pulled = 1
min_target_dist = 0
var/vocal = 1
var/amount = 10 // 1 for tile, 2 for lattice
var/maxAmount = 60
var/tilemake = 0 // When it reaches 100, bot makes a tile
@@ -41,7 +42,12 @@
data["on"] = on
data["open"] = open
data["locked"] = locked
<<<<<<< HEAD
=======
data["vocal"] = vocal
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
data["amount"] = amount
data["possible_bmode"] = list("NORTH", "EAST", "SOUTH", "WEST")
@@ -56,7 +62,11 @@
data["eattiles"] = eattiles
data["maketiles"] = maketiles
data["bmode"] = dir2text(targetdirection)
<<<<<<< HEAD
=======
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
return data
/mob/living/bot/floorbot/attack_hand(var/mob/user)
@@ -74,8 +84,13 @@
/mob/living/bot/floorbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return TRUE
<<<<<<< HEAD
add_fingerprint(usr)
=======
add_fingerprint(src)
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
switch(action)
if("start")
@@ -84,11 +99,21 @@
else
turn_on()
. = TRUE
<<<<<<< HEAD
=======
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
if(locked && !issilicon(usr))
return
switch(action)
<<<<<<< HEAD
=======
if("vocal")
vocal = !vocal
. = TRUE
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
if("improve")
improvefloors = !improvefloors
. = TRUE
@@ -101,6 +126,10 @@
if("bridgemode")
targetdirection = text2dir(params["dir"])
. = TRUE
<<<<<<< HEAD
=======
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
/mob/living/bot/floorbot/handleRegular()
++tilemake
@@ -108,7 +137,7 @@
tilemake = 0
addTiles(1)
if(prob(1))
if(vocal && prob(1))
custom_emote(2, "makes an excited beeping sound!")
playsound(src, 'sound/machines/twobeep.ogg', 50, 0)
+10
View File
@@ -12,7 +12,10 @@
#define MEDBOT_MAX_INJECTION 15
#define MEDBOT_MIN_HEAL 0.1
#define MEDBOT_MAX_HEAL 75
<<<<<<< HEAD
=======
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
/mob/living/bot/medbot
name = "Medibot"
desc = "A little medical robot. He looks somewhat underwhelmed."
@@ -271,7 +274,11 @@
usr.set_machine(src)
add_fingerprint(usr)
<<<<<<< HEAD
=======
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
. = TRUE
switch(action)
if("power")
@@ -311,7 +318,10 @@
if("declaretreatment")
declare_treatment = !declare_treatment
. = TRUE
<<<<<<< HEAD
=======
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
/mob/living/bot/medbot/emag_act(var/remaining_uses, var/mob/user)
. = ..()
+13
View File
@@ -70,6 +70,7 @@
ui.open()
/mob/living/bot/mulebot/tgui_data(mob/user)
<<<<<<< HEAD
var/list/data = list(
"suffix" = suffix,
"power" = on,
@@ -81,6 +82,18 @@
"hatch" = open,
"safety" = safety,
)
=======
var/list/data = ..()
data["suffix"] = suffix
data["power"] = on
data["issillicon"] = issilicon(user)
data["load"] = load
data["locked"] = locked
data["auto_return"] = auto_return
data["crates_only"] = crates_only
data["hatch"] = open
data["safety"] = safety
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
return data
/mob/living/bot/mulebot/tgui_act(action, params)
+13
View File
@@ -108,6 +108,10 @@
data["check_arrest"] = null
data["arrest_type"] = null
data["declare_arrests"] = null
<<<<<<< HEAD
=======
data["bot_patrolling"] = null
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
data["will_patrol"] = null
if(!locked || issilicon(user))
@@ -116,8 +120,13 @@
data["check_arrest"] = check_arrest
data["arrest_type"] = arrest_type
data["declare_arrests"] = declare_arrests
<<<<<<< HEAD
if(using_map.bot_patrolling)
data["will_patrol"] = will_patrol
=======
data["bot_patrolling"] = using_map.bot_patrolling
data["patrol"] = will_patrol
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
return data
@@ -127,7 +136,11 @@
/mob/living/bot/secbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return
<<<<<<< HEAD
=======
>>>>>>> 6526ca1... Updates all bots to use TGUI, and adds mute button for certain bots (#8035)
add_fingerprint(usr)
switch(action)
+31 -8
View File
@@ -12,6 +12,7 @@ export const Cleanbot = (props, context) => {
version,
blood,
patrol,
vocal,
wet_floors,
spray_blood,
rgbpanel,
@@ -42,13 +43,35 @@ export const Cleanbot = (props, context) => {
</Section>
{!locked && (
<Section title="Behavior Controls">
<Button
fluid
icon={blood ? "toggle-on" : "toggle-off"}
selected={blood}
onClick={() => act("blood")}>
{blood ? "Cleans Blood" : "Ignores Blood"}
</Button>
<LabeledList>
<LabeledList.Item label="Blood">
<Button
fluid
icon={blood ? "toggle-on" : "toggle-off"}
selected={blood}
onClick={() => act("blood")}>
{blood ? "Clean" : "Ignore"}
</Button>
</LabeledList.Item>
<LabeledList.Item label="Speaker">
<Button
fluid
icon={vocal ? "toggle-on" : "toggle-off"}
selected={vocal}
onClick={() => act("vocal")}>
{vocal ? "On" : "Off"}
</Button>
</LabeledList.Item>
<LabeledList.Item label="Patrol">
<Button
fluid
icon={patrol ? "toggle-on" : "toggle-off"}
selected={patrol}
onClick={() => act("patrol")}>
{patrol ? "On" : "Off"}
</Button>
</LabeledList.Item>
</LabeledList>
</Section>
) || null}
{(!locked && open) && (
@@ -101,4 +124,4 @@ export const Cleanbot = (props, context) => {
</Window.Content>
</Window>
);
};
};
+3 -5
View File
@@ -93,8 +93,7 @@ export const Farmbot = (props, context) => {
</LabeledList.Item>
</LabeledList>
</Section>
{/* VOREStation Edit: No automatic hydroponics with the lagbot */}
{/* <Section level={2} title="Plant controls">
<Section level={2} title="Plant controls">
<LabeledList>
<LabeledList.Item label="Collect produce">
<Button
@@ -113,11 +112,10 @@ export const Farmbot = (props, context) => {
</Button>
</LabeledList.Item>
</LabeledList>
</Section> */}
{/* VOREStation Edit End */}
</Section>
</Section>
) || null}
</Window.Content>
</Window>
);
};
};
+10 -1
View File
@@ -9,6 +9,7 @@ export const Floorbot = (props, context) => {
on,
open,
locked,
vocal,
amount,
possible_bmode,
improvefloors,
@@ -43,6 +44,14 @@ export const Floorbot = (props, context) => {
{!locked && (
<Section title="Behavior Controls">
<LabeledList>
<LabeledList.Item label="Speaker">
<Button
icon={vocal ? "toggle-on" : "toggle-off"}
selected={vocal}
onClick={() => act("vocal")}>
{vocal ? "On" : "Off"}
</Button>
</LabeledList.Item>
<LabeledList.Item label="Improves Floors">
<Button
icon={improvefloors ? "toggle-on" : "toggle-off"}
@@ -82,4 +91,4 @@ export const Floorbot = (props, context) => {
</Window.Content>
</Window>
);
};
};
+7 -6
View File
@@ -14,7 +14,8 @@ export const Secbot = (props, context) => {
check_arrest,
arrest_type,
declare_arrests,
will_patrol,
bot_patrolling,
patrol,
} = data;
return (
@@ -80,13 +81,13 @@ export const Secbot = (props, context) => {
{declare_arrests ? "Yes" : "No"}
</Button>
</LabeledList.Item>
{will_patrol && (
{!!bot_patrolling && (
<LabeledList.Item label="Auto Patrol">
<Button
icon={will_patrol ? "toggle-on" : "toggle-off"}
selected={will_patrol}
icon={patrol ? "toggle-on" : "toggle-off"}
selected={patrol}
onClick={() => act("patrol")}>
{will_patrol ? "Yes" : "No"}
{patrol ? "Yes" : "No"}
</Button>
</LabeledList.Item>
)}
@@ -96,4 +97,4 @@ export const Secbot = (props, context) => {
</Window.Content>
</Window>
);
};
};
File diff suppressed because one or more lines are too long