Files
zzz_REBIRTH__Utils/Scripts/XUIC/XUiC_MapAreaRebirth.cs
2025-06-04 16:44:53 +09:30

146 lines
5.1 KiB
C#

public class XUiC_MapAreaRebirth : XUiC_MapArea
{
public static bool purgeIconToggle = false;
public static bool tier0IconToggle = false;
public static bool tier1IconToggle = false;
public static bool tier2IconToggle = false;
public static bool tier3IconToggle = false;
public static bool tier4IconToggle = false;
public static bool tier5IconToggle = false;
public override void Init()
{
base.Init();
this.GetChildById("purgedIcon").OnPress += new XUiEvent_OnPressEventHandler(this.onPurgedIconPressed);
this.GetChildById("tier0Icon").OnPress += new XUiEvent_OnPressEventHandler(this.ontier0IconPressed);
this.GetChildById("tier1Icon").OnPress += new XUiEvent_OnPressEventHandler(this.ontier1IconPressed);
this.GetChildById("tier2Icon").OnPress += new XUiEvent_OnPressEventHandler(this.ontier2IconPressed);
this.GetChildById("tier3Icon").OnPress += new XUiEvent_OnPressEventHandler(this.ontier3IconPressed);
this.GetChildById("tier4Icon").OnPress += new XUiEvent_OnPressEventHandler(this.ontier4IconPressed);
this.GetChildById("tier5Icon").OnPress += new XUiEvent_OnPressEventHandler(this.ontier5IconPressed);
}
public override void Update(float _dt)
{
base.Update(_dt);
this.RefreshBindings();
}
public void onIconPressed(ref bool iconToggle, string navObjectClassName)
{
iconToggle = !iconToggle;
foreach (NavObject navObject in NavObjectManager.Instance.NavObjectList)
{
if (navObject != null && navObject.NavObjectClass != null)
{
if (navObject.NavObjectClass.NavObjectClassName == navObjectClassName)
{
navObject.hiddenOnCompass = iconToggle;
}
}
}
}
public void onPurgedIconPressed(XUiController _sender, int _mouseButton)
{
bool localIconToggle = purgeIconToggle;
onIconPressed(ref localIconToggle, "purge_waypoint");
purgeIconToggle = localIconToggle;
}
public void ontier0IconPressed(XUiController _sender, int _mouseButton)
{
bool localIconToggle = tier0IconToggle;
onIconPressed(ref localIconToggle, "discovered_waypoint_0");
tier0IconToggle = localIconToggle;
}
public void ontier1IconPressed(XUiController _sender, int _mouseButton)
{
bool localIconToggle = tier1IconToggle;
onIconPressed(ref localIconToggle, "discovered_waypoint_1");
tier1IconToggle = localIconToggle;
}
public void ontier2IconPressed(XUiController _sender, int _mouseButton)
{
bool localIconToggle = tier2IconToggle;
onIconPressed(ref localIconToggle, "discovered_waypoint_2");
tier2IconToggle = localIconToggle;
}
public void ontier3IconPressed(XUiController _sender, int _mouseButton)
{
bool localIconToggle = tier3IconToggle;
onIconPressed(ref localIconToggle, "discovered_waypoint_3");
tier3IconToggle = localIconToggle;
}
public void ontier4IconPressed(XUiController _sender, int _mouseButton)
{
bool localIconToggle = tier4IconToggle;
onIconPressed(ref localIconToggle, "discovered_waypoint_4");
tier4IconToggle = localIconToggle;
}
public void ontier5IconPressed(XUiController _sender, int _mouseButton)
{
bool localIconToggle = tier5IconToggle;
onIconPressed(ref localIconToggle, "discovered_waypoint_5");
tier5IconToggle = localIconToggle;
}
public override bool GetBindingValue(ref string value, string bindingName)
{
switch (bindingName)
{
case "height":
value = "712";
if (RebirthVariables.customScenario == "purge")
{
value = "670";
}
return true;
case "heightY":
value = "712";
if (RebirthVariables.customScenario == "purge")
{
//value = "670";
value = "712";
}
return true;
case "heightY2":
value = "761";
if (RebirthVariables.customScenario == "purge")
{
value = "780";
}
return true;
case "posY":
value = "-49";
if (RebirthVariables.customScenario == "purge")
{
value = "-91";
}
return true;
case "clipY":
value = "-356";
if (RebirthVariables.customScenario == "purge")
{
value = "-335";
}
return true;
case "purge":
value = "false";
if (RebirthVariables.customScenario == "purge")
{
value = "true";
}
return true;
default:
return base.GetBindingValue(ref value, bindingName);
}
}
}