Clockworkslab work

Thanks to Letter N
This commit is contained in:
Artur
2020-06-24 16:09:22 +03:00
parent 517c0a348e
commit 940ddaeeb6
3 changed files with 25 additions and 36 deletions

View File

@@ -38,10 +38,11 @@
set_slab.update_quickbind()
/proc/generate_all_scripture()
if(!GLOB.all_scripture.len)
for(var/V in sortList(subtypesof(/datum/clockwork_scripture), /proc/cmp_clockscripture_priority))
var/datum/clockwork_scripture/S = new V
GLOB.all_scripture[S.type] = S
if(GLOB.all_scripture.len)
return
for(var/V in sortList(subtypesof(/datum/clockwork_scripture) - list(/datum/clockwork_scripture/channeled, /datum/clockwork_scripture/create_object, /datum/clockwork_scripture/create_object/construct), /proc/cmp_clockscripture_priority))
var/datum/clockwork_scripture/S = new V
GLOB.all_scripture[S.type] = S
//changes construction value
/proc/change_construction_value(amount)

View File

@@ -266,25 +266,27 @@
/obj/item/clockwork/slab/ui_data(mob/user) //we display a lot of data via TGUI
var/list/data = list()
data["power"] = get_clockwork_power()
data["scriptures"] = list()
data["power"] = DisplayPower(get_clockwork_power())
data["rec_text"] = recollection()
data["scripture"] = list()
for(var/s in GLOB.all_scripture)
var/datum/clockwork_scripture/S = GLOB.all_scripture[s]
//var/scripture_color = get_component_color_bright(S.primary_component)
var/list/temp_info = list("name" = "[S.name]",
var/list/temp_info = list(
"name" = "[S.name]",
"descname" = "[S.descname]",
"tip" = "[S.desc]\n[S.usage_tip]",
"required" = "([DisplayPower(S.power_cost)][S.special_power_text ? "+ [replacetext(S.special_power_text, "POWERCOST", "[DisplayPower(S.special_power_cost)]")]" : ""])",
"type" = "[S.type]",
"quickbind" = S.quickbind)
if(S.important)
temp_info["name"] = "[temp_info["name"]]"
"quickbind" = S.quickbind
)
temp_info["important"] = S.important
var/found = quickbound.Find(S.type)
if(found)
temp_info["bound"] = "[found]"
if(S.invokers_required > 1)
temp_info["invokers"] = "Invokers: [S.invokers_required]"
data["scripture"] += temp_info
data["scripture"] += list(temp_info)
return data
/obj/item/clockwork/slab/ui_static_data(mob/user)
@@ -307,7 +309,6 @@
list("name" = "Power", "desc" = "The power system that certain objects use to function."), \
list("name" = "Conversion", "desc" = "Converting the crew, cyborgs, and very walls to your cause."), \
)
data["rec_text"] = recollection()
return data
/obj/item/clockwork/slab/ui_act(action, params)

View File

@@ -14,9 +14,9 @@ export const ClockworkSlab = (props, context) => {
power = 0,
} = data;
return (
<Window>
<Window theme="clockcult" >
<Window.Content>
<Fragment theme="clockwork">
<Fragment>
<Section>
<Button
content={recollection
@@ -46,36 +46,25 @@ export const ClockworkSlab = (props, context) => {
) : (
<Fragment>
<Section title="Power">
<b>
{power <= 1000 ? (
`${power} W`
) : (
`${round(power/1000, 2)} kW`
)}
</b>
<b>${power}</b>
</Section>
<Section title="Recital">
{data.tier_info}
{data.scripturecolors}
<Tabs>
{map((cat_contents, category) => {
const contents = cat_contents || [];
{scripture.map(category => {
const script = category|| [];
return (
<Tabs.Tab
key={category}
label={category}>
<Section>
<LabeledList>
{contents.map(script => {
return (
<LabeledList.Item
key={script.name}
label={script.name}
label={script.important ? `<b>${script.name}</b>` : script.name}
buttons={(
<Fragment>
<Button
content={`Recite
(${script.required} W)`}
content={`Recite ${script.required}`}
disabled={script.required < power}
onClick={() => act('recite', {
'script': script.name,
@@ -91,15 +80,13 @@ export const ClockworkSlab = (props, context) => {
})} />
</Fragment>
)}>
{`${script.descname} ${script.invokers}`}
{`${script.descname || ""} ${script.invokers || 1}`}
</LabeledList.Item>
);
})}
</LabeledList>
</Section>
</Tabs.Tab>
);
})(scripture)}
})}
</Tabs>
</Section>
</Fragment>