80 int num = (int)
Math.
Ceiling((
float)_perPlayerIsEnabled.Length / 8f);
86 for (
int i = 0; i < num; i++)
89 for (
int j = 0;
j < 8;
j++)
110 packet.Writer.Write((
byte)1);
125 packet.Writer.Write((
byte)1);
141 int num = (int)
Math.
Ceiling((
float)_perPlayerIsEnabled.Length / 8f);
143 packet.Writer.Write((
byte)0);
144 for (
int i = 0; i < num; i++)
147 for (
int j = 0;
j < 8;
j++)
149 int num2 = i * 8 +
j;
716 player.savedPerPlayerFieldsThatArentInThePlayerClass.godmodePowerEnabled =
_defaultToggleState;
722 player.savedPerPlayerFieldsThatArentInThePlayerClass.godmodePowerEnabled = godmodePowerEnabled;
756 player.savedPerPlayerFieldsThatArentInThePlayerClass.farPlacementRangePowerEnabled =
_defaultToggleState;
761 bool farPlacementRangePowerEnabled = reader.
ReadBoolean();
762 player.savedPerPlayerFieldsThatArentInThePlayerClass.farPlacementRangePowerEnabled = farPlacementRangePowerEnabled;
895 uIPanel.VAlign = 0.5f;
1032 uIPanel.HAlign = 0f;
1033 uIPanel.VAlign = 0.5f;
1076 RemoveFloatingPointsFromDrawPosition =
true
1179 _powerNameKey =
"CreativePowers.ModifyWindDirectionAndStrength";
1206 uIPanel.HAlign = 0f;
1207 uIPanel.VAlign = 0.5f;
1281 string originalText =
"";
1336 uIPanel.HAlign = 0f;
1337 uIPanel.VAlign = 0.5f;
1426 return "CreativePowers.FreezeTime";
1460 return "CreativePowers.FreezeWindDirectionAndStrength";
1494 return "CreativePowers.FreezeRainPower";
1528 return "CreativePowers.StopBiomeSpread";
1597 uIPanel.HAlign = 0f;
1598 uIPanel.VAlign = 0.5f;
1694 player.savedPerPlayerFieldsThatArentInThePlayerClass.spawnRatePowerSliderValue =
_sliderDefaultValue;
1699 float spawnRatePowerSliderValue = reader.
ReadSingle();
1700 player.savedPerPlayerFieldsThatArentInThePlayerClass.spawnRatePowerSliderValue = spawnRatePowerSliderValue;
static float Lerp(float value1, float value2, float amount)
static float Clamp(float value, float min, float max)
void Add(TKey key, TValue value)
virtual bool ReadBoolean()
virtual float ReadSingle()
virtual byte[] ReadBytes(int count)
static decimal Round(decimal d)
static double Ceiling(double a)
static double Abs(double value)
static void PlaySound(int type, Vector2 position, int style=1)
static readonly Point RainFreeze
static readonly Point TimeMidnight
static readonly Point WindDirection
static readonly Point WindFreeze
static readonly Point StopBiomeSpread
static readonly Point BlockPlacementRange
static readonly Point TimeNoon
static readonly Point ModifyTime
static readonly Point TimeDawn
static readonly Point EnemyStrengthSlider
static readonly Point FreezeTime
static readonly Point RainStrength
static readonly Point Godmode
static readonly Point EnemySpawnRate
static readonly Point TimeDusk
static GroupOptionButton< bool > CreateToggleButton(CreativePowerUIElementRequestInfo info)
static Color CommonSelectedColor
static void AddPermissionTextIfNeeded(ICreativePower power, ref string originalText)
static void AddDescriptionIfNeeded(ref string originalText, string descriptionKey)
static void UpdateUnlockStateByPower(ICreativePower power, UIElement button, Color colorWhenSelected)
static GroupOptionButton< bool > CreateSimpleButton(CreativePowerUIElementRequestInfo info)
static void UpdateUseMouseInterface(UIElement affectedElement)
static bool IsAvailableForPlayer(ICreativePower power, int playerIndex)
static UIVerticalSlider CreateSlider(Func< float > GetSliderValueMethod, Action< float > SetValueKeyboardMethod, Action SetValueGamepadMethod)
static UIImageFramed GetIconImage(Point iconLocation)
static void AddUnlockTextIfNeeded(ref string originalText, bool needed, string descriptionKey)
void OnPlayerJoining(int playerIndex)
void AttemptPushingChange()
bool _needsToCommitChange
void PushChange(float newSliderValue)
bool GetRemappedSliderValueFor(int playerIndex, out float value)
UIElement ProvideSlider()
float _sliderCurrentValueCache
DateTime _nextTimeWeCanPush
void DeserializeNetMessage(BinaryReader reader, int userId)
virtual void ResetForPlayer(int playerIndex)
void SetValueKeyboard(float value)
float _sliderDefaultValue
void ProvidePowerButtons(CreativePowerUIElementRequestInfo info, List< UIElement > elements)
void PushChangeAndSetSlider(float value)
PowerPermissionLevel DefaultPermissionLevel
PowerPermissionLevel CurrentPermissionLevel
void categoryButton_OnUpdate(UIElement affectedElement)
float _currentTargetValue
GroupOptionButton< int > GetOptionButton(CreativePowerUIElementRequestInfo info, int optionIndex, int currentOptionIndex)
float RemapSliderValueToPowerValue(float sliderValue)
void UpdateInfoFromSliderValueCache()
void OnPlayerJoining(int playerIndex)
void ProvidePowerButtons(CreativePowerUIElementRequestInfo info, List< UIElement > elements)
void DeserializeNetMessage(BinaryReader reader, int userId)
void Deserialize_SyncEveryone(BinaryReader reader, int userId)
PowerPermissionLevel CurrentPermissionLevel
bool[] _perPlayerIsEnabled
bool IsEnabledForPlayer(int playerIndex)
PowerPermissionLevel DefaultPermissionLevel
void button_OnClick(UIMouseEvent evt, UIElement listeningElement)
void SetEnabledState(int playerIndex, bool state)
void button_OnUpdate(UIElement affectedElement)
void button_OnUpdate(UIElement affectedElement)
PowerPermissionLevel CurrentPermissionLevel
void button_OnClick(UIMouseEvent evt, UIElement listeningElement)
void ProvidePowerButtons(CreativePowerUIElementRequestInfo info, List< UIElement > elements)
PowerPermissionLevel DefaultPermissionLevel
void DeserializeNetMessage(BinaryReader reader, int userId)
DateTime _nextTimeWeCanPush
void AttemptPushingChange()
virtual float GetSliderValueInner()
void SetValueKeyboard(float value)
PowerPermissionLevel CurrentPermissionLevel
void SetValueKeyboardForced(float value)
PowerPermissionLevel DefaultPermissionLevel
bool _needsToCommitChange
void categoryButton_OnUpdate(UIElement affectedElement)
UIElement ProvideSlider()
void UpdateInfoFromSliderValueCache()
void OnPlayerJoining(int playerIndex)
GroupOptionButton< int > GetOptionButton(CreativePowerUIElementRequestInfo info, int optionIndex, int currentOptionIndex)
float _currentTargetValue
void ProvidePowerButtons(CreativePowerUIElementRequestInfo info, List< UIElement > elements)
bool _syncToJoiningPlayers
void DeserializeNetMessage(BinaryReader reader, int userId)
float _sliderCurrentValueCache
void CustomizeButton(UIElement button)
void DeserializeNetMessage(BinaryReader reader, int userId)
void OnPlayerJoining(int playerIndex)
void SetPowerInfo(bool enabled)
PowerPermissionLevel DefaultPermissionLevel
void button_OnUpdate(UIElement affectedElement)
void ProvidePowerButtons(CreativePowerUIElementRequestInfo info, List< UIElement > elements)
void button_OnClick(UIMouseEvent evt, UIElement listeningElement)
string GetButtonTextKey()
PowerPermissionLevel CurrentPermissionLevel
void Click_Expert(UIMouseEvent evt, UIElement listeningElement)
void MouseOver_Master(UIElement affectedElement)
void Click_Normal(UIMouseEvent evt, UIElement listeningElement)
void MouseOver_Normal(UIElement affectedElement)
void MouseOver_Journey(UIElement affectedElement)
void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn)
float StrengthMultiplierToGiveNPCs
void Click_Journey(UIMouseEvent evt, UIElement listeningElement)
void Click_Master(UIMouseEvent evt, UIElement listeningElement)
void MouseOver_Expert(UIElement affectedElement)
void UpdateSliderColorAndShowMultiplierMouseOver(UIElement affectedElement)
void Load(BinaryReader reader, int gameVersionSaveWasMadeOn)
override UIElement ProvideSlider()
void Save(BinaryWriter writer)
override bool GetIsUnlocked()
static void Button_OnMouseOut(UIMouseEvent evt, UIElement listeningElement)
override void UpdateInfoFromSliderValueCache()
static void Button_OnMouseOver(UIMouseEvent evt, UIElement listeningElement)
static void AddIndication(UIPanel panel, float yAnchor, string indicationText, string iconImagePath, UIElement.ElementEvent updateEvent, UIElement.MouseEvent clickEvent)
override bool GetIsUnlocked()
void Save(Player player, BinaryWriter writer)
void ResetDataForNewPlayer(Player player)
void Load(Player player, BinaryReader reader, int gameVersionSaveWasMadeOn)
void ApplyLoadedDataToOutOfPlayerFields(Player player)
void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn)
void Load(BinaryReader reader, int gameVersionSaveWasMadeOn)
override bool GetIsUnlocked()
void Save(BinaryWriter writer)
override string GetButtonTextKey()
override void CustomizeButton(UIElement button)
void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn)
override bool GetIsUnlocked()
void Save(BinaryWriter writer)
override void CustomizeButton(UIElement button)
override string GetButtonTextKey()
void Load(BinaryReader reader, int gameVersionSaveWasMadeOn)
void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn)
void Load(BinaryReader reader, int gameVersionSaveWasMadeOn)
override void CustomizeButton(UIElement button)
override string GetButtonTextKey()
override bool GetIsUnlocked()
void Save(BinaryWriter writer)
void Load(Player player, BinaryReader reader, int gameVersionSaveWasMadeOn)
void ResetDataForNewPlayer(Player player)
void ApplyLoadedDataToOutOfPlayerFields(Player player)
override bool GetIsUnlocked()
void Save(Player player, BinaryWriter writer)
override float GetSliderValueInner()
override void UpdateInfoFromSliderValueCache()
void UpdateSliderAndShowMultiplierMouseOver(UIElement affectedElement)
void middleText_OnClick(UIMouseEvent evt, UIElement listeningElement)
override UIElement ProvideSlider()
void topText_OnClick(UIMouseEvent evt, UIElement listeningElement)
void bottomText_OnClick(UIMouseEvent evt, UIElement listeningElement)
override bool GetIsUnlocked()
void Button_OnMouseOver(UIMouseEvent evt, UIElement listeningElement)
void Button_OnMouseOut(UIMouseEvent evt, UIElement listeningElement)
void UpdateSliderAndShowMultiplierMouseOver(UIElement affectedElement)
void Load(BinaryReader reader, int gameVersionSaveWasMadeOn)
void Button_OnMouseOver(UIMouseEvent evt, UIElement listeningElement)
override bool GetIsUnlocked()
void bottomText_OnClick(UIMouseEvent evt, UIElement listeningElement)
void Button_OnMouseOut(UIMouseEvent evt, UIElement listeningElement)
void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn)
void topText_OnClick(UIMouseEvent evt, UIElement listeningElement)
override void UpdateInfoFromSliderValueCache()
override UIElement ProvideSlider()
void middleText_OnClick(UIMouseEvent evt, UIElement listeningElement)
void Save(BinaryWriter writer)
void UpdateSliderAndShowMultiplierMouseOver(UIElement affectedElement)
override UIElement ProvideSlider()
void bottomText_OnClick(UIMouseEvent evt, UIElement listeningElement)
void Button_OnMouseOver(UIMouseEvent evt, UIElement listeningElement)
ModifyWindDirectionAndStrength()
override bool GetIsUnlocked()
void Button_OnMouseOut(UIMouseEvent evt, UIElement listeningElement)
void topText_OnClick(UIMouseEvent evt, UIElement listeningElement)
override float GetSliderValueInner()
override void UpdateInfoFromSliderValueCache()
void middleText_OnClick(UIMouseEvent evt, UIElement listeningElement)
void UpdateSliderAndShowMultiplierMouseOver(UIElement affectedElement)
void topText_OnClick(UIMouseEvent evt, UIElement listeningElement)
void bottomText_OnClick(UIMouseEvent evt, UIElement listeningElement)
void Button_OnMouseOut(UIMouseEvent evt, UIElement listeningElement)
void Save(Player player, BinaryWriter writer)
override UIElement ProvideSlider()
bool GetShouldDisableSpawnsFor(int playerIndex)
void ApplyLoadedDataToOutOfPlayerFields(Player player)
void middleText_OnClick(UIMouseEvent evt, UIElement listeningElement)
SpawnRateSliderPerPlayerPower()
void Button_OnMouseOver(UIMouseEvent evt, UIElement listeningElement)
float StrengthMultiplierToGiveNPCs
override float RemapSliderValueToPowerValue(float sliderValue)
override bool GetIsUnlocked()
override void UpdateInfoFromSliderValueCache()
void Load(Player player, BinaryReader reader, int gameVersionSaveWasMadeOn)
void ResetDataForNewPlayer(Player player)
override bool GetIsUnlocked()
override void OnCreation()
override bool GetIsUnlocked()
override void OnCreation()
override bool GetIsUnlocked()
override void OnCreation()
override void OnCreation()
override bool GetIsUnlocked()
override string GetButtonTextKey()
void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn)
void Load(BinaryReader reader, int gameVersionSaveWasMadeOn)
override void CustomizeButton(UIElement button)
void Save(BinaryWriter writer)
override bool GetIsUnlocked()
static NetPacket PreparePacket(ushort powerId, int specificInfoBytesInPacketCount)
static float HandleSliderVerticalInput(float currentValue, float min, float max, float deadZone=0.2f, float sensitivity=0.5f)
static LocalizedText GetText(string key)
static string GetTextValue(string key)
static float windSpeedCurrent
static float windSpeedTarget
static void SkipToTime(int timeToSet, bool setIsDayTime)
static Microsoft.Xna.Framework.Color creativeModeColor
static Microsoft.Xna.Framework.Color OurFavoriteColor
static IAssetRepository Assets
static readonly NetManager Instance
bool farPlacementRangePowerEnabled
float spawnRatePowerSliderValue
SavedPlayerDataWithAnnoyingRules savedPerPlayerFieldsThatArentInThePlayerClass
delegate void ElementEvent(UIElement affectedElement)
delegate void MouseEvent(UIMouseEvent evt, UIElement listeningElement)
static float Remap(float fromValue, float fromMin, float fromMax, float toMin, float toMax, bool clamped=true)
static float GetLerpValue(float from, float to, float t, bool clamped=false)
static unsafe DateTime UtcNow