Fix socket tooltip

This commit is contained in:
hodasemi 2024-08-29 12:41:39 +02:00
parent a837ab72dd
commit e2e0b20ecf
16 changed files with 271 additions and 14 deletions

View file

@ -1,4 +1,4 @@
<?xml-model href="../../../../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="1280" reference_height="720" layer="11"> <root reference_width="1280" reference_height="720" layer="11">
<grid id="addon_grid" x_dim="1" y_dim="3" padding="4" margin="2" <grid id="addon_grid" x_dim="1" y_dim="3" padding="4" margin="2"
x_offset="0" y_offset="0" vert_align="top" hori_align="left" x_offset="0" y_offset="0" vert_align="top" hori_align="left"

View file

@ -1,4 +1,4 @@
<?xml-model href="../../../../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="1280" reference_height="720" layer="11"> <root reference_width="1280" reference_height="720" layer="11">
<grid id="item_grid" x_dim="1" y_dim="4" margin="2" padding="4" x_offset="0" y_offset="0" vert_align="top" hori_align="left" <grid id="item_grid" x_dim="1" y_dim="4" margin="2" padding="4" x_offset="0" y_offset="0" vert_align="top" hori_align="left"
background='{"background_color":"#794c0a","border_color":"#543919","border_thickness":{"Pixel":2}}' background='{"background_color":"#794c0a","border_color":"#543919","border_thickness":{"Pixel":2}}'

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -0,0 +1,248 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- definition of attributes -->
<xs:attribute name="id" type="xs:string"></xs:attribute>
<xs:attribute name="x_slot" type="xs:nonNegativeInteger"></xs:attribute>
<xs:attribute name="y_slot" type="xs:nonNegativeInteger"></xs:attribute>
<xs:attribute name="x_dim" type="xs:nonNegativeInteger"></xs:attribute>
<xs:attribute name="y_dim" type="xs:nonNegativeInteger"></xs:attribute>
<xs:attribute name="x_size" type="xs:nonNegativeInteger"></xs:attribute>
<xs:attribute name="y_size" type="xs:nonNegativeInteger"></xs:attribute>
<xs:attribute name="normal" type="xs:string"></xs:attribute>
<xs:attribute name="selected" type="xs:string"></xs:attribute>
<xs:attribute name="click_sound" type="xs:string"></xs:attribute>
<xs:attribute name="hover_sound" type="xs:string"></xs:attribute>
<xs:attribute name="select_mode">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="none"></xs:enumeration>
<xs:enumeration value="bigger"></xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="icon" type="xs:string"></xs:attribute>
<xs:attribute name="icon_margin" type="xs:nonNegativeInteger"></xs:attribute>
<xs:attribute name="text_color" type="xs:string"></xs:attribute>
<xs:attribute name="text_ratio" type="xs:decimal"></xs:attribute>
<xs:attribute name="text_alignment">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="left"></xs:enumeration>
<xs:enumeration value="right"></xs:enumeration>
<xs:enumeration value="top"></xs:enumeration>
<xs:enumeration value="bottom"></xs:enumeration>
<xs:enumeration value="center"></xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="select" type="xs:boolean"></xs:attribute>
<xs:attribute name="isolate" type="xs:boolean"></xs:attribute>
<xs:attribute name="x_offset" type="xs:integer"></xs:attribute>
<xs:attribute name="y_offset" type="xs:integer"></xs:attribute>
<xs:attribute name="width" type="xs:integer"></xs:attribute>
<xs:attribute name="height" type="xs:integer"></xs:attribute>
<xs:attribute name="padding" type="xs:nonNegativeInteger"></xs:attribute>
<xs:attribute name="margin" type="xs:nonNegativeInteger"></xs:attribute>
<xs:attribute name="vert_align">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="top"></xs:enumeration>
<xs:enumeration value="middle"></xs:enumeration>
<xs:enumeration value="bottom"></xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="hori_align">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="left"></xs:enumeration>
<xs:enumeration value="middle"></xs:enumeration>
<xs:enumeration value="right"></xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="background" type="xs:string"></xs:attribute>
<xs:attribute name="foreground" type="xs:string"></xs:attribute>
<xs:attribute name="button_normal" type="xs:string"></xs:attribute>
<xs:attribute name="button_selected" type="xs:string"></xs:attribute>
<xs:attribute name="fill_type">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="expand"></xs:enumeration>
<xs:enumeration value="square"></xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="reference_width" type="xs:nonNegativeInteger"></xs:attribute>
<xs:attribute name="reference_height" type="xs:nonNegativeInteger"></xs:attribute>
<xs:attribute name="layer" type="xs:nonNegativeInteger"></xs:attribute>
<xs:attribute name="line_count" type="xs:nonNegativeInteger"></xs:attribute>
<xs:attribute name="west_neighbour" type="xs:string"></xs:attribute>
<xs:attribute name="east_neighbour" type="xs:string"></xs:attribute>
<xs:attribute name="north_neighbour" type="xs:string"></xs:attribute>
<xs:attribute name="south_neighbour" type="xs:string"></xs:attribute>
<!-- definition of complex elements -->
<xs:element name="root">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="grid" />
</xs:choice>
<xs:attribute ref="reference_width"></xs:attribute>
<xs:attribute ref="reference_height"></xs:attribute>
<xs:attribute ref="layer"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="grid">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="grid" />
<xs:element name="button" />
<xs:element name="label" />
<xs:element name="progressbar" />
<xs:element name="textfield" />
<xs:element name="icon" />
</xs:choice>
<xs:attribute ref="id"></xs:attribute>
<xs:attribute ref="x_slot"></xs:attribute>
<xs:attribute ref="y_slot"></xs:attribute>
<xs:attribute ref="x_dim"></xs:attribute>
<xs:attribute ref="y_dim"></xs:attribute>
<xs:attribute ref="x_size"></xs:attribute>
<xs:attribute ref="y_size"></xs:attribute>
<xs:attribute ref="x_offset"></xs:attribute>
<xs:attribute ref="y_offset"></xs:attribute>
<xs:attribute ref="width"></xs:attribute>
<xs:attribute ref="height"></xs:attribute>
<xs:attribute ref="padding"></xs:attribute>
<xs:attribute ref="margin"></xs:attribute>
<xs:attribute ref="vert_align"></xs:attribute>
<xs:attribute ref="hori_align"></xs:attribute>
<xs:attribute ref="background"></xs:attribute>
<xs:attribute ref="button_normal"></xs:attribute>
<xs:attribute ref="button_selected"></xs:attribute>
<xs:attribute ref="click_sound"></xs:attribute>
<xs:attribute ref="hover_sound"></xs:attribute>
<xs:attribute ref="layer"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="button">
<xs:complexType mixed="true">
<xs:attribute ref="id"></xs:attribute>
<xs:attribute ref="x_slot"></xs:attribute>
<xs:attribute ref="y_slot"></xs:attribute>
<xs:attribute ref="x_size"></xs:attribute>
<xs:attribute ref="y_size"></xs:attribute>
<xs:attribute ref="select"></xs:attribute>
<xs:attribute ref="isolate"></xs:attribute>
<xs:attribute ref="normal"></xs:attribute>
<xs:attribute ref="selected"></xs:attribute>
<xs:attribute ref="fill_type"></xs:attribute>
<xs:attribute ref="click_sound"></xs:attribute>
<xs:attribute ref="hover_sound"></xs:attribute>
<xs:attribute ref="select_mode"></xs:attribute>
<xs:attribute ref="icon"></xs:attribute>
<xs:attribute ref="icon_margin"></xs:attribute>
<xs:attribute ref="text_color"></xs:attribute>
<xs:attribute ref="text_ratio"></xs:attribute>
<xs:attribute ref="text_alignment"></xs:attribute>
<xs:attribute ref="west_neighbour"></xs:attribute>
<xs:attribute ref="east_neighbour"></xs:attribute>
<xs:attribute ref="north_neighbour"></xs:attribute>
<xs:attribute ref="south_neighbour"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="label">
<xs:complexType mixed="true">
<xs:attribute ref="id"></xs:attribute>
<xs:attribute ref="x_slot"></xs:attribute>
<xs:attribute ref="y_slot"></xs:attribute>
<xs:attribute ref="x_size"></xs:attribute>
<xs:attribute ref="y_size"></xs:attribute>
<xs:attribute ref="text_color"></xs:attribute>
<xs:attribute ref="text_ratio"></xs:attribute>
<xs:attribute ref="text_alignment"></xs:attribute>
<xs:attribute ref="background"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="multi_line_label">
<xs:complexType mixed="true">
<xs:attribute ref="id"></xs:attribute>
<xs:attribute ref="x_slot"></xs:attribute>
<xs:attribute ref="y_slot"></xs:attribute>
<xs:attribute ref="x_size"></xs:attribute>
<xs:attribute ref="y_size"></xs:attribute>
<xs:attribute ref="line_count"></xs:attribute>
<xs:attribute ref="text_color"></xs:attribute>
<xs:attribute ref="text_ratio"></xs:attribute>
<xs:attribute ref="text_alignment"></xs:attribute>
<xs:attribute ref="background"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="multi_line_textfield">
<xs:complexType mixed="true">
<xs:attribute ref="id"></xs:attribute>
<xs:attribute ref="x_slot"></xs:attribute>
<xs:attribute ref="y_slot"></xs:attribute>
<xs:attribute ref="x_size"></xs:attribute>
<xs:attribute ref="y_size"></xs:attribute>
<xs:attribute ref="line_count"></xs:attribute>
<xs:attribute ref="text_color"></xs:attribute>
<xs:attribute ref="text_ratio"></xs:attribute>
<xs:attribute ref="text_alignment"></xs:attribute>
<xs:attribute ref="background"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="progressbar">
<xs:complexType mixed="true">
<xs:attribute ref="id"></xs:attribute>
<xs:attribute ref="x_slot"></xs:attribute>
<xs:attribute ref="y_slot"></xs:attribute>
<xs:attribute ref="x_size"></xs:attribute>
<xs:attribute ref="y_size"></xs:attribute>
<xs:attribute ref="text_color"></xs:attribute>
<xs:attribute ref="text_ratio"></xs:attribute>
<xs:attribute ref="text_alignment"></xs:attribute>
<xs:attribute ref="background"></xs:attribute>
<xs:attribute ref="foreground"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="textfield">
<xs:complexType mixed="true">
<xs:attribute ref="id"></xs:attribute>
<xs:attribute ref="x_slot"></xs:attribute>
<xs:attribute ref="y_slot"></xs:attribute>
<xs:attribute ref="x_size"></xs:attribute>
<xs:attribute ref="y_size"></xs:attribute>
<xs:attribute ref="text_color"></xs:attribute>
<xs:attribute ref="text_ratio"></xs:attribute>
<xs:attribute ref="text_alignment"></xs:attribute>
<xs:attribute ref="background"></xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="icon">
<xs:complexType>
<xs:attribute ref="id"></xs:attribute>
<xs:attribute ref="x_slot"></xs:attribute>
<xs:attribute ref="y_slot"></xs:attribute>
<xs:attribute ref="x_size"></xs:attribute>
<xs:attribute ref="y_size"></xs:attribute>
<xs:attribute ref="icon"></xs:attribute>
<xs:attribute ref="margin"></xs:attribute>
<xs:attribute ref="background"></xs:attribute>
<xs:attribute ref="fill_type"></xs:attribute>
<xs:attribute ref="text_color"></xs:attribute>
<xs:attribute ref="text_ratio"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

View file

@ -1,7 +1,7 @@
<?xml-model href="../../../../../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root> <root>
<grid x_dim="4" y_dim="1"> <grid x_dim="4" y_dim="1">
<icon id="socket_icon" x_slot="0" y_slot="0" icon="textures/abilities/circle.png"></icon> <icon id="socket_icon" x_slot="0" y_slot="0"></icon>
<label id="stat_type" x_slot="1" y_slot="0" x_size="3" text_color="black" text_alignment="left">StatType</label> <label id="stat_type" x_slot="1" y_slot="0" x_size="3" text_color="black" text_alignment="left">StatType</label>
</grid> </grid>
</root> </root>

View file

@ -1,4 +1,4 @@
<?xml-model href="../../../../../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="1280" reference_height="720" layer="11"> <root reference_width="1280" reference_height="720" layer="11">
<grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top" padding="4" margin="2" <grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top" padding="4" margin="2"
background='{"background_color":"#794c0a","border_color":"#543919","border_thickness":{"Pixel":2}}' background='{"background_color":"#794c0a","border_color":"#543919","border_thickness":{"Pixel":2}}'

View file

@ -1,4 +1,4 @@
<?xml-model href="../../../../../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="1280" reference_height="720" layer="11"> <root reference_width="1280" reference_height="720" layer="11">
<grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top" <grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top"
hori_align="left" width="300" padding="4" margin="2" hori_align="left" width="300" padding="4" margin="2"

View file

@ -1,4 +1,4 @@
<?xml-model href="../../../../../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="1280" reference_height="720" layer="11"> <root reference_width="1280" reference_height="720" layer="11">
<grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top" <grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top"
hori_align="left" width="300" padding="4" margin="2" hori_align="left" width="300" padding="4" margin="2"

View file

@ -1,4 +1,4 @@
<?xml-model href="../../../../../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="1280" reference_height="720" layer="11"> <root reference_width="1280" reference_height="720" layer="11">
<grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top" <grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top"
hori_align="left" width="300" padding="4" margin="2" hori_align="left" width="300" padding="4" margin="2"

View file

@ -1,4 +1,4 @@
<?xml-model href="../../../../../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="1280" reference_height="720" layer="11"> <root reference_width="1280" reference_height="720" layer="11">
<grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top" <grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top"
hori_align="left" width="300" padding="4" margin="2" hori_align="left" width="300" padding="4" margin="2"

View file

@ -1,4 +1,4 @@
<?xml-model href="../../../../../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="1280" reference_height="720" layer="11"> <root reference_width="1280" reference_height="720" layer="11">
<grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top" <grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top"
hori_align="left" width="300" padding="4" margin="2" hori_align="left" width="300" padding="4" margin="2"

View file

@ -1,4 +1,4 @@
<?xml-model href="../../../../../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="1280" reference_height="720" layer="11"> <root reference_width="1280" reference_height="720" layer="11">
<grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top" <grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top"
hori_align="left" width="300" padding="4" margin="2" hori_align="left" width="300" padding="4" margin="2"

View file

@ -1,4 +1,4 @@
<?xml-model href="../../../../../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="1280" reference_height="720" layer="11"> <root reference_width="1280" reference_height="720" layer="11">
<grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top" <grid id="item_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top"
hori_align="left" width="300" padding="4" margin="2" hori_align="left" width="300" padding="4" margin="2"

View file

@ -1,4 +1,4 @@
<?xml-model href="../../../../gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root reference_width="1280" reference_height="720" layer="11"> <root reference_width="1280" reference_height="720" layer="11">
<grid id="main_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top" padding="4" margin="2" <grid id="main_grid" x_dim="1" x_offset="0" y_offset="0" vert_align="top" padding="4" margin="2"
background='{"background_color":"#794c0a","border_color":"#543919","border_thickness":{"Pixel":2}}' background='{"background_color":"#794c0a","border_color":"#543919","border_thickness":{"Pixel":2}}'

View file

@ -1,3 +1,4 @@
<?xml-model href="gui.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<root> <root>
<grid x_dim="3" y_dim="1"> <grid x_dim="3" y_dim="1">
<label id="stat_type" x_slot="0" y_slot="0" x_size="2" text_color="black" text_alignment="left">StatType</label> <label id="stat_type" x_slot="0" y_slot="0" x_size="2" text_color="black" text_alignment="left">StatType</label>

View file

@ -306,7 +306,15 @@ impl Item {
socket_icon.set_icon(&jewel.icon())?; socket_icon.set_icon(&jewel.icon())?;
stat_type.set_text(format!("{}", jewel.stat))?; stat_type.set_text(format!("{}", jewel.stat))?;
} }
None => stat_type.set_text("Empty Socket")?, None => {
socket_icon.set_icon(
&Image::from_slice(include_bytes!("../../resources/circle.png"))?
.attach_sampler(Sampler::pretty_sampler().build(gui_handler.device())?)
.build(gui_handler.device(), gui_handler.queue())?,
)?;
stat_type.set_text("Empty Socket")?
}
} }
inspector_grid.attach(socket_snippet, 0, index, 1, 1)?; inspector_grid.attach(socket_snippet, 0, index, 1, 1)?;