mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Make edit mode usable; complete #11
This commit is contained in:
1 parent
47eb32056c
commit
6fd4d673ca
40 files changed
+5313
-2162
No files matched your search
@@ -1,23 +1,12 @@
|
||||
use polariton_server::operations::SimpleFunc;
|
||||
use polariton::operation::{ParameterTable, Typed};
|
||||
|
||||
use crate::data::weapon_upgrade::*;
|
||||
use polariton_server::operations::Immediate;
|
||||
use crate::persist::config::ConfigProvider;
|
||||
|
||||
const PARAM_KEY: u8 = 38;
|
||||
|
||||
pub(super) fn weapons_upgrade_provider() -> SimpleFunc<82, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
|
||||
SimpleFunc::new(|params, _| {
|
||||
let mut params = params.to_dict();
|
||||
params.insert(PARAM_KEY, Typed::ObjArr(vec![
|
||||
WeaponUpgradeInfo {
|
||||
tier: crate::data::cube_list::ItemTier::T0,
|
||||
type_: crate::data::weapon_list::ItemCategory::Laser,
|
||||
xp: 4.2,
|
||||
rating: 1,
|
||||
rank: 1,
|
||||
power: 1,
|
||||
}.as_transmissible(),
|
||||
].into()));
|
||||
Ok(params.into())
|
||||
pub(super) fn weapons_upgrade_provider(cubes: &crate::persist::config::ConfigImpl) -> Immediate<82, crate::UserTy> {
|
||||
Immediate::new(|| {
|
||||
let mut params = std::collections::HashMap::with_capacity(2);
|
||||
params.insert(PARAM_KEY, cubes.weapon_upgrade_list());
|
||||
params.into()
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user