fixed end, nv n tint cmd

This commit is contained in:
HeyFang 2025-02-22 19:06:23 +05:30
parent 2a07c0c840
commit 88129dc7a8

View file

@ -41,108 +41,81 @@ def ExcelCommand(command, arguments, clientid, accountid):
Returns: Returns:
None None
""" """
if command in ['recents']: match command:
get_recents(clientid) case 'recents':
if command in ['info']: get_recents(clientid)
get_player_info(arguments, clientid) case 'info':
if command in ['maxplayers', 'max']: get_player_info(arguments, clientid)
changepartysize(arguments) case 'maxplayers' | 'max':
if command in ['createteam']: changepartysize(arguments)
create_team(arguments) case 'createteam':
elif command == 'playlist': create_team(arguments)
changeplaylist(arguments) case 'playlist':
elif command == 'kick': changeplaylist(arguments)
kick(arguments) case 'kick':
elif command == 'ban': kick(arguments)
ban(arguments) case 'ban':
elif command in ['end', 'next']: ban(arguments)
end(arguments) case 'end' | 'next':
elif command == 'kickvote': end(arguments)
kikvote(arguments, clientid) case 'kickvote':
elif command == 'hideid': kikvote(arguments, clientid)
hide_player_spec() case 'hideid':
elif command == "showid": hide_player_spec()
show_player_spec() case 'showid':
elif command == 'lm': show_player_spec()
last_msgs(clientid) case 'lm':
last_msgs(clientid)
elif command == 'gp': case 'gp':
get_profiles(arguments, clientid) get_profiles(arguments, clientid)
case 'party':
elif command == 'party': party_toggle(arguments)
party_toggle(arguments) case 'quit' | 'restart':
quit(arguments)
elif command in ['quit', 'restart']: case 'mute' | 'mutechat':
quit(arguments) mute(arguments)
case 'unmute' | 'unmutechat':
elif command in ['mute', 'mutechat']: un_mute(arguments)
mute(arguments) case 'remove' | 'rm':
remove(arguments)
elif command in ['unmute', 'unmutechat']: case 'sm' | 'slow' | 'slowmo':
un_mute(arguments) slow_motion()
case 'nv' | 'night':
elif command in ['remove', 'rm']: nv(arguments)
remove(arguments) case 'tint':
tint(arguments)
elif command in ['sm', 'slow', 'slowmo']: case 'pause' | 'pausegame':
slow_motion() pause()
case 'cameraMode' | 'camera_mode' | 'rotate_camera':
elif command in ['nv', 'night']: rotate_camera()
nv(arguments) case 'createrole':
create_role(arguments)
elif command in ['dv', 'day']: case 'addrole':
dv(arguments) add_role_to_player(arguments)
case 'removerole':
elif command == 'tint': remove_role_from_player(arguments)
tint(arguments) case 'getroles':
get_roles_of_player(arguments, clientid)
elif command in ['pause', 'pausegame']: case 'addcommand' | 'addcmd':
pause() add_command_to_role(arguments)
case 'removecommand' | 'removecmd':
elif command in ['cameraMode', 'camera_mode', 'rotate_camera']: remove_command_to_role(arguments)
rotate_camera() case 'changetag':
change_role_tag(arguments)
elif command == 'createrole': case 'customtag':
create_role(arguments) set_custom_tag(arguments)
case 'customeffect' | 'effect':
elif command == 'addrole': set_custom_effect(arguments)
add_role_to_player(arguments) case 'removetag':
remove_custom_tag(arguments)
elif command == 'removerole': case 'removeeffect':
remove_role_from_player(arguments) remove_custom_effect(arguments)
case 'spectators':
elif command == 'getroles': spectators(arguments)
get_roles_of_player(arguments, clientid) case 'lobbytime':
change_lobby_check_time(arguments)
elif command in ['addcommand', 'addcmd']: case _:
add_command_to_role(arguments) pass
elif command in ['removecommand', 'removecmd']:
remove_command_to_role(arguments)
elif command == 'changetag':
change_role_tag(arguments)
elif command == 'customtag':
set_custom_tag(arguments)
elif command in ['customeffect', 'effect']:
set_custom_effect(arguments)
elif command in ['removetag']:
remove_custom_tag(arguments)
elif command in ['removeeffect']:
remove_custom_effect(arguments)
# elif command in ['add', 'whitelist']:
# whitelst_it(accountid, arguments)
elif command == 'spectators':
spectators(arguments)
elif command == 'lobbytime':
change_lobby_check_time(arguments)
def create_team(arguments): def create_team(arguments):
@ -287,8 +260,9 @@ def party_toggle(arguments):
def end(arguments): def end(arguments):
if arguments == [] or arguments == ['']: if arguments == [] or arguments == ['']:
try: try:
with _babase.Context(_babase.get_foreground_host_activity()): game = bs.get_foreground_host_activity()
_babase.get_foreground_host_activity().end_game() with game.context:
game.end_game()
except: except:
pass pass
@ -389,49 +363,39 @@ def slow_motion():
def nv(arguments): def nv(arguments):
activity = _babase.get_foreground_host_activity() def is_close(a, b, tol=1e-5):
return all(abs(x - y) < tol for x, y in zip(a, b))
if arguments == [] or arguments == ['']: try:
activity = bs.get_foreground_host_activity()
if activity.globalsnode.tint != (0.5, 0.7, 1.0): nv_tint = (0.5, 0.5, 1.0)
activity.globalsnode.tint = (0.5, 0.7, 1.0) nv_ambient = (1.5, 1.5, 1.5)
else:
# will fix this soon if is_close(activity.globalsnode.tint, nv_tint):
pass
elif arguments[0] == 'off':
if activity.globalsnode.tint != (0.5, 0.7, 1.0):
return
else:
pass
def dv(arguments):
activity = _babase.get_foreground_host_activity()
if arguments == [] or arguments == ['']:
if activity.globalsnode.tint != (1, 1, 1):
activity.globalsnode.tint = (1, 1, 1) activity.globalsnode.tint = (1, 1, 1)
#adding ambient color to imitate moonlight reflection on objects
activity.globalsnode.ambient_color = (1, 1, 1)
#print(activity.globalsnode.tint)
else: else:
# will fix this soon activity.globalsnode.tint = nv_tint
pass activity.globalsnode.ambient_color = nv_ambient
#print(activity.globalsnode.tint)
elif arguments[0] == 'off': except:
if activity.globalsnode.tint != (1, 1, 1): return
return
else:
pass
def tint(arguments): def tint(arguments):
print(len(arguments))
activity = _babase.get_foreground_host_activity()
if len(arguments) == 3: if len(arguments) == 3:
if all(isinstance(val, (int, float)) for val in arguments): args = arguments
activity.globalsnode.tint = ( r, g, b = float(args[0]), float(args[1]), float(args[2])
arguments[0], arguments[1], arguments[2]) try:
# print(dir(activity.globalsnode))
print(r, g, b)
activity = bs.get_foreground_host_activity()
activity.globalsnode.tint = (r, g, b)
except:
return
def pause(): def pause():