1515--
1616---- ---------------------------------------------------------------------------------------------------------
1717
18- function clearParametersBox (caller )
18+ function genericClearParametersBox (caller )
1919 if (caller == " GM" ) then
2020 ma_gmParametersInput :SetText (" " )
2121 end
2222end
2323
24- function ShowBag (caller )
24+ function genericBagCommand (caller )
2525 local player = UnitName (" player" ) or UnitName (" target" )
2626 local param = nil
2727 if (caller == " GM" ) then
2828 param = ma_gmParametersInput :GetText ()
2929 end
30+ param = (param == nil or param == " " and " 0" or param )
3031 MangAdmin :ChatMsg (" .character check bag " .. param )
31- MangAdmin :LogAction (Locale [ " ma_gmBagOutput " ] .. player .. " " .. param )
32+ MangAdmin :LogAction (genericLogGenerator ( " log_bag " , {[ ' value ' ] = param , [ ' target ' ] = player }) )
3233end
3334
3435function genericCaller (dictionaryID , callID , value )
3536 local dictionary = getCallsDictionary (dictionaryID )
3637 local call = dictionary [callID ]
37- local param = " " ;
38+ local data = {
39+ [" value" ] = " " ,
40+ [" target" ] = nil
41+ }
3842 if call [GENERICS_isValueNeeded ] then
39- param = value
43+ data [ ' value ' ] = value
4044 elseif call [GENERICS_isParametersNeeded ] then
41- param = dictionary [GENERICS_parametersGet ]()
45+ data [ ' value ' ] = dictionary [GENERICS_parametersGet ]()
4246 end
43- MangAdmin :ChatMsg (call [GENERICS_command ].. param )
44- MangAdmin :LogAction (genericLogGenerator (call [GENERICS_message ], param ))
47+ if call [GENERICS_isTargetCheckNeeded ] then
48+ if commandTargetCheck () then
49+ data [' target' ] = getCommandTargetName ()
50+ else
51+ MangAdmin :Print (Locale [" selectionError" ])
52+ return
53+ end
54+ end
55+ MangAdmin :ChatMsg (call [GENERICS_command ].. data [' value' ])
56+ MangAdmin :LogAction (genericLogGenerator (call [GENERICS_message ], data ))
4557end
0 commit comments