Xillian112 wrote:This mod cause lags if i queue something ...
Sorry for bad english =(
What kind of lag? A slight stutter when you add an item to the queue or a real lagspike (1 second or longer)? The first one is normal when there is a (long) queue and you add an item with many prerequisites.
Re: [MOD 0.12.12+] Research queue 1.2.5
Posted: Thu Apr 21, 2016 5:03 am
by Xillian112
MrDoomah wrote:
Xillian112 wrote:This mod cause lags if i queue something ...
Sorry for bad english =(
What kind of lag? A slight stutter when you add an item to the queue or a real lagspike (1 second or longer)? The first one is normal when there is a (long) queue and you add an item with many prerequisites.
~5 Seconds no lag, 1 second or 2 seconnds lag, 5seconds no lag, 1 or 2 seconds lag .............. it goes untill all researchs completed.
here are something that can make things better, for my point of view.
1 - When you click on the button " \/ " at the RQ menu at left, to go down your research list, its change to " /\ " then you click again and it goes up instead of down, would be better if the " /\ " up button appears at right side instead of push the down button to the right, same thing on the bottom buttons.
2 - Would be nice to have on RQ menu an checkbox like "Don't show RP GUI when research finishes"
3 - Would be nice to have an Close button on RQ GUI instead of clicking on the RQ icon
Re: [MOD 0.12.12+] Research queue 1.2.5
Posted: Sun Apr 24, 2016 9:33 am
by judos
Hi there,
Great mod!
However Roktaal just found an error by using robotMiningSite mod of mine together with research queue.
The problem seems to be that the method find_entity was renamed to find_entities in your initialise.lua but is still used with the old name in control.lua:
script.on_event(defines.events.on_force_created, function(event)
if global.researchQ == nil then init() end
if global.researchQ[event.force.name] == nil then global.researchQ[event.force.name] = {} end
if global.labs[event.force.name] == nil then global.labs[event.force.name] = find_entity({type = "lab", force = event.force}) end
end)
Can you update your mod with this small fix? Thanks a lot
This sound normal, it shouldn't lag. Can you provide me with a zip of your mod folder?
Re: [MOD 0.12.12+] Research queue 1.2.5
Posted: Sun Apr 24, 2016 10:12 pm
by ZombieMooose
hello, I have a problem - the size of the menu keeps changing to the point where I can't click the button to close it (I have to save, then load to get it down)
is there a way to stop the change in window size?
Re: [MOD 0.12.12+] Research queue 1.2.5
Posted: Thu Apr 28, 2016 12:00 am
by Smoovious
Sworn wrote:2 - Would be nice to have on RQ menu an checkbox like "Don't show RP GUI when research finishes"
^ ^ THIS ^ ^
-- Smoov
Re: [MOD 0.12.12+] Research queue 1.2.5
Posted: Sun May 15, 2016 8:20 pm
by scherzeking
I get laggs too in every 2 - 3 seconds for a like 1/4 sec. when I queue too much... (like more then 10- 20+)
Re: [MOD 0.12.12+] Research queue 1.2.5
Posted: Tue May 17, 2016 11:52 am
by creekz
Smoovious wrote:
Sworn wrote:2 - Would be nice to have on RQ menu an checkbox like "Don't show RP GUI when research finishes"
Feature request: Add a category filter to hide researches that don't have any item unlocks in themselves or their children. I don't care to research all the damage upgrades and speed bonuses and such, but I do want to research other things with "2" and "3" indicators that actually unlock stuff.
Re: [MOD 0.12.12+] Research queue 1.2.5
Posted: Thu May 26, 2016 8:16 am
by sparr
Bug report: If the Q window gets too big it can cover up the RQ button, leaving no (obvious?) way to close the window. I had to do `/c game.player.gui.center.Q.destroy()` from the console.
diff --git a/functions/draw_grid.lua b/functions/draw_grid.lua
index f248b77..8f2d008 100644
--- a/functions/draw_grid.lua
+++ b/functions/draw_grid.lua
@@ -46,16 +46,40 @@ function technologies(player)
if global.showIcon[player.index] then colSpan = set_colspan else colSpan = math.floor(set_colspan / 3) end --create a smaller table if text is displayed.
local rq_table = player.gui.center.Q.add2q.add{type = "table", name = "add2q_table", style = "rq-table1", colspan = colSpan}
local count = 0
+
+ local banned_sciences = {} -- create a table of research ingredients that the research may not have.
+ for item, science in pairs(global.science) do
+ if not science[player.index] then table.insert(banned_sciences, item) end
+ end
+
for name, tech in pairs(player.force.technologies) do
- if tech.enabled and (not tech.researched or global.showResearched[player.index]) then --checks if the research is enabled and either not completed or if it should show completed.
- if (global.showExtended[player.index] or not tech.upgrade or not any(tech.prerequisites, "upgrade") or any(tech.prerequisites, "researched") or matches(tech.prerequisites, "name", global.researchQ[player.force.name])) then
- -- ^checks if the research is an upgrade technology and whether or not to show it.
- local t = {} -- create a table of research ingredients that the research may not have.
- for item, science in pairs(global.science) do
- if not science[player.index] then table.insert(t, item) end
- end
+
+ if tech.enabled and -- only show researchable tech
+ (not tech.researched or global.showResearched[player.index]) then -- optionally show researched tech
+
+ if global.showExtended[player.index] or -- optionally show all reachable techs
+ not tech.upgrade or -- don't show upgrades by default
+ not any(tech.prerequisites, "upgrade") or -- don't show techs with upgrade prereqs by default
+ all(tech.prerequisites, "researched") or -- do show techs with researched pre-requisites
+ matches(tech.prerequisites, "name", global.researchQ[player.force.name]) -- do show already queued techs
+ then
- if not matches(tech.research_unit_ingredients, "name", t) then --checks if any on the research ingredients match the banned list
+ -- check if any of the research ingredients match the banned list, including pre-requisites
+ banned_science = false
+ techs_to_check = {tech}
+ while #techs_to_check > 0 do
+ local t = techs_to_check[#techs_to_check]
+ if matches(t.research_unit_ingredients, "name", banned_sciences) then
+ banned_science = true
+ break
+ end
+ table.remove(techs_to_check,#techs_to_check)
+ for _,new_t in pairs(t.prerequisites) do
+ techs_to_check[#techs_to_check+1] = new_t
+ end
+ end
+
+ if not banned_science then
local background1, background2 = nil, nil --select the right (color) of background depending on the status of the technology (done/available or in queue)
if tech.researched then
background1 = "rq-done-frame"
This fixes the problem where you've got blue tech hidden, and you queue a green tech just to discover that it auto-queues some blue prereqs.
Re: [MOD 0.12.12+] Research queue 1.2.6
Posted: Tue May 31, 2016 5:08 am
by sparr
Here's a patch that lets you filter out techs that don't unlock any recipes.
diff --git a/control.lua b/control.lua
index de7ee8c..b5889ca 100644
--- a/control.lua
+++ b/control.lua
@@ -5,6 +5,12 @@ require("functions.draw_grid")
require("functions.initialise")
script.on_configuration_changed(function(event)
+
+ -- mini-Migration
+ if global.showRecipesOnly == nil then
+ global.showRecipesOnly = {}
+ end
+
if event.mod_changes ~= nil and event.mod_changes["research-queue"] ~= nil then
init()
for index, _ in pairs(game.players) do
@@ -86,6 +92,10 @@ script.on_event(defines.events.on_gui_click, function(event)
global.showResearched[player.index] = not global.showResearched[player.index]
drawGrid(force)
+ elseif event.element.name == "rq-showrecipesonly" then
+ global.showRecipesOnly[player.index] = not global.showRecipesOnly[player.index]
+ drawGrid(force)
+
elseif event.element.name == "rqextend-button" then
global.showExtended[player.index] = not global.showExtended[player.index]
if not global.showExtended[player.index] then global.offset_tech[player.index] = 0 end
diff --git a/functions/draw_grid.lua b/functions/draw_grid.lua
index 8f2d008..aa7190c 100644
--- a/functions/draw_grid.lua
+++ b/functions/draw_grid.lua
@@ -29,6 +29,8 @@ function options(player)
options.add{type = "checkbox", name = "rqscience", style = "rq-scienceDone-checkbox", state = not global.showResearched[player.index]}
+ options.add{type = "checkbox", name = "rq-showrecipesonly", style = "rq-showrecipesonly-checkbox", state = global.showRecipesOnly[player.index]}
+
for name, science in pairs(global.science) do
if global.showExtended[player.index] or not (global.bobsmodules[name] or global.bobsaliens[name]) then
options.add{type = "checkbox", name = "rq-science"..name, style = "rq-tool"..name, state = not science[player.index]}
@@ -40,6 +42,15 @@ function options(player)
end
end
+function techHasRecipes(tech)
+ for k,v in pairs(tech.effects) do
+ if v.type=="unlock-recipe" then
+ return true
+ end
+ end
+ return false
+end
+
function technologies(player)
local caption = player.gui.center.Q.add2q.add{type = "label", name = "add2q_caption", caption = "List of technologies"}
caption.style.minimal_width = set_colspan * 68
@@ -55,7 +66,8 @@ function technologies(player)
for name, tech in pairs(player.force.technologies) do
if tech.enabled and -- only show researchable tech
- (not tech.researched or global.showResearched[player.index]) then -- optionally show researched tech
+ (not tech.researched or global.showResearched[player.index]) and -- optionally show researched tech
+ (techHasRecipes(tech) or not global.showRecipesOnly[player.index]) then
if global.showExtended[player.index] or -- optionally show all reachable techs
not tech.upgrade or -- don't show upgrades by default
diff --git a/functions/initialise.lua b/functions/initialise.lua
index 2463faf..7b59ea0 100644
--- a/functions/initialise.lua
+++ b/functions/initialise.lua
@@ -10,6 +10,7 @@ function init()
end
if global.showIcon == nil then global.showIcon = {} end
if global.showResearched == nil then global.showResearched = {} end
+ if global.showRecipesOnly == nil then global.showRecipesOnly = {} end
if global.offset_queue == nil then global.offset_queue = {} end
if global.offset_tech == nil then global.offset_tech = {} end
if global.showExtended == nil then global.showExtended = {} end
@@ -47,6 +48,7 @@ function player_init(player_index)
if not game.players[player_index].gui.top.research_Q then game.players[player_index].gui.top.add{type = "button", name = "research_Q", caption = "RQ", style = "rq-top-button"} end
global.showIcon[player_index] = true
global.showResearched[player_index] = false
+ global.showRecipesOnly[player_index] = false
global.offset_queue[player_index] = 0
global.offset_tech[player_index] = 0
global.showExtended[player_index] = false
diff --git a/prototypes/gui.lua b/prototypes/gui.lua
index 36a8d5c..7f32e3c 100644
--- a/prototypes/gui.lua
+++ b/prototypes/gui.lua
@@ -1051,6 +1051,61 @@ data.raw["gui-style"].default["rq-scienceDone-checkbox"] =
}
}
+data.raw["gui-style"].default["rq-showrecipesonly-checkbox"] =
+{
+ type = "checkbox_style",
+ top_padding = 0,
+ right_padding = 0,
+ bottom_padding = 0,
+ left_padding = 0,
+ width = 32,
+ height = 32,
+ scalable = false,
+ left_click_sound =
+ {
+ {
+ filename = "__core__/sound/gui-click.ogg",
+ volume = 1
+ }
+ },
+ default_background =
+ {
+ filename = "__research-queue__/graphics/gui_elements.png",
+ priority = "extra-high-no-scale",
+ width = 32,
+ height = 32,
+ x = 32,
+ y = 32
+ },
+ hovered_background =
+ {
+ filename = "__research-queue__/graphics/gui_elements.png",
+ priority = "extra-high-no-scale",
+ width = 32,
+ height = 32,
+ x = 32,
+ y = 32
+ },
+ clicked_background =
+ {
+ filename = "__research-queue__/graphics/gui_elements.png",
+ priority = "extra-high-no-scale",
+ width = 32,
+ height = 32,
+ x = 32,
+ y = 32
+ },
+ checked =
+ {
+ filename = "__research-queue__/graphics/gui_elements.png",
+ priority = "extra-high-no-scale",
+ width = 32,
+ height = 32,
+ x = 96,
+ y = 64
+ }
+}
+
data.raw["gui-style"].default["rq-table1"] =
{
type = "table_style",
I originally added this so that I could choose to ignore weapon/turret/robot upgrades, but it has the nice side effect of also filtering out techs that don't do anything at all other than unlock other techs (and those techs already show up on their own, anyway).
I didn't make any new art, just re-used one of the existing sprites.
Re: [MOD 0.12.12+] Research queue 1.2.6
Posted: Thu Jun 02, 2016 4:43 pm
by Shrooblord
There seems to be a conflict with using the Test Mode mod's "Unlock all Tech" button when Research Queue is also installed:
Error while running the event handler: __test-
mod__/gui.lua:1092: Error while running the
event handler: __research-
queue__/functions/draw_grid.lua:78: Unknown
style rq-techdata-dummy-basic-mining-drill
Re: [MOD 0.12.12+] Research queue 1.2.6
Posted: Thu Jun 02, 2016 6:03 pm
by sparr
Can you post which version of TM and RQ you're using?
Re: [MOD 0.12.12+] Research queue 1.2.6
Posted: Thu Jun 02, 2016 6:46 pm
by MrDoomah
Shrooblord wrote:There seems to be a conflict with using the Test Mode mod's "Unlock all Tech" button when Research Queue is also installed:
Error while running the event handler: __test-
mod__/gui.lua:1092: Error while running the
event handler: __research-
queue__/functions/draw_grid.lua:78: Unknown
style rq-techdata-dummy-basic-mining-drill
That's not a problem with test-mode and this mod's combatability. That's an issue with this mod and whatever mod adds the "data-dummy-basic-mining-drill" research. What other mods do you have?