-
Notifications
You must be signed in to change notification settings - Fork 0
/
WeaponShop.Rmd
60 lines (55 loc) · 1.5 KB
/
WeaponShop.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
title: "Startraveller Shop Generator"
runtime: shiny
output: html_document
---
```{r,echo=FALSE}
library(shiny)
#source("WeaponsShopHelper.R")
source("https://raw.githubusercontent.com/alastair-JL/StarTraveller/master/WeaponsShopHelper.R")
shinyUI(fluidPage(
titlePanel("StarTraveller Shop")
,fluidRow(
column(1,
actionButton("goButton", "Go!")
),
column(2,
numericInput("n",
label = "Random Seed",
value = sample(1:1000, 1, replace=TRUE) )
)
,
column(3,
actionButton("goButton", "Download Weapons")
),
column(3,
actionButton("goButton", "Download Items")
)
#,
# column(3,
# selectInput("ShopType",
# choices = c("General Weapons" = 1, "Guns Shop" = 2, "Blades shop" = 3),
# selected = 1, label="Shop Type")
# )
)
,hr()
,fluidRow(column(10,
renderDataTable({
input$goButton
isolate({
MakeWeaponShop(GeneralWeps,numItems=20,output=FALSE,seed=input$n,Filters=NULL)
})
}),
renderDataTable({
input$goButton
isolate({
Filter=list()
Filter$botPrice<-min(2.5^(input$priceBounds[1]),1500)
Filter$topPrice<-max(2.5^(input$priceBounds[2]),300, Filter$botPrice*5)
CoupledGrammerIterationLoop("~RandomItem~",TrinketGrammer,seed=input$n)
})
})
)) ##NOTE: here is end of fluid row
)#End fluid page
)#End shiny UI
```