Split the editor and tools into separate crates

This commit is contained in:
Tad Hardesty 2017-11-04 02:23:14 -07:00
parent ce64520e5a
commit 7957f32657
20 changed files with 70 additions and 30 deletions

33
Cargo.lock generated
View file

@ -202,12 +202,28 @@ dependencies = [
"libloading 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "dmm-tools"
version = "0.1.0"
dependencies = [
"dreammaker 0.1.0",
"flame 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"inflate 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"linked-hash-map 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ndarray 0.10.12 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "dreammaker"
version = "0.1.0"
dependencies = [
"linked-hash-map 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"petgraph 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -754,14 +770,8 @@ name = "spaceman-dmm"
version = "0.1.0"
dependencies = [
"conrod 0.56.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dmm-tools 0.1.0",
"dreammaker 0.1.0",
"flame 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"inflate 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"linked-hash-map 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ndarray 0.10.12 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -959,6 +969,14 @@ dependencies = [
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "xml-rs"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[metadata]
"checksum adler32 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6cbd0b9af8587c72beadc9f72d35b9fbb070982c9e6203e46e93f10df25f8f45"
"checksum android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407"
@ -1072,3 +1090,4 @@ dependencies = [
"checksum winit 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "74bcacc675f952f71c2ebc9750dfd90d605de2cbe2e8ea3b38a370498238a507"
"checksum x11-dl 2.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd409cc4061fe552ee165c7844cc88596f68d52605c64710b57d8231c700820b"
"checksum xml-rs 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e1945e12e16b951721d7976520b0832496ef79c31602c7a29d950de79ba74621"
"checksum xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c1cb601d29fe2c2ac60a2b2e5e293994d87a1f6fa9687a31a15270f909be9c2"

View file

@ -3,29 +3,19 @@ name = "spaceman-dmm"
version = "0.1.0"
authors = ["Tad Hardesty <tad@platymuus.com>"]
[[bin]]
name = "cli"
path = "src/cli/main.rs"
[[bin]]
name = "editor"
path = "src/editor/main.rs"
[dependencies]
png = "0.11.0"
inflate = "0.3.3"
ndarray = "0.10.11"
rand = "0.3.17"
linked-hash-map = "0.5.0"
flame = { version = "0.2.0", optional = true }
conrod = { version = "0.56.0", features = ["glium", "winit"] }
dreammaker = { path = "dreammaker" }
[dev-dependencies]
walkdir = "2.0.1"
dreammaker = { path = "src/dreammaker" }
dmm-tools = { path = "src/tools" }
[profile.dev]
opt-level = 3
[profile.release]
lto = true
[workspace]

View file

@ -8,17 +8,17 @@ pub fn main() {
let mut events_loop = glutin::EventsLoop::new();
let window = glutin::WindowBuilder::new()
.with_title("SpacemanDMM")
.with_dimensions(1024, 768);
.with_dimensions(1400, 768);
let context = glutin::ContextBuilder::new()
.with_vsync(true)
.with_multisampling(4);
let display = glium::Display::new(window, context, &events_loop).unwrap();
let mut ui = conrod::UiBuilder::new([1024., 768.])
let mut ui = conrod::UiBuilder::new([1400., 768.])
.theme(conrod::Theme {
background_color: conrod::Color::Rgba(240./255., 240./255., 240./255., 1.),
border_color: conrod::Color::Rgba(160./255., 160./255., 160./255., 1.),
border_width: 0.5,
border_width: 1.,
.. conrod::Theme::default()
})
.build();
@ -76,9 +76,12 @@ widget_ids! {
canvas_status,
canvas_objtree,
canvas_bar2,
canvas_middle,
canvas_map,
canvas_minimap,
canvas_instances,
text_status,
}
}
@ -87,10 +90,15 @@ fn set_ui(ref mut ui: conrod::UiCell, ids: &Ids) {
use conrod::*;
use conrod::widget::*;
let middle_canvas_items = [
(ids.canvas_minimap, Canvas::new().length(256.)),
(ids.canvas_instances, Canvas::new().length_weight(1.)),
];
let main_canvas_items = [
(ids.canvas_objtree, Canvas::new().length(256.)),
(ids.canvas_bar2, Canvas::new().length(256.)),
(ids.canvas_map, Canvas::new().length_weight(1.).color(color::CHARCOAL)),
(ids.canvas_middle, Canvas::new().length(256.).flow_down(&middle_canvas_items)),
(ids.canvas_map, Canvas::new().length_weight(1.)),
];
let main_canvas = Canvas::new()
.length_weight(1.)
@ -107,7 +115,7 @@ fn set_ui(ref mut ui: conrod::UiCell, ids: &Ids) {
.set(ids.canvas_root, ui);
Text::new("SpacemanDMM")
.top_left_of(ids.canvas_status)
.top_left_with_margin_on(ids.canvas_status, 1.)
.set(ids.text_status, ui);
/*FileNavigator::all("../tgstation".as_ref())

23
src/tools/Cargo.toml Normal file
View file

@ -0,0 +1,23 @@
[package]
name = "dmm-tools"
version = "0.1.0"
authors = ["Tad Hardesty <tad@platymuus.com>"]
[lib]
path = "lib.rs"
[[bin]]
name = "dmm-tools"
path = "main.rs"
[dependencies]
png = "0.11.0"
inflate = "0.3.3"
ndarray = "0.10.11"
rand = "0.3.17"
linked-hash-map = "0.5.0"
flame = { version = "0.2.0", optional = true }
dreammaker = { path = "../dreammaker" }
[dev-dependencies]
walkdir = "2.0.1"

View file

@ -1,7 +1,7 @@
#[macro_use] extern crate spaceman_dmm;
#[macro_use] extern crate dmm_tools;
extern crate dreammaker as dm;
use spaceman_dmm::*;
use dmm_tools::*;
fn main() {
let objtree = {