XG-Proyect-v3.x.x icon indicating copy to clipboard operation
XG-Proyect-v3.x.x copied to clipboard

[v.4.x.x] Future improvement - for next version

Open jonamix-ar opened this issue 5 years ago • 10 comments

It can be done

  • Separate the example buildings
{resources_buildings_list}
Code
{/resources_buildings_list}
{storeage_buildings_list}
Code
{/resources_buildings_list}
  • Order ships and technologies such as ogame redesign
  • Ships separated by fighting ships and civil ships.
  • For Ships
{combat_ships_list}
Code
{/combat_ships_list}
{civil_ships_list}
Code
{/civil_ships_list}
  • For Research
{basic_research_list}
Code
{/basic_research_list}

{navigation_research_list}
Code
{/navigation_research_list}

{advanced_research_list}
Code
{/advanced_research_list}

{combat_research_list}
Code
{/combat_research_list}
  • Unify the pages Technology, infos, Requirements of the technology

I could do it but I still don't know how codeigniter works and I don't want to hinder the code either .

We could plan later for 4.0.0 to make a redesign I have it completely done with gonzalo but we use it with an old core I know how the javascripts of the redesign work and everything else now that you can join me with the next version I integrate the javascript inside each page

PD: This is just a just idea.

jonamix-ar avatar Nov 10 '19 16:11 jonamix-ar

hola Jonas, es bueno ver que no te fuiste de XG ;)

Nykus avatar Nov 10 '19 17:11 Nykus

hola Jonas, es bueno ver que no te fuiste de XG ;)

nunca me iria XGP me ayudo mucho a programar... jajja hay q devolver y quiero ayudar por eso tiro esta idea para futuras mas adelante

jonamix-ar avatar Nov 10 '19 17:11 jonamix-ar

Recuerdame, te pedí ayuda varias veces en el foro XG , Nikkos

Nykus avatar Nov 10 '19 17:11 Nykus

Very well. So, in the next version it would be better to use Framework with a more beautiful theme engine instead of codeigniter. Like laravel (blade)

MahmutHizal avatar Nov 10 '19 17:11 MahmutHizal

Very well. So, in the next version it would be better to use Framework with a more beautiful theme engine instead of codeigniter. Like laravel (blade)

Se me hace complejo laravel usar prefiero CI

jonamix-ar avatar Nov 10 '19 17:11 jonamix-ar

Very well. So, in the next version it would be better to use Framework with a more beautiful theme engine instead of codeigniter. Like laravel (blade)

Se me hace complejo laravel usar prefiero CI

Yeah, that's true. Laravel is complicated, but I think it will save time and coding if build on laravel logic

MahmutHizal avatar Nov 10 '19 17:11 MahmutHizal

igual yo esto lo estoy diciendo por que es mas facil la programacion del rediseño. lo digo por que fue muy tedioso la programacion para el rediseño... te lo digo por que se nos complico la integracion de los javascritpts como va el proyecto que esta llevando @LucasKovacs esta barbaro para adaptar un rediseño si necesidad de tocar tanto el php y poder usar ambos diseños.. igual como dice para futuras versiones..

ahora hay que centrarnos en encontrar bug y reportarlos xD

jonamix-ar avatar Nov 10 '19 17:11 jonamix-ar

Laravel can save a lot of time, I believe that CI 4 can too :) we'll explore in the future what's the best and less time consuming to migrate

LucasKovacs avatar Nov 11 '19 10:11 LucasKovacs

Laravel is the best 😜

MahmutHizal avatar Nov 11 '19 10:11 MahmutHizal

Muy rebuscado el codigo se puede mejorar si por supuesto

private function buildPage(): void
    {
        $parse = $this->langs->language;
        $technologies_basic = '';
        $technologies_drive = '';
        $technologies_advanced = '';
        $technologies_combat = '';

        // time to do something
        $this->doCommand();

        // build the page
        foreach ($this->_reslist['technologies_basic'] as $tech) {
            if (DevelopmentsLib::isDevelopmentAllowed($this->user, $this->planet, $tech)) {
                $RowParse['dpath'] = DPATH;
                $RowParse['tech_id'] = $tech;
                $building_level = $this->user[$this->_resource[$tech]];
                $RowParse['tech_level'] = DevelopmentsLib::setLevelFormat($building_level, $this->langs, $tech, $this->user);
                $RowParse['tech_name'] = $this->langs->line($this->_resource[$tech]);
                $RowParse['tech_descr'] = $this->langs->language['descriptions'][$this->_resource[$tech]];
                $RowParse['tech_price'] = DevelopmentsLib::formatedDevelopmentPrice($this->user, $this->planet, $tech, $this->langs);
                $SearchTime = DevelopmentsLib::developmentTime($this->user, $this->planet, $tech, false, $this->_lab_level);
                $RowParse['search_time'] = DevelopmentsLib::formatedDevelopmentTime($SearchTime, $this->langs->line('re_time'));

                if (!$this->_is_working['is_working']) {
                    if (DevelopmentsLib::isDevelopmentPayable($this->user, $this->planet, $tech) && !$this->userLibrary->isOnVacations($this->user)) {
                        if (!$this->isLaboratoryInQueue()) {
                            $action_link = FormatLib::colorRed($this->langs->line('re_research'));
                        } else {
                            $action_link = UrlHelper::setUrl('game.php?page=research&cmd=search&tech=' . $tech, FormatLib::colorGreen($this->langs->line('re_research')));
                        }
                    } else {
                        $action_link = FormatLib::colorRed($this->langs->line('re_research'));
                    }
                } else {
                    if ($this->_is_working['working_on']['planet_b_tech_id'] == $tech) {
                        $bloc = $this->langs->language;

                        if ($this->_is_working['working_on']['planet_id'] != $this->planet['planet_id']) {
                            $bloc['tech_time'] = $this->_is_working['working_on']['planet_b_tech'] - time();
                            $bloc['tech_name'] = $this->langs->line('re_from') . $this->_is_working['working_on']['planet_name'] . '<br /> ' . FormatLib::prettyCoords($this->_is_working['working_on']['planet_galaxy'], $this->_is_working['working_on']['planet_system'], $this->_is_working['working_on']['planet_planet']);
                            $bloc['tech_home'] = $this->_is_working['working_on']['planet_id'];
                            $bloc['tech_id'] = $this->_is_working['working_on']['planet_b_tech_id'];
                        } else {
                            $bloc['tech_time'] = $this->planet['planet_b_tech'] - time();
                            $bloc['tech_name'] = '';
                            $bloc['tech_home'] = $this->planet['planet_id'];
                            $bloc['tech_id'] = $this->planet['planet_b_tech_id'];
                        }
                        $action_link = $this->template->set(
                            'buildings/buildings_research_script',
                            $bloc
                        );
                    } else {
                        $action_link = '<center>-</center>';
                    }
                }
                $RowParse['tech_link'] = $action_link;
                $technologies_basic .= $this->template->set(
                    'buildings/buildings_research_row',
                    $RowParse
                );
            }
        }


        foreach ($this->_reslist['technologies_drive'] as $tech) {
            if (DevelopmentsLib::isDevelopmentAllowed($this->user, $this->planet, $tech)) {
                $RowParse['dpath'] = DPATH;
                $RowParse['tech_id'] = $tech;
                $building_level = $this->user[$this->_resource[$tech]];
                $RowParse['tech_level'] = DevelopmentsLib::setLevelFormat($building_level, $this->langs, $tech, $this->user);
                $RowParse['tech_name'] = $this->langs->line($this->_resource[$tech]);
                $RowParse['tech_descr'] = $this->langs->language['descriptions'][$this->_resource[$tech]];
                $RowParse['tech_price'] = DevelopmentsLib::formatedDevelopmentPrice($this->user, $this->planet, $tech, $this->langs);
                $SearchTime = DevelopmentsLib::developmentTime($this->user, $this->planet, $tech, false, $this->_lab_level);
                $RowParse['search_time'] = DevelopmentsLib::formatedDevelopmentTime($SearchTime, $this->langs->line('re_time'));

                if (!$this->_is_working['is_working']) {
                    if (DevelopmentsLib::isDevelopmentPayable($this->user, $this->planet, $tech) && !$this->userLibrary->isOnVacations($this->user)) {
                        if (!$this->isLaboratoryInQueue()) {
                            $action_link = FormatLib::colorRed($this->langs->line('re_research'));
                        } else {
                            $action_link = UrlHelper::setUrl('game.php?page=research&cmd=search&tech=' . $tech, FormatLib::colorGreen($this->langs->line('re_research')));
                        }
                    } else {
                        $action_link = FormatLib::colorRed($this->langs->line('re_research'));
                    }
                } else {
                    if ($this->_is_working['working_on']['planet_b_tech_id'] == $tech) {
                        $bloc = $this->langs->language;

                        if ($this->_is_working['working_on']['planet_id'] != $this->planet['planet_id']) {
                            $bloc['tech_time'] = $this->_is_working['working_on']['planet_b_tech'] - time();
                            $bloc['tech_name'] = $this->langs->line('re_from') . $this->_is_working['working_on']['planet_name'] . '<br /> ' . FormatLib::prettyCoords($this->_is_working['working_on']['planet_galaxy'], $this->_is_working['working_on']['planet_system'], $this->_is_working['working_on']['planet_planet']);
                            $bloc['tech_home'] = $this->_is_working['working_on']['planet_id'];
                            $bloc['tech_id'] = $this->_is_working['working_on']['planet_b_tech_id'];
                        } else {
                            $bloc['tech_time'] = $this->planet['planet_b_tech'] - time();
                            $bloc['tech_name'] = '';
                            $bloc['tech_home'] = $this->planet['planet_id'];
                            $bloc['tech_id'] = $this->planet['planet_b_tech_id'];
                        }
                        $action_link = $this->template->set(
                            'buildings/buildings_research_script',
                            $bloc
                        );
                    } else {
                        $action_link = '<center>-</center>';
                    }
                }
                $RowParse['tech_link'] = $action_link;
                $technologies_drive .= $this->template->set(
                    'buildings/buildings_research_row',
                    $RowParse
                );
            }
        }

        foreach ($this->_reslist['technologies_advanced'] as $tech) {
            if (DevelopmentsLib::isDevelopmentAllowed($this->user, $this->planet, $tech)) {
                $RowParse['dpath'] = DPATH;
                $RowParse['tech_id'] = $tech;
                $building_level = $this->user[$this->_resource[$tech]];
                $RowParse['tech_level'] = DevelopmentsLib::setLevelFormat($building_level, $this->langs, $tech, $this->user);
                $RowParse['tech_name'] = $this->langs->line($this->_resource[$tech]);
                $RowParse['tech_descr'] = $this->langs->language['descriptions'][$this->_resource[$tech]];
                $RowParse['tech_price'] = DevelopmentsLib::formatedDevelopmentPrice($this->user, $this->planet, $tech, $this->langs);
                $SearchTime = DevelopmentsLib::developmentTime($this->user, $this->planet, $tech, false, $this->_lab_level);
                $RowParse['search_time'] = DevelopmentsLib::formatedDevelopmentTime($SearchTime, $this->langs->line('re_time'));

                if (!$this->_is_working['is_working']) {
                    if (DevelopmentsLib::isDevelopmentPayable($this->user, $this->planet, $tech) && !$this->userLibrary->isOnVacations($this->user)) {
                        if (!$this->isLaboratoryInQueue()) {
                            $action_link = FormatLib::colorRed($this->langs->line('re_research'));
                        } else {
                            $action_link = UrlHelper::setUrl('game.php?page=research&cmd=search&tech=' . $tech, FormatLib::colorGreen($this->langs->line('re_research')));
                        }
                    } else {
                        $action_link = FormatLib::colorRed($this->langs->line('re_research'));
                    }
                } else {
                    if ($this->_is_working['working_on']['planet_b_tech_id'] == $tech) {
                        $bloc = $this->langs->language;

                        if ($this->_is_working['working_on']['planet_id'] != $this->planet['planet_id']) {
                            $bloc['tech_time'] = $this->_is_working['working_on']['planet_b_tech'] - time();
                            $bloc['tech_name'] = $this->langs->line('re_from') . $this->_is_working['working_on']['planet_name'] . '<br /> ' . FormatLib::prettyCoords($this->_is_working['working_on']['planet_galaxy'], $this->_is_working['working_on']['planet_system'], $this->_is_working['working_on']['planet_planet']);
                            $bloc['tech_home'] = $this->_is_working['working_on']['planet_id'];
                            $bloc['tech_id'] = $this->_is_working['working_on']['planet_b_tech_id'];
                        } else {
                            $bloc['tech_time'] = $this->planet['planet_b_tech'] - time();
                            $bloc['tech_name'] = '';
                            $bloc['tech_home'] = $this->planet['planet_id'];
                            $bloc['tech_id'] = $this->planet['planet_b_tech_id'];
                        }
                        $action_link = $this->template->set(
                            'buildings/buildings_research_script',
                            $bloc
                        );
                    } else {
                        $action_link = '<center>-</center>';
                    }
                }
                $RowParse['tech_link'] = $action_link;
                $technologies_advanced .= $this->template->set(
                    'buildings/buildings_research_row',
                    $RowParse
                );
            }
        }

        foreach ($this->_reslist['technologies_combat'] as $tech) {
            if (DevelopmentsLib::isDevelopmentAllowed($this->user, $this->planet, $tech)) {
                $RowParse['dpath'] = DPATH;
                $RowParse['tech_id'] = $tech;
                $building_level = $this->user[$this->_resource[$tech]];
                $RowParse['tech_level'] = DevelopmentsLib::setLevelFormat($building_level, $this->langs, $tech, $this->user);
                $RowParse['tech_name'] = $this->langs->line($this->_resource[$tech]);
                $RowParse['tech_descr'] = $this->langs->language['descriptions'][$this->_resource[$tech]];
                $RowParse['tech_price'] = DevelopmentsLib::formatedDevelopmentPrice($this->user, $this->planet, $tech, $this->langs);
                $SearchTime = DevelopmentsLib::developmentTime($this->user, $this->planet, $tech, false, $this->_lab_level);
                $RowParse['search_time'] = DevelopmentsLib::formatedDevelopmentTime($SearchTime, $this->langs->line('re_time'));

                if (!$this->_is_working['is_working']) {
                    if (DevelopmentsLib::isDevelopmentPayable($this->user, $this->planet, $tech) && !$this->userLibrary->isOnVacations($this->user)) {
                        if (!$this->isLaboratoryInQueue()) {
                            $action_link = FormatLib::colorRed($this->langs->line('re_research'));
                        } else {
                            $action_link = UrlHelper::setUrl('game.php?page=research&cmd=search&tech=' . $tech, FormatLib::colorGreen($this->langs->line('re_research')));
                        }
                    } else {
                        $action_link = FormatLib::colorRed($this->langs->line('re_research'));
                    }
                } else {
                    if ($this->_is_working['working_on']['planet_b_tech_id'] == $tech) {
                        $bloc = $this->langs->language;

                        if ($this->_is_working['working_on']['planet_id'] != $this->planet['planet_id']) {
                            $bloc['tech_time'] = $this->_is_working['working_on']['planet_b_tech'] - time();
                            $bloc['tech_name'] = $this->langs->line('re_from') . $this->_is_working['working_on']['planet_name'] . '<br /> ' . FormatLib::prettyCoords($this->_is_working['working_on']['planet_galaxy'], $this->_is_working['working_on']['planet_system'], $this->_is_working['working_on']['planet_planet']);
                            $bloc['tech_home'] = $this->_is_working['working_on']['planet_id'];
                            $bloc['tech_id'] = $this->_is_working['working_on']['planet_b_tech_id'];
                        } else {
                            $bloc['tech_time'] = $this->planet['planet_b_tech'] - time();
                            $bloc['tech_name'] = '';
                            $bloc['tech_home'] = $this->planet['planet_id'];
                            $bloc['tech_id'] = $this->planet['planet_b_tech_id'];
                        }
                        $action_link = $this->template->set(
                            'buildings/buildings_research_script',
                            $bloc
                        );
                    } else {
                        $action_link = '<center>-</center>';
                    }
                }
                $RowParse['tech_link'] = $action_link;
                $technologies_combat .= $this->template->set(
                    'buildings/buildings_research_row',
                    $RowParse
                );
            }
        }

        $parse['noresearch'] = (!$this->isLaboratoryInQueue() ? $this->langs->line('re_building_lab') : '');
        $parse['technologies_basic'] = $technologies_basic;
        $parse['technologies_drive'] = $technologies_drive;
        $parse['technologies_advanced'] = $technologies_advanced;
        $parse['technologies_combat'] = $technologies_combat;

        $this->page->display(
            $this->template->set(
                'buildings/buildings_research',
                $parse
            )
        );
    }

screencapture-localhost-XG-Proyect-game-php-2023-04-26-01_02_44

jonamix-ar avatar Apr 26 '23 04:04 jonamix-ar