Skip to content

Commit

Permalink
characterinfo ui fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shnok committed Jul 12, 2024
1 parent 5cab672 commit 794c8ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@
<ui:GroupBox name="ImageStats" style="margin-top: 2px; margin-right: 0; margin-bottom: 0; margin-left: 15px; padding-top: 0; padding-bottom: 0; padding-left: 0; height: 70px; width: 140px;">
<ui:GroupBox name="CPContainer" style="flex-direction: row; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-bottom: 0; padding-left: 0; height: 14px; width: auto; font-size: 12px; align-self: stretch; justify-content: flex-start; align-items: auto;">
<ui:GroupBox style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-bottom: 0; padding-left: 0; align-self: stretch; align-items: stretch; justify-content: flex-start; width: 128px;">
<ui:GroupBox name="CpBg" style="flex-direction: row; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-bottom: 0; padding-left: 0; position: absolute; width: auto; height: 13px;">
<ui:VisualElement name="Left" style="flex-grow: 1; max-width: 4px; max-height: 16px; width: 4px; height: 16px; background-image: resource(&apos;Data/UI/Status/Gauge/Gauge_DF_Large_CP/Gauge_DF_Large_CP_bg_Center&apos;);" />
<ui:VisualElement name="Center" style="flex-grow: 1; max-width: none; min-width: 120px; background-image: resource(&apos;Data/UI/Status/Gauge/Gauge_DF_Large_CP/Gauge_DF_Large_CP_bg_Center&apos;); max-height: 16px; min-height: 16px; align-self: stretch; justify-content: flex-start; align-items: auto;" />
<ui:VisualElement name="Right" style="flex-grow: 1; width: 4px; height: 16px; max-width: 4px; max-height: 16px; background-image: resource(&apos;Data/UI/Status/Gauge/Gauge_DF_Large_CP/Gauge_DF_Large_CP_bg_Right&apos;);" />
<ui:GroupBox name="CpBgB" style="flex-direction: row; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-bottom: 0; padding-left: 0; position: absolute; height: 13px; flex-grow: 1; width: 100%;">
<ui:VisualElement name="Left" style="flex-grow: 0; max-width: 4px; max-height: 16px; width: 4px; height: 16px; background-image: resource(&apos;Data/UI/Status/Gauge/Gauge_DF_Large_CP/Gauge_DF_Large_CP_bg_Center&apos;); flex-shrink: 0;" />
<ui:VisualElement name="Center" style="flex-grow: 1; background-image: resource(&apos;Data/UI/Status/Gauge/Gauge_DF_Large_CP/Gauge_DF_Large_CP_bg_Center&apos;); max-height: 16px; min-height: 16px; align-self: stretch; justify-content: flex-start; align-items: auto; flex-shrink: 0;" />
<ui:VisualElement name="Right" style="flex-grow: 0; width: 4px; height: 16px; max-width: 4px; max-height: 16px; background-image: resource(&apos;Data/UI/Status/Gauge/Gauge_DF_Large_CP/Gauge_DF_Large_CP_bg_Right&apos;); flex-shrink: 0;" />
</ui:GroupBox>
<ui:GroupBox name="CpGauge" style="flex-direction: row; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-bottom: 0; padding-left: 0; height: 16px; align-self: stretch; justify-content: flex-start; align-items: stretch; width: auto;">
<ui:VisualElement name="Left" style="flex-grow: 1; max-width: 4px; max-height: 16px; width: 4px; height: 16px; background-image: resource(&apos;Data/UI/Status/Gauge/Gauge_DF_Large_CP/Gauge_DF_Large_CP_Left&apos;);" />
<ui:VisualElement name="Center" style="flex-grow: 1; max-width: none; min-width: 90px; background-image: resource(&apos;Data/UI/Status/Gauge/Gauge_DF_Large_CP/Gauge_DF_Large_CP_Center&apos;); max-height: 16px; min-height: 16px; align-self: stretch; justify-content: flex-start; align-items: auto;" />
<ui:VisualElement name="Right" style="flex-grow: 1; width: 4px; height: 16px; max-width: 4px; max-height: 16px; background-image: resource(&apos;Data/UI/Status/Gauge/Gauge_DF_Large_CP/Gauge_DF_Large_CP_Right&apos;);" />
<ui:GroupBox name="CpGaugeB" style="flex-direction: row; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-bottom: 0; padding-left: 0; height: 16px; align-self: stretch; justify-content: flex-start; align-items: stretch; flex-grow: 1;">
<ui:VisualElement name="Left" style="flex-grow: 0; max-width: 4px; max-height: 16px; width: 4px; height: 16px; background-image: resource(&apos;Data/UI/Status/Gauge/Gauge_DF_Large_CP/Gauge_DF_Large_CP_Left&apos;); flex-shrink: 0;" />
<ui:VisualElement name="Center" style="flex-grow: 1; background-image: resource(&apos;Data/UI/Status/Gauge/Gauge_DF_Large_CP/Gauge_DF_Large_CP_Center&apos;); max-height: 16px; min-height: 16px; align-self: stretch; justify-content: flex-start; align-items: auto; flex-shrink: 0;" />
<ui:VisualElement name="Right" style="flex-grow: 1; width: 4px; height: 16px; max-width: 4px; max-height: 16px; background-image: resource(&apos;Data/UI/Status/Gauge/Gauge_DF_Large_CP/Gauge_DF_Large_CP_Right&apos;); flex-shrink: 0;" />
</ui:GroupBox>
</ui:GroupBox>
</ui:GroupBox>
<ui:Label tabindex="-1" text="49/49" parse-escape-sequences="true" display-tooltip-when-elided="true" name="CpVal" class="bar-label bar-label-numbers" style="border-left-width: 0; border-right-width: 0; -unity-text-outline-width: 1px; width: 91%;" />
<ui:Label tabindex="-1" text="49/49" parse-escape-sequences="true" display-tooltip-when-elided="true" name="CpLabelB" class="bar-label bar-label-numbers" style="border-left-width: 0; border-right-width: 0; -unity-text-outline-width: 1px; width: 91%;" />
<ui:GroupBox name="WeightContainer" style="flex-direction: row; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-bottom: 0; padding-left: 0; height: 14px; width: auto; font-size: 12px; align-self: stretch; justify-content: flex-start; align-items: auto;">
<ui:GroupBox style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-bottom: 0; padding-left: 0; align-self: stretch; align-items: stretch; justify-content: flex-start; width: 128px;">
<ui:GroupBox name="WeightBg" style="flex-direction: row; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-bottom: 0; padding-left: 0; position: absolute; width: auto; height: 13px;">
Expand Down
12 changes: 6 additions & 6 deletions l2-unity/Assets/Scripts/UI/Game/Character/CharacterWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ protected override IEnumerator BuildWindow(VisualElement root) {
_spLabel = GetLabelById("SpLabel");
_expLabel = GetLabelById("ExpLabel");
_weightLabel = GetLabelById("WeightLabel");
_cpLabel = GetLabelById("CpVal");
_cpLabel = GetLabelById("CpLabelB");
_hpBar = GetElementById("HpGauge");
_hpBarBg = GetElementById("HpBg");
_mpBar = GetElementById("MpGauge");
_mpBarBg = GetElementById("MpBg");
_cpBar = GetElementById("CpGauge");
_cpBarBg = GetElementById("CpBg");
_cpBar = GetElementById("CpGaugeB");
_cpBarBg = GetElementById("CpBgB");
_weightBar = GetElementById("WeightGauge");
_weightBarBg = GetElementById("WeightBg");
_expBar = GetElementById("ExpGauge");
Expand Down Expand Up @@ -210,18 +210,18 @@ private void UpdateSocial(PlayerStats stats) {

private void UpdateBars(PlayerStatus status, PlayerStats stats) {
_hpLabel.text = $"{status.Hp}/{stats.MaxHp}";
_mpLabel.text = $"{status.Hp}/{stats.MaxHp}";
_mpLabel.text = $"{status.Mp}/{stats.MaxMp}";
_cpLabel.text = $"{status.Cp}/{stats.MaxCp}";
_spLabel.text = stats.Sp.ToString();

if (stats.MaxExp > 0) {
_expLabel.text = $"{(float)stats.Exp / stats.MaxExp}%";
_expLabel.text = $"{((float)stats.Exp / stats.MaxExp).ToString("0.00")}%";
} else {
_expLabel.text = $"00.00%";
}

if (stats.MaxWeight > 0) {
_weightLabel.text = $"{(float)stats.CurrWeight / stats.MaxWeight}%";
_weightLabel.text = $"{((float)stats.CurrWeight / stats.MaxWeight).ToString("0.00")}%";
} else {
_weightLabel.text = $"00.00%";
}
Expand Down

0 comments on commit 794c8ec

Please sign in to comment.