diff --git a/majamoo.trigger b/majamoo.trigger index f1863bd..56657d0 100644 --- a/majamoo.trigger +++ b/majamoo.trigger @@ -3,7 +3,7 @@ - Weapon Management (DISABLE IF YOU ARE NOT GUNS) + guns 0 0 @@ -174,7 +174,7 @@ end #000000 #000000 - ^(.+) flips her (.+) to (single|auto) mode\.$ + ^(.+) flips her (.+) to (single|burst|auto) mode\.$ 1 @@ -863,7 +863,7 @@ end - debug + internal run-lua-code-v4 @@ -893,23 +893,6 @@ echo("\n") ^\/parse (.+)$ - - setup ammo - - - - ^ammo (.+) (.+)$ - - - reload and repack - - - - ^(?:rl|reload|rp|repack)$ - wield ^connect ([^\s]+) .* + + gun + + + + + + setup ammo + + + + ^ammo (.+) (.+)$ + + + reload and repack + + + + ^(?:rl|reload|rp|repack)$ + + @@ -946,15 +953,8 @@ function init() mcp = mcp or {} mcp_auth = mcp_auth or math.random(100000) - weapon = weapon or "WEAPON" - ammo = ammo or "AMMO" - fire_mode = fire_mode or "single" - ammo_count = ammo_count or 0 - ammo_remaining = ammo_remaining or 0 - magsize = mxagsize or 0 - - mcp["hp"] = mcp["hp"] or 30 - mcp["maxhp"] = mcp["maxhp"] or 30 + mcp["hp"] = mcp["hp"] or 30 + mcp["maxhp"] = mcp["maxhp"] or 30 mcp["hunger"] = mcp["hunger"] or 0 mcp["thirst"] = mcp["thirst"] or 0 mcp["stress"] = mcp["stress"] or 0 @@ -977,20 +977,25 @@ function init() --remember(area) --remember(users) - window_width = 0 - window_height = 0 - window_width, window_height = getMainWindowSize() - - position_room_window() - setMiniConsoleFontSize("room", 40) + window_width = 0 + window_height = 0 + sidebar_width = 0 + status_height = 0 + minimap_width = 0 + scroll_width = 15 + minimap_scale = .3 + + chat_console = true + + handleWindowResize() - position_chat_window() - setMiniConsoleFontSize("chat", 14) setWindowWrap("chat", 100) - position_status_window() - setMiniConsoleFontSize("status", 13) + + -- if we have more packages then enable them here + if (init_guns) then init_guns() end + end registerAnonymousEventHandler("sysLoadEvent", "init()") @@ -999,59 +1004,81 @@ registerAnonymousEventHandler("sysWindowResizeEvent", "handleWindowResize") function handleWindowResize() window_width, window_height = getMainWindowSize() + sidebar_width = math.max(window_width / 2 - 15, 540) + minimap_width = math.min(320, minimap_scale * sidebar_width) + status_height = math.max(minimap_width - 15, 150) + position_room_window() - position_status_window() + setMiniConsoleFontSize("room", determine_font_size(minimap_width, status_height, 10, 5, 16)) + + + local chat_font_size = determine_font_size(sidebar_width, (window_height - status_height - 10), 100, 10, 8) + + if (chat_font_size < 1) then + chat_console = false + else + chat_console = true + end + position_chat_window() + setMiniConsoleFontSize("chat", chat_font_size) + + position_status_window() + setMiniConsoleFontSize("status", determine_font_size(sidebar_width - minimap_width, status_height, 75, 8, 4)) end function position_room_window() - createMiniConsole("room", 0, 0, 320, 305) - moveWindow("room", window_width - 335, 0) + createMiniConsole("room", 0, 0, minimap_width, status_height) + moveWindow("room", window_width - minimap_width - scroll_width, 0) end + function position_status_window() - createMiniConsole("status", 0, 0, 780, 305) - moveWindow("status", window_width - 1115, 0) + createMiniConsole("status", 0, 0, (sidebar_width - minimap_width - scroll_width), status_height) + moveWindow("status", sidebar_width, 0) end + function position_chat_window() - createMiniConsole("chat", 0, 0, 1100, window_height - 315) - moveWindow("chat", window_width - 1115, 305) -end - - - - + - - - - - + + + + + + + + + status + + - - + + + + + + + + guns - + + - - - + - - - + - - + + + @@ -1316,7 +1419,7 @@ end ammo_count 4 - 390 + 387 3 @@ -1357,7 +1460,7 @@ end thirst 4 - 69 + 27 4 @@ -1381,14 +1484,14 @@ end hunger 4 - 31 + 103 4 time 4 - 5:12pm + 5:34am 4 @@ -1411,7 +1514,7 @@ end magsize 4 - 0 + 40 4