Skip to content

Commit

Permalink
Sorta figure out dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-rs committed Oct 5, 2023
1 parent 396bd7e commit 689b1cb
Show file tree
Hide file tree
Showing 48 changed files with 962 additions and 1,057 deletions.
418 changes: 386 additions & 32 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ build = "build.rs"
[workspace]
members = [
"crates/luminol-audio",
"crates/luminol-commands",
"crates/luminol-components",
"crates/luminol-config",
"crates/luminol-core",
"crates/luminol-data",
"crates/luminol-filesystem",
"crates/luminol-graphics",
"crates/luminol-modals",
"crates/luminol-macros",
Expand All @@ -33,6 +34,7 @@ members = [

[workspace.dependencies]
egui = "0.22.0"
egui_extras = "0.22.0"

eframe = { version = "0.22.0", features = [
"wgpu",
Expand All @@ -57,12 +59,16 @@ bytemuck = { version = "1.14.0", features = [

strum = { version = "0.25.0", features = ["derive"] }
paste = "1.0.14"
thiserror = "1.0"
bitflags = "2.4.0"

parking_lot = "0.12.1"
once_cell = "1.18.0"
crossbeam = "0.8.2"
dashmap = "5.5.3"

poll-promise = "0.3.0"

camino = "1.1.6"

slab = { version = "0.4.9", features = ["serde"] }
Expand All @@ -78,9 +84,6 @@ egui.workspace = true
[features]
steamworks = [] # ["dep:steamworks", "crc"]

[target.'cfg(windows)'.dependencies]
windows = { version = "0.51.1", features = ["Win32_System_Registry"] }
winreg = "0.51.0"

[target.'cfg(windows)'.build-dependencies]
winres = "0.1"
Expand Down
2 changes: 2 additions & 0 deletions crates/luminol-audio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ strum.workspace = true
parking_lot.workspace = true
camino.workspace = true
once_cell.workspace = true

luminol-core = { version = "0.1.0", path = "../luminol-core/" }
6 changes: 3 additions & 3 deletions crates/luminol-audio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ impl Audio {
pub fn play(
&self,
path: impl AsRef<camino::Utf8Path>,
filesystem: &'static impl luminol_core::filesystem::FileSystem, // FIXME
volume: u8,
pitch: u8,
source: Source,
Expand All @@ -84,9 +85,8 @@ impl Audio {
let sink = rodio::Sink::try_new(&inner.output_stream_handle).map_err(|e| e.to_string())?;

let path = path.as_ref();
let file = state!()
.filesystem
.open_file(path, filesystem::OpenFlags::Read)
let file = filesystem
.open_file(path, luminol_core::filesystem::OpenFlags::Read)
.map_err(|e| e.to_string())?;

// Select decoder type based on sound source
Expand Down
12 changes: 0 additions & 12 deletions crates/luminol-commands/Cargo.toml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ mod command_ui;
mod parameter_ui;
mod ui;

pub use crate::prelude::*;
use std::collections::HashMap;

pub struct CommandView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
// terms of the Steamworks API by Valve Corporation, the licensors of this
// Program grant you additional permission to convey the resulting work.

use crate::prelude::*;
use super::CommandView;

use command_lib::{Parameter, ParameterKind};
use crate::{Parameter, ParameterKind};

impl CommandView {
#[allow(clippy::only_used_in_recursion)]
pub fn parameter_ui(
&mut self,
ui: &mut egui::Ui,
parameter: &Parameter,
command: &mut rpg::EventCommand,
command: &mut luminol_data::rpg::EventCommand,
) {
match parameter {
Parameter::Selection {
Expand Down
19 changes: 19 additions & 0 deletions crates/luminol-config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "luminol-config"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rust-ini = "0.19.0"

serde.workspace = true

strum.workspace = true
ron.workspace = true

once_cell.workspace = true

luminol-core = { version = "0.1.0", path = "../luminol-core/" }
luminol-data = { version = "0.1.0", path = "../luminol-data/" }
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
// terms of the Steamworks API by Valve Corporation, the licensors of this
// Program grant you additional permission to convey the resulting work.

use command_lib::CommandDescription;
use luminol_data::commands::CommandDescription;
use once_cell::sync::Lazy;

use serde::{Deserialize, Serialize};

use super::RMVer;
Expand Down Expand Up @@ -51,6 +52,7 @@ pub struct CommandDB {
/// Default commands
default: Vec<CommandDescription>,
/// User defined commands
// FIXME: visible to user?
pub user: Vec<CommandDescription>,
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
// terms of the Steamworks API by Valve Corporation, the licensors of this
// Program grant you additional permission to convey the resulting work.

use crate::prelude::*;
use std::collections::HashMap;
use std::collections::VecDeque;

Expand All @@ -33,7 +32,7 @@ pub struct Config {
/// Recently open projects.
pub recent_projects: VecDeque<String>,
/// The current code theme
pub theme: syntax_highlighting::CodeTheme,
// pub theme: syntax_highlighting::CodeTheme,
pub rtp_paths: HashMap<String, String>,
}

Expand All @@ -47,7 +46,7 @@ impl Config {
pub fn new() -> Self {
Self {
recent_projects: VecDeque::new(),
theme: syntax_highlighting::CodeTheme::dark(),
// theme: syntax_highlighting::CodeTheme::dark(),
rtp_paths: HashMap::new(),
}
}
Expand Down
91 changes: 91 additions & 0 deletions crates/luminol-config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// Copyright (C) 2023 Lily Lyons
//
// This file is part of Luminol.
//
// Luminol is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Luminol is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Luminol. If not, see <http://www.gnu.org/licenses/>.

pub mod command_db;
pub mod global;
pub mod project;

#[derive(Default, Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(strum::EnumIter, strum::Display)]
#[allow(missing_docs)]
pub enum RGSSVer {
#[strum(to_string = "ModShot")]
ModShot,
#[strum(to_string = "mkxp-oneshot")]
MKXPOneShot,
#[strum(to_string = "rsgss")]
RSGSS,
#[strum(to_string = "mkxp")]
MKXP,
#[strum(to_string = "mkxp-freebird")]
MKXPFreebird,
#[strum(to_string = "mkxp-z")]
MKXPZ,
#[default]
#[strum(to_string = "Stock RGSS1")]
RGSS1,
}

#[derive(Default, Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(strum::EnumIter, strum::Display)]
#[allow(missing_docs)]
pub enum RMVer {
#[default]
#[strum(to_string = "RPG Maker XP")]
XP = 1,
#[strum(to_string = "RPG Maker VX")]
VX = 2,
#[strum(to_string = "RPG Maker VX Ace")]
Ace = 3,
}

impl RMVer {
pub fn detect_from_filesystem(
filesystem: &impl luminol_core::filesystem::FileSystem,
) -> Option<Self> {
if filesystem.exists("Data/Actors.rxdata").ok()? {
return Some(RMVer::XP);
}

if filesystem.exists("Data/Actors.rvdata").ok()? {
return Some(RMVer::VX);
}

if filesystem.exists("Data/Actors.rvdata2").ok()? {
return Some(RMVer::Ace);
}

for path in filesystem.read_dir("").ok()? {
let path = path.path();
if path.extension() == Some("rgssad") {
return Some(RMVer::XP);
}

if path.extension() == Some("rgss2a") {
return Some(RMVer::VX);
}

if path.extension() == Some("rgss3a") {
return Some(RMVer::Ace);
}
}

None
}
}
Loading

0 comments on commit 689b1cb

Please sign in to comment.