Skip to content

Commit

Permalink
fix: modal scroll windows
Browse files Browse the repository at this point in the history
add pages
  • Loading branch information
rfuzzo committed Aug 28, 2023
1 parent 5b37f03 commit 93e89f3
Show file tree
Hide file tree
Showing 12 changed files with 160 additions and 115 deletions.
79 changes: 45 additions & 34 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,56 @@
name: Github Pages

# By default, runs if you push to master. keeps your deployed app in sync with master branch.
on:
name: Build and Deploy
on:
push:
branches:
- main
# to only run when you do a new github release, comment out above part and uncomment the below trigger.
# on:
# release:
# types:
# - published

branches: [ "main" ]
permissions:
contents: write # for committing to gh-pages branch.
contents: write

jobs:
build-github-pages:
runs-on: ubuntu-latest

build:
runs-on: windows-latest # The first job utilizes windows-latest
steps:
- uses: actions/checkout@v2 # repo checkout
- uses: actions-rs/toolchain@v1 # get rust toolchain for wasm
- name: Checkout 🛎️
uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Rust Cache # cache the rust build artefacts
uses: Swatinem/rust-cache@v1
- name: Download and install Trunk binary
run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
- name: Build # build
# "${GITHUB_REPOSITORY#*/}" evaluates into the name of the repository
# using --public-url something will allow trunk to modify all the href paths like from favicon.ico to repo_name/favicon.ico .
# this is necessary for github pages where the site is deployed to username.github.io/repo_name and all files must be requested
# relatively as eframe_template/favicon.ico. if we skip public-url option, the href paths will instead request username.github.io/favicon.ico which
# will obviously return error 404 not found.
run: ./trunk build --release --public-url "${GITHUB_REPOSITORY#*/}"
- name: Deploy

- uses: actions-rs/cargo@v1
with:
command: build
args: --release

- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
with:
name: windows
path: target/release/tes3edit.exe

deploy:
concurrency: ci-${{ github.ref }}
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Download Artifacts 🔻 # The built project is downloaded into the 'site' folder.
uses: actions/download-artifact@v3
with:
name: windows
path: site

- name: Display structure of downloaded files
run: ls -R

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist
# this option will not maintain any history of your previous pages deployment
# set to false if you want all page build to be committed to your gh-pages branch history
single-commit: true
folder: 'site' # The deployment folder should match the name of the artifact. Even though our project builds into the 'build' folder the artifact name of 'site' must be placed here.
clean-exclude: |
*.md
assets
43 changes: 36 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,56 @@ PRs welcome! Feature requests welcome: <https://github.com/rfuzzo/tes3edit/issue

## Features

### Esp editing and creating

- Drag and drop any esp into the editor to open it
- Open multiple esps at the same time
- In-place editing
- Save as patch feature: only save edited records to a new plugin
- Search records by ID
- New plugin creation
- New record creation

### Generate map

- Generate the in-game map from selected plugins
- Cell selection
- Tooltips
- Overlay modes for: regions, conflicts, travel routes

### Compare plugins

- View conflicts between plugins

## Getting started

### App
> Nighlty (development) builds are available here: <https://rfuzzo.github.io/tes3edit/tes3edit.exe>
- download the latest release from GitHub: <https://github.com/rfuzzo/tes3edit>
- open `tes3edit.exe`

### Web
## Screenshots

> Unstable! Not feature complete!
### Editor View

- open link <https://rfuzzo.github.io/tes3edit/>
![Editor View](/assets/editor.png)

## Screenshots
### Drag and drop

![Drag and drop](/assets/drag_drop.png)

### Map conflict overlay

![Conflicts](/assets/map_conflicts.png)

### Map Travel routes overlay

![Travel](/assets/map_01.png)

### Map regions overlay

![Regions](/assets/map_regions.png)

![Editor View](/assets/Screenshot%202023-04-14%20154959.png)
### Compare Plugins

![Drag and drop](/assets/Screenshot%202023-04-14%20155030.png)
![Regions](/assets/conflicts_01.png)
Binary file removed assets/Screenshot 2023-06-02 115903.png
Binary file not shown.
Binary file added assets/conflicts_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added assets/map_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map_conflicts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/map_regions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 51 additions & 48 deletions src/views/modal_compare_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,49 @@ use crate::{
impl TemplateApp {
/// Returns the update modal compare of this [`TemplateApp`].
pub(crate) fn update_modal_compare(&mut self, ctx: &egui::Context) {
egui::TopBottomPanel::bottom("bottom_panel").show(ctx, |ui| {
// Buttons
ui.horizontal(|ui| {
if ui.button("OK").clicked() {
// go into compare mode
self.app_state = EAppState::Compare;

// calculate conflicts
// load plugins into memory
for vm in self.compare_data.plugins.iter_mut().filter(|e| e.enabled) {
if let Ok(plugin) = Plugin::from_path(&vm.path.clone()) {
vm.plugin = plugin;
vm.records = vm
.plugin
.objects
.iter()
.map(get_unique_id)
.collect::<Vec<_>>();
}
}

let conflict_map = generate_conflict_map(&self.compare_data);
self.compare_data.map = conflict_map;
let mut keys = self
.compare_data
.map
.keys()
.map(|e| e.to_owned())
.collect::<Vec<_>>();
keys.sort();
self.compare_data.conflicting_ids = keys;

// close modal window
self.toasts.success("Loaded plugins");
self.close_modal_window(ui);
}

if ui.button("Cancel").clicked() {
self.close_modal_window(ui);
}
});
});

egui::CentralPanel::default().show(ctx, |ui| {
// Logic
if !self.compare_data.path.exists() {
Expand Down Expand Up @@ -54,55 +97,15 @@ impl TemplateApp {

ui.separator();

for vm in self.compare_data.plugins.iter_mut() {
ui.horizontal(|ui| {
ui.checkbox(&mut vm.enabled, "");
ui.label(vm.path.file_name().unwrap().to_string_lossy());
});
}
ui.separator();
}

// Buttons
ui.horizontal(|ui| {
if ui.button("OK").clicked() {
// go into compare mode
self.app_state = EAppState::Compare;

// calculate conflicts
// load plugins into memory
for vm in self.compare_data.plugins.iter_mut().filter(|e| e.enabled) {
if let Ok(plugin) = Plugin::from_path(&vm.path.clone()) {
vm.plugin = plugin;
vm.records = vm
.plugin
.objects
.iter()
.map(get_unique_id)
.collect::<Vec<_>>();
}
egui::ScrollArea::vertical().show(ui, |ui| {
for vm in self.compare_data.plugins.iter_mut() {
ui.horizontal(|ui| {
ui.checkbox(&mut vm.enabled, "");
ui.label(vm.path.file_name().unwrap().to_string_lossy());
});
}

let conflict_map = generate_conflict_map(&self.compare_data);
self.compare_data.map = conflict_map;
let mut keys = self
.compare_data
.map
.keys()
.map(|e| e.to_owned())
.collect::<Vec<_>>();
keys.sort();
self.compare_data.conflicting_ids = keys;

// close modal window
self.toasts.success("Loaded plugins");
self.close_modal_window(ui);
}

if ui.button("Cancel").clicked() {
self.close_modal_window(ui);
}
});
});
}
});
}
}
Expand Down
54 changes: 28 additions & 26 deletions src/views/modal_map_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,26 @@ use crate::{

impl TemplateApp {
pub(crate) fn update_modal_map(&mut self, ctx: &egui::Context) {
egui::TopBottomPanel::bottom("bottom_panel").show(ctx, |ui| {
// Buttons
ui.horizontal(|ui| {
if ui.button("OK").clicked() {
// go into compare mode
self.app_state = EAppState::Map;

self.init_data();

// close modal window
self.toasts.success("Loaded plugins");
self.close_modal_window(ui);
}

if ui.button("Cancel").clicked() {
self.close_modal_window(ui);
}
});
});

egui::CentralPanel::default().show(ctx, |ui| {
// Logic
if !self.map_data.path.exists() {
Expand Down Expand Up @@ -58,32 +78,15 @@ impl TemplateApp {

ui.separator();

for vm in self.map_data.plugins.iter_mut() {
ui.horizontal(|ui| {
ui.checkbox(&mut vm.enabled, "");
ui.label(vm.path.file_name().unwrap().to_string_lossy());
});
}
ui.separator();
egui::ScrollArea::vertical().show(ui, |ui| {
for vm in self.map_data.plugins.iter_mut() {
ui.horizontal(|ui| {
ui.checkbox(&mut vm.enabled, "");
ui.label(vm.path.file_name().unwrap().to_string_lossy());
});
}
});
}

// Buttons
ui.horizontal(|ui| {
if ui.button("OK").clicked() {
// go into compare mode
self.app_state = EAppState::Map;

self.init_data();

// close modal window
self.toasts.success("Loaded plugins");
self.close_modal_window(ui);
}

if ui.button("Cancel").clicked() {
self.close_modal_window(ui);
}
});
});
}

Expand All @@ -96,7 +99,6 @@ impl TemplateApp {
let mut landscape: HashMap<(i32, i32), Landscape> = HashMap::default();
let mut land_id_map: HashMap<String, (i32, i32)> = HashMap::default();

// TODO fix loadorder
let mut travels: HashMap<String, Vec<(i32, i32)>> = HashMap::default();
let mut npcs: HashMap<String, (i32, i32)> = HashMap::default();

Expand Down

0 comments on commit 93e89f3

Please sign in to comment.