From cdb4bc2d6900943fb61590cee5ef06ba5f396082 Mon Sep 17 00:00:00 2001 From: hodasemi Date: Mon, 26 Aug 2024 10:08:03 +0200 Subject: [PATCH] Fix a lot of porting issues --- .../resources/abilities/ability_tooltip.xml | 13 +++ .../resources/abilities/addon_tooltip.xml | 11 ++ .../abilities/addon_type_snippet.xml | 9 ++ .../abilities/empty_addon_snippet.xml | 8 ++ .../resources/abilities/left_side.xml | 16 +++ .../resources/abilities/right_side.xml | 35 ++++++ .../resources/{ => character}/statistics.xml | 0 character_window/resources/content.xml | 14 +++ character_window/resources/content_button.xml | 8 ++ character_window/resources/inventory.xml | 45 ++++++++ .../resources/inventory/items/right_side.xml | 38 +++++++ .../resources/inventory/items/tooltip.xml | 13 +++ .../resources/inventory/jewels/right_side.xml | 23 ++++ .../resources/inventory/jewels/tooltip.xml | 11 ++ .../resources/inventory/left_side.xml | 17 +++ .../resources/inventory/maps/right_side.xml | 7 ++ .../resources/inventory/maps/tooltip.xml | 11 ++ .../resources/inventory_item_snippet.xml | 15 +++ .../src/abilities/ability_right_side.rs | 51 +++++---- character_window/src/abilities/content.rs | 65 +++++------ character_window/src/abilities/mod.rs | 65 ++++++----- character_window/src/character/mod.rs | 22 ++-- character_window/src/content.rs | 37 +++--- character_window/src/inventory/content.rs | 98 +++++++--------- .../src/inventory/item_right_side.rs | 82 +++++++------- .../src/inventory/jewel_right_side.rs | 62 +++++------ .../src/inventory/map_right_side.rs | 6 +- character_window/src/inventory/mod.rs | 105 ++++++++++-------- character_window/src/lib.rs | 57 +--------- engine/src/engine/engine.rs | 7 ++ engine/src/engine/enginesettings.rs | 4 +- .../src/game/content/components/loot_stash.rs | 2 +- 32 files changed, 604 insertions(+), 353 deletions(-) create mode 100644 character_window/resources/abilities/ability_tooltip.xml create mode 100644 character_window/resources/abilities/addon_tooltip.xml create mode 100644 character_window/resources/abilities/addon_type_snippet.xml create mode 100644 character_window/resources/abilities/empty_addon_snippet.xml create mode 100644 character_window/resources/abilities/left_side.xml create mode 100644 character_window/resources/abilities/right_side.xml rename character_window/resources/{ => character}/statistics.xml (100%) create mode 100644 character_window/resources/content.xml create mode 100644 character_window/resources/content_button.xml create mode 100644 character_window/resources/inventory.xml create mode 100644 character_window/resources/inventory/items/right_side.xml create mode 100644 character_window/resources/inventory/items/tooltip.xml create mode 100644 character_window/resources/inventory/jewels/right_side.xml create mode 100644 character_window/resources/inventory/jewels/tooltip.xml create mode 100644 character_window/resources/inventory/left_side.xml create mode 100644 character_window/resources/inventory/maps/right_side.xml create mode 100644 character_window/resources/inventory/maps/tooltip.xml create mode 100644 character_window/resources/inventory_item_snippet.xml diff --git a/character_window/resources/abilities/ability_tooltip.xml b/character_window/resources/abilities/ability_tooltip.xml new file mode 100644 index 0000000..c2b27b3 --- /dev/null +++ b/character_window/resources/abilities/ability_tooltip.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/character_window/resources/abilities/addon_tooltip.xml b/character_window/resources/abilities/addon_tooltip.xml new file mode 100644 index 0000000..7e1a634 --- /dev/null +++ b/character_window/resources/abilities/addon_tooltip.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/character_window/resources/abilities/addon_type_snippet.xml b/character_window/resources/abilities/addon_type_snippet.xml new file mode 100644 index 0000000..c59414c --- /dev/null +++ b/character_window/resources/abilities/addon_type_snippet.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/character_window/resources/abilities/empty_addon_snippet.xml b/character_window/resources/abilities/empty_addon_snippet.xml new file mode 100644 index 0000000..52b6dc1 --- /dev/null +++ b/character_window/resources/abilities/empty_addon_snippet.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/character_window/resources/abilities/left_side.xml b/character_window/resources/abilities/left_side.xml new file mode 100644 index 0000000..8ab5e00 --- /dev/null +++ b/character_window/resources/abilities/left_side.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/character_window/resources/abilities/right_side.xml b/character_window/resources/abilities/right_side.xml new file mode 100644 index 0000000..a1c84ff --- /dev/null +++ b/character_window/resources/abilities/right_side.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + 0 + 0 + 0 + 0 + 0 + 0 + + + \ No newline at end of file diff --git a/character_window/resources/statistics.xml b/character_window/resources/character/statistics.xml similarity index 100% rename from character_window/resources/statistics.xml rename to character_window/resources/character/statistics.xml diff --git a/character_window/resources/content.xml b/character_window/resources/content.xml new file mode 100644 index 0000000..c316d86 --- /dev/null +++ b/character_window/resources/content.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/character_window/resources/content_button.xml b/character_window/resources/content_button.xml new file mode 100644 index 0000000..3a8d148 --- /dev/null +++ b/character_window/resources/content_button.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/character_window/resources/inventory.xml b/character_window/resources/inventory.xml new file mode 100644 index 0000000..e43e80b --- /dev/null +++ b/character_window/resources/inventory.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/character_window/resources/inventory/items/right_side.xml b/character_window/resources/inventory/items/right_side.xml new file mode 100644 index 0000000..81b625a --- /dev/null +++ b/character_window/resources/inventory/items/right_side.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/character_window/resources/inventory/items/tooltip.xml b/character_window/resources/inventory/items/tooltip.xml new file mode 100644 index 0000000..8cd3d83 --- /dev/null +++ b/character_window/resources/inventory/items/tooltip.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/character_window/resources/inventory/jewels/right_side.xml b/character_window/resources/inventory/jewels/right_side.xml new file mode 100644 index 0000000..56e8c6b --- /dev/null +++ b/character_window/resources/inventory/jewels/right_side.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/character_window/resources/inventory/jewels/tooltip.xml b/character_window/resources/inventory/jewels/tooltip.xml new file mode 100644 index 0000000..1ae485a --- /dev/null +++ b/character_window/resources/inventory/jewels/tooltip.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/character_window/resources/inventory/left_side.xml b/character_window/resources/inventory/left_side.xml new file mode 100644 index 0000000..59176c6 --- /dev/null +++ b/character_window/resources/inventory/left_side.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/character_window/resources/inventory/maps/right_side.xml b/character_window/resources/inventory/maps/right_side.xml new file mode 100644 index 0000000..aa42278 --- /dev/null +++ b/character_window/resources/inventory/maps/right_side.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/character_window/resources/inventory/maps/tooltip.xml b/character_window/resources/inventory/maps/tooltip.xml new file mode 100644 index 0000000..d8addbd --- /dev/null +++ b/character_window/resources/inventory/maps/tooltip.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/character_window/resources/inventory_item_snippet.xml b/character_window/resources/inventory_item_snippet.xml new file mode 100644 index 0000000..2a5bab5 --- /dev/null +++ b/character_window/resources/inventory_item_snippet.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/character_window/src/abilities/ability_right_side.rs b/character_window/src/abilities/ability_right_side.rs index b4e5fa2..2b26227 100644 --- a/character_window/src/abilities/ability_right_side.rs +++ b/character_window/src/abilities/ability_right_side.rs @@ -25,15 +25,16 @@ impl AbilityPageRightSide { ]; pub fn new( - game_handle: &GameHandle, + engine: &Arc, reference: &Weak, hero: Entity, ) -> Result { - let snippet = - game_handle.gui_snippet("gui/xml/ingame/character_menu/abilities/right_side.xml")?; + let snippet = GuiSnippet::from_str( + engine.gui_handler(), + include_str!("../../resources/abilities/right_side.xml"), + )?; - let game = game_handle.upgrade(); - let color_settings = &game.item_settings.rarity_color_settings; + let color_settings = &engine.item_settings.rarity_color_settings; Self::rarity_icon_background(&snippet, "common", color_settings.common)?; Self::rarity_icon_background(&snippet, "uncommon", color_settings.uncommon)?; @@ -45,7 +46,7 @@ impl AbilityPageRightSide { for (index, name) in Self::ABILITY_BUTTON_NAMES.iter().enumerate() { let button: Arc