mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2025-12-08 05:05:40 +00:00
Fix editor compilation errors
The `--editor` flag has no practical use and has never been used, so it's been removed.
This commit is contained in:
parent
f4b5df3640
commit
f4602687eb
|
|
@ -180,7 +180,7 @@ impl EditorInstance {
|
|||
let (scale_x, scale_y) = batch.scale();
|
||||
if let Some(tex) = batch.get_texture() {
|
||||
let (width, height) = tex.dimensions();
|
||||
let (width, height) = (width as f32 / scale_x, height as f32 / scale_y);
|
||||
let (width, height) = (width as f32 * scale_x, height as f32 * scale_y);
|
||||
|
||||
if let Ok(tex_id) = graphics::imgui_texture_id(ctx, tex) {
|
||||
Image::new(tex_id, [width, height]).build(ui);
|
||||
|
|
|
|||
|
|
@ -46,10 +46,6 @@ pub struct LaunchOptions {
|
|||
/// Do not create a window and skip audio initialization.
|
||||
pub server_mode: bool,
|
||||
|
||||
#[arg(long, hide = cfg!(not(feature = "editor")))]
|
||||
/// Enable built-in editor.
|
||||
pub editor: bool,
|
||||
|
||||
#[arg(long)]
|
||||
/// Window height in pixels.
|
||||
pub window_height: Option<u16>,
|
||||
|
|
@ -73,7 +69,6 @@ impl Default for LaunchOptions {
|
|||
fn default() -> Self {
|
||||
Self {
|
||||
server_mode: false,
|
||||
editor: false,
|
||||
window_height: None,
|
||||
window_width: None,
|
||||
window_fullscreen: false,
|
||||
|
|
|
|||
|
|
@ -7,11 +7,6 @@ use clap::Parser;
|
|||
fn main() {
|
||||
let options = doukutsu_rs::game::LaunchOptions::parse();
|
||||
|
||||
if options.server_mode && options.editor {
|
||||
eprintln!("Cannot run in server mode and editor mode at the same time.");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
let result = doukutsu_rs::game::init(options);
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::cell::RefCell;
|
|||
use std::rc::Rc;
|
||||
|
||||
use downcast::Downcast;
|
||||
use imgui::{Condition, MenuItem, TabItem, TabItemFlags, Window};
|
||||
use imgui::{Condition, TabItem, TabItemFlags, Window};
|
||||
|
||||
use crate::editor::{CurrentTool, EditorInstance};
|
||||
use crate::framework::context::Context;
|
||||
|
|
@ -121,7 +121,7 @@ trait ExtraWidgetsExt {
|
|||
fn tool_button(&self, label: impl AsRef<str>, active: bool) -> bool;
|
||||
}
|
||||
|
||||
impl ExtraWidgetsExt for imgui::Ui<'_> {
|
||||
impl ExtraWidgetsExt for imgui::Ui {
|
||||
fn tool_button(&self, label: impl AsRef<str>, active: bool) -> bool {
|
||||
if active {
|
||||
let color = self.style_color(imgui::StyleColor::ButtonActive);
|
||||
|
|
@ -222,13 +222,13 @@ impl Scene for EditorScene {
|
|||
menu_bar_size = (menu_bar_w, menu_bar_h);
|
||||
|
||||
if let Some(menu) = ui.begin_menu("File") {
|
||||
if MenuItem::new("Open stage").shortcut("Ctrl+O").build(ui) {
|
||||
if ui.menu_item_config("Open stage").shortcut("Ctrl+O").build() {
|
||||
self.stage_list.show();
|
||||
}
|
||||
|
||||
ui.separator();
|
||||
|
||||
if MenuItem::new("Exit editor").build(ui) {
|
||||
if ui.menu_item("Exit editor") {
|
||||
self.exit_editor(state);
|
||||
}
|
||||
|
||||
|
|
@ -333,7 +333,7 @@ impl StageListWindow {
|
|||
}
|
||||
|
||||
ui.push_item_width(-1.0);
|
||||
ui.list_box("", &mut self.selected_stage, &stages, 14);
|
||||
ui.list_box("##", &mut self.selected_stage, &stages, 14);
|
||||
|
||||
ui.disabled(self.selected_stage < 0, || {
|
||||
if ui.button("Open") {
|
||||
|
|
@ -341,7 +341,7 @@ impl StageListWindow {
|
|||
}
|
||||
|
||||
ui.same_line();
|
||||
if ui.button("Edit table entry") {}
|
||||
//if ui.button("Edit table entry") {}
|
||||
});
|
||||
|
||||
ui.same_line();
|
||||
|
|
|
|||
Loading…
Reference in a new issue