Add text fields, rglass smelting, style changes, sheet insertion.

This commit is contained in:
Expletive
2017-06-05 04:37:47 -07:00
parent de72edba99
commit a4063f5488
8 changed files with 56 additions and 23 deletions
+22 -5
View File
@@ -194,6 +194,12 @@
inserted_disk = W
return TRUE
if(istype(W, /obj/item/stack/sheet))
var/obj/item/stack/sheet/S = W
var/inserted = materials.insert_stack(S, S.amount)
to_chat(user, "<span class='notice'>You add [inserted] [S] sheets to \the [src].</span>")
return
return ..()
/obj/machinery/mineral/ore_redemption/on_deconstruction()
@@ -208,7 +214,7 @@
/obj/machinery/mineral/ore_redemption/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "ore_redemption_machine", "Ore Redemption Machine", 530, 580, master_ui, state)
ui = new(user, src, ui_key, "ore_redemption_machine", "Ore Redemption Machine", 440, 650, master_ui, state)
ui.open()
/obj/machinery/mineral/ore_redemption/ui_data(mob/user)
@@ -234,7 +240,7 @@
if(inserted_disk.blueprints.len)
var/index = 1
for (var/datum/design/thisdesign in inserted_disk.blueprints)
if(thisdesign) //error: : invalid expression
if(thisdesign)
data["diskDesigns"] += list(list("name" = thisdesign.name, "index" = index, "canupload" = thisdesign.build_type&SMELTER))
index++
CHECK_TICK
@@ -265,6 +271,7 @@
points = 0
return TRUE
if("Release")
if(check_access(inserted_id) || allowed(usr)) //Check the ID inside, otherwise check the user
var/out = get_step(src, output_dir)
if(params["id"] == "all")
@@ -278,7 +285,13 @@
if(!stored_amount)
return
var/desired = input("How many sheets?", "How many sheets to eject?", 1) as null|num
var/desired = 0
if (params["sheets"])
desired = text2num(params["sheets"])
else
desired = input("How many sheets?", "How many sheets would you like to smelt?", 1) as null|num
var/sheets_to_remove = round(min(desired,50,stored_amount))
materials.retrieve_sheets(sheets_to_remove, mat_id, out)
@@ -296,7 +309,7 @@
return TRUE
if("diskEject")
if(inserted_disk)
inserted_disk.forceMove(loc)
usr.put_in_hands(inserted_disk)
inserted_disk = null
return TRUE
if("diskUpload")
@@ -309,7 +322,11 @@
var/datum/design/alloy = files.FindDesignByID(alloy_id)
if((check_access(inserted_id) || allowed(usr)) && alloy)
var/smelt_amount = can_smelt_alloy(alloy)
var/desired = input("How many sheets?", "How many sheets would you like to smelt?", 1) as null|num
var/desired = 0
if (params["sheets"])
desired = text2num(params["sheets"])
else
desired = input("How many sheets?", "How many sheets would you like to smelt?", 1) as null|num
var/amount = round(min(desired,50,smelt_amount))
materials.use_amount(alloy.materials, amount)
var/output = new alloy.build_path(src)
@@ -216,7 +216,7 @@
/datum/design/rglass
name = "Reinforced Glass"
id = "rglass"
build_type = AUTOLATHE
build_type = AUTOLATHE | SMELTER
materials = list(MAT_METAL = 1000, MAT_GLASS = MINERAL_MATERIAL_AMOUNT)
build_path = /obj/item/stack/sheet/rglass
category = list("initial","Construction")
@@ -783,7 +783,7 @@
materials = list(MAT_METAL = 2000, MAT_GLASS = 1000)
build_path = /obj/item/device/modular_computer/tablet
category = list("initial","Misc")
/datum/design/slime_scanner
name = "Slime Scanner"
id = "slime_scanner"
@@ -791,4 +791,3 @@
materials = list(MAT_METAL = 300, MAT_GLASS = 200)
build_path = /obj/item/device/slime_scanner
category = list("initial", "Misc")
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -3
View File
File diff suppressed because one or more lines are too long
+4
View File
@@ -2,6 +2,10 @@ div.display
width: 100%
padding: 4px
margin: 6px 0
&.tabular
padding 0px
margin 0px
background-color: display-color-background // Transparent background.
box-shadow: inset 0 0 5px display-color-shadow
+4 -1
View File
@@ -9,8 +9,11 @@ input
color: input-color-text
background-color: input-color-background
border: 1px solid input-color-border
&.number
width: 40px
&::placeholder
color: input-color-placeholder
&::-ms-clear
display: none
+5 -1
View File
@@ -36,5 +36,9 @@ section
@extend $cell
&:not(:first-child)
text-align: center
padding-top 0px
span.button
width: 75px
&:not(:last-child)
padding-right: 4px
padding-right: 4px
@@ -46,9 +46,8 @@
</ui-section>
{{/if}}
</ui-display>
<ui-display>
<table>
<section class="candystripe">
<div class="display tabular">
<section class="candystripe">
<section class="cell">
Mineral
</section>
@@ -56,7 +55,9 @@
Sheets
</section>
<section class="cell">
<ui-button class='center' grid action='Release' params='{"id" : "all"}'>
</section>
<section class="cell">
<ui-button class='center mineral' grid action='Release' params='{"id" : "all"}'>
Release All
</ui-button>
</section>
@@ -72,8 +73,11 @@
<section class="cell" align='right'>
{{amount}}
</section>
<section class="cell">
<input value={{sheets}} placeholder='###' class="number"/>
</section>
<section class="cell" align='right'>
<ui-button class='center' grid action='Release' state={{(amount >= 1) ? null : 'disabled'}} params='{"id" : "{{id}}"}'>
<ui-button class='center' grid action='Release' state={{(amount >= 1) ? null : 'disabled'}} params='{ "id" : {{id}}, "sheets" : {{sheets}} }' >
Release
</ui-button>
</section>
@@ -90,17 +94,19 @@
<section class="cell" align='right'>
{{amount}}
</section>
<section class="cell">
<input value={{sheets}} placeholder='###' class="number"/>
</section>
<section class="cell" align='right'>
<ui-button class='center' grid action='Smelt' state={{ (amount >= 1) ? null : 'disabled'}} params='{"id" : "{{id}}"}'>
<ui-button class='center' grid action='Smelt' state={{ (amount >= 1) ? null : 'disabled'}} params='{ "id" : {{id}}, "sheets" : {{sheets}} }'>
Smelt
</ui-button>
</section>
<section class="cell" align='right'>
<ui-button class='center' grid action='SmeltAll' state={{ (amount >= 1) ? null : 'disabled'}} params='{"id" : "{{id}}"}'>
<ui-button class='center' grid action='SmeltAll' state={{ (amount >= 1) ? null : 'disabled'}} params='{ "id" : {{id}} }'>
Smelt All
</ui-button>
</section>
</section>
{{/each}}
</table>
</ui-display>
</div>