def _edit_giant_prefix(arguments: Sequence[Any]) -> None: """Set the name prefix for Giants and log a message to console.""" try: GiantPrefix.CurrentValue = arguments[0] if isinstance(arguments, list) else arguments.name ModMenu.SaveModSettings(_mod_instance) Log(f"Reign Of Giants Giant Name: {GiantPrefix.CurrentValue}") except IndexError: Log("Must specify a name, e.g.: giantsname Teensie Weensie")
def _edit_giant_scale(arguments: Sequence[Any]) -> None: """Set the scale for Giants and log a message to console.""" try: GiantScale.CurrentValue = float(arguments[0] if isinstance(arguments, list) else arguments.size) ModMenu.SaveModSettings(_mod_instance) Log(f"Reign Of Giants Giant Size: {GiantScale.CurrentValue}") except (IndexError, ValueError): Log("Must specify a valid number, e.g.: giantssize 0.5")
def _SavePosition(): mapName = _GetMapName() positions = _Positions.CurrentValue.get(mapName, [None, None, None]) positions[_Position] = _GetPosition(_GetPlayerController()) _Positions.CurrentValue[mapName] = positions ModMenu.SaveModSettings(_ModInstance) _Feedback(f"Saved Position {_Position + 1}")
def _ToggleDamageNumbers(): _DamageNumbers.CurrentValue = not _DamageNumbers.CurrentValue ModMenu.SaveModSettings(_ModInstance) CallPostEdit(False) if _DamageNumbers.CurrentValue: _DamageNumberParticleSystem.Emitters = _DamageNumberEmitters _Feedback("Damage Numbers: On") else: _DamageNumberParticleSystem.Emitters = _NoDamageNumberEmitters _Feedback("Damage Numbers: Off") CallPostEdit(True)
def _toggle_cheat_mode() -> None: """Toggle cheat mode and log a message to console.""" CheatMode.CurrentValue = not CheatMode.CurrentValue ModMenu.SaveModSettings(_mod_instance) Log("Reign Of Giants Cheat Mode: " + ("On" if CheatMode.CurrentValue else "Off"))
if _ClientTeleporting.CurrentValue == "Allow": _ApplyPosition(PC, position) self.ClientApplyPosition(position, name, PC) else: self.ClientFeedback("Only session host may teleport players.", PC) @ServerMethod def ServerRequestGameSpeed(self, speed, PC = None): if _ClientSpeedPermissions.CurrentValue: _ApplyGameSpeed(speed) else: self.ClientFeedback("Only session host may modify game speed.", PC) @ServerMethod def ServerRequestPlayersOnly(self, playersOnly, PC = None): if _ClientSpeedPermissions.CurrentValue: _ApplyPlayersOnly(playersOnly) else: self.ClientFeedback("Only session host may toggle game freeze.", PC) _ModInstance = Commander() ModMenu.RegisterMod(_ModInstance) for mapName, positions in _Positions.CurrentValue.items(): if type(positions) is dict: _Positions.CurrentValue[mapName] = [positions, None, None] else: break ModMenu.SaveModSettings(_ModInstance)